From: Gerrit Huizenga <gh@us.ibm.com>

NOTE:  function names need to be changed - probably add ckrm_

Make get_class() function visible outside its compilation unit.  Use
get_class() when find_class_name() might have returned NULL and we'd like to
create a new class instead of deal with NULL.

Signed-Off-By: Matt Helsley <matthltc@us.ibm.com>
Signed-Off-By: Gerrit Huizenga <gh@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 kernel/ckrm/rbce/rbce_core.c     |   11 ++++++-----
 kernel/ckrm/rbce/rbce_internal.h |    1 +
 kernel/ckrm/rbce/rbce_main.c     |    2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff -puN kernel/ckrm/rbce/rbce_core.c~ckrm-make-get_class-global kernel/ckrm/rbce/rbce_core.c
--- 25/kernel/ckrm/rbce/rbce_core.c~ckrm-make-get_class-global	Wed Jul 13 14:44:37 2005
+++ 25-akpm/kernel/ckrm/rbce/rbce_core.c	Wed Jul 13 14:44:37 2005
@@ -29,13 +29,11 @@ static void rbce_class_addcb(const char 
 	struct rbce_class *cls;
 
 	write_lock(&rbce_rwlock);
-	cls = find_class_name((char *)classname);
-	if (cls)
+ 	cls = get_class(classname, &classtype);
+	if (cls) {
 		cls->classobj = clsobj;
-	else
-		cls = create_rbce_class(classname, classtype, clsobj);
-	if (cls)
 		notify_class_action(cls, 1);
+	}
 	write_unlock(&rbce_rwlock);
 	return;
 }
@@ -57,6 +55,9 @@ rbce_class_deletecb(const char *classnam
 			printk(KERN_ERR "rbce: class %s changed identity\n",
 			       classname);
 		}
+#ifdef CRBCE_EXTENSION
+		put_class(cls);
+#endif
 		notify_class_action(cls, 0);
 		cls->classobj = NULL;
 		list_for_each_entry(pos, &rules_list[cls->classtype], link) {
diff -puN kernel/ckrm/rbce/rbce_internal.h~ckrm-make-get_class-global kernel/ckrm/rbce/rbce_internal.h
--- 25/kernel/ckrm/rbce/rbce_internal.h~ckrm-make-get_class-global	Wed Jul 13 14:44:37 2005
+++ 25-akpm/kernel/ckrm/rbce/rbce_internal.h	Wed Jul 13 14:44:37 2005
@@ -247,6 +247,7 @@ extern struct rbce_private_data *create_
 						     *, int);
 extern bitvector_t *get_gl_mask_vecs(int);
 extern struct rbce_class *find_class_name(const char *);
+extern struct rbce_class *get_class(char *classname, int *classtype);
 extern void put_class(struct rbce_class *);
 extern void free_all_private_data(void);
 
diff -puN kernel/ckrm/rbce/rbce_main.c~ckrm-make-get_class-global kernel/ckrm/rbce/rbce_main.c
--- 25/kernel/ckrm/rbce/rbce_main.c~ckrm-make-get_class-global	Wed Jul 13 14:44:37 2005
+++ 25-akpm/kernel/ckrm/rbce/rbce_main.c	Wed Jul 13 14:44:37 2005
@@ -211,7 +211,7 @@ struct rbce_class *create_rbce_class(con
 	return cls;
 }
 
-static struct rbce_class *get_class(char *classname, int *classtype)
+struct rbce_class *get_class(char *classname, int *classtype)
 {
 	struct rbce_class *cls;
 	void *classobj;
_