vfs: rename block_fsync() to blkdev_fsync()
[safe/jmp/linux-2.6] / include / linux / kobject.h
index 39e709f..3950d3c 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/wait.h>
 #include <asm/atomic.h>
 
-#define KOBJ_NAME_LEN                  20
 #define UEVENT_HELPER_PATH_LEN         256
 #define UEVENT_NUM_ENVP                        32      /* number of env pointers */
 #define UEVENT_BUFFER_SIZE             2048    /* buffer for the variables */
@@ -59,20 +58,23 @@ enum kobject_action {
 
 struct kobject {
        const char              *name;
-       struct kref             kref;
        struct list_head        entry;
        struct kobject          *parent;
        struct kset             *kset;
        struct kobj_type        *ktype;
        struct sysfs_dirent     *sd;
+       struct kref             kref;
        unsigned int state_initialized:1;
        unsigned int state_in_sysfs:1;
        unsigned int state_add_uevent_sent:1;
        unsigned int state_remove_uevent_sent:1;
+       unsigned int uevent_suppress:1;
 };
 
 extern int kobject_set_name(struct kobject *kobj, const char *name, ...)
                            __attribute__((format(printf, 2, 3)));
+extern int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
+                                 va_list vargs);
 
 static inline const char *kobject_name(const struct kobject *kobj)
 {
@@ -104,7 +106,7 @@ extern char *kobject_get_path(struct kobject *kobj, gfp_t flag);
 
 struct kobj_type {
        void (*release)(struct kobject *kobj);
-       struct sysfs_ops *sysfs_ops;
+       const struct sysfs_ops *sysfs_ops;
        struct attribute **default_attrs;
 };
 
@@ -116,9 +118,9 @@ struct kobj_uevent_env {
 };
 
 struct kset_uevent_ops {
-       int (*filter)(struct kset *kset, struct kobject *kobj);
-       const char *(*name)(struct kset *kset, struct kobject *kobj);
-       int (*uevent)(struct kset *kset, struct kobject *kobj,
+       int (* const filter)(struct kset *kset, struct kobject *kobj);
+       const char *(* const name)(struct kset *kset, struct kobject *kobj);
+       int (* const uevent)(struct kset *kset, struct kobject *kobj,
                      struct kobj_uevent_env *env);
 };
 
@@ -130,7 +132,7 @@ struct kobj_attribute {
                         const char *buf, size_t count);
 };
 
-extern struct sysfs_ops kobj_sysfs_ops;
+extern const struct sysfs_ops kobj_sysfs_ops;
 
 /**
  * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem.
@@ -153,14 +155,14 @@ struct kset {
        struct list_head list;
        spinlock_t list_lock;
        struct kobject kobj;
-       struct kset_uevent_ops *uevent_ops;
+       const struct kset_uevent_ops *uevent_ops;
 };
 
 extern void kset_init(struct kset *kset);
 extern int __must_check kset_register(struct kset *kset);
 extern void kset_unregister(struct kset *kset);
 extern struct kset * __must_check kset_create_and_add(const char *name,
-                                               struct kset_uevent_ops *u,
+                                               const struct kset_uevent_ops *u,
                                                struct kobject *parent_kobj);
 
 static inline struct kset *to_kset(struct kobject *kobj)
@@ -187,6 +189,8 @@ extern struct kobject *kset_find_obj(struct kset *, const char *);
 
 /* The global /sys/kernel/ kobject for people to chain off of */
 extern struct kobject *kernel_kobj;
+/* The global /sys/kernel/mm/ kobject for people to chain off of */
+extern struct kobject *mm_kobj;
 /* The global /sys/hypervisor/ kobject for people to chain off of */
 extern struct kobject *hypervisor_kobj;
 /* The global /sys/power/ kobject for people to chain off of */