vserver 1.9.3
[linux-2.6.git] / include / linux / kobject.h
index f32f39b..331d25b 100644 (file)
  * destructors. 
  */
 
-#if defined(__KERNEL__) && !defined(_KOBJECT_H_)
+#ifndef _KOBJECT_H_
 #define _KOBJECT_H_
 
+#ifdef __KERNEL__
+
 #include <linux/types.h>
 #include <linux/list.h>
 #include <linux/sysfs.h>
 #include <linux/rwsem.h>
+#include <linux/kref.h>
 #include <asm/atomic.h>
 
 #define KOBJ_NAME_LEN  20
@@ -26,7 +29,7 @@
 struct kobject {
        char                    * k_name;
        char                    name[KOBJ_NAME_LEN];
-       atomic_t                refcount;
+       struct kref             kref;
        struct list_head        entry;
        struct kobject          * parent;
        struct kset             * kset;
@@ -48,7 +51,7 @@ extern void kobject_cleanup(struct kobject *);
 extern int kobject_add(struct kobject *);
 extern void kobject_del(struct kobject *);
 
-extern void kobject_rename(struct kobject *, char *new_name);
+extern int kobject_rename(struct kobject *, char *new_name);
 
 extern int kobject_register(struct kobject *);
 extern void kobject_unregister(struct kobject *);
@@ -58,6 +61,8 @@ extern void kobject_put(struct kobject *);
 
 extern void kobject_hotplug(const char *action, struct kobject *);
 
+extern char * kobject_get_path(struct kset *, struct kobject *, int);
+
 struct kobj_type {
        void (*release)(struct kobject *);
        struct sysfs_ops        * sysfs_ops;
@@ -229,5 +234,5 @@ struct subsys_attribute {
 extern int subsys_create_file(struct subsystem * , struct subsys_attribute *);
 extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *);
 
-
+#endif /* __KERNEL__ */
 #endif /* _KOBJECT_H_ */