vserver 1.9.3
[linux-2.6.git] / include / linux / kobject.h
index 6360d22..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;
@@ -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_ */