]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/sysfs.h
sysfs: Remove first pass at shadow directory support
[linux-2.6-omap-h63xx.git] / include / linux / sysfs.h
index 523405e1e1f6463a5f8aa925655d97234adaefae..c16e4c5116216d023648de8ce13a89052ab7b0b3 100644 (file)
 #define _SYSFS_H_
 
 #include <linux/compiler.h>
+#include <linux/errno.h>
 #include <linux/list.h>
 #include <asm/atomic.h>
 
 struct kobject;
 struct module;
-struct nameidata;
-struct dentry;
 
+/* FIXME
+ * The *owner field is no longer used, but leave around
+ * until the tree gets cleaned up fully.
+ */
 struct attribute {
        const char              * name;
-       struct module           * owner;
+       struct module           * owner;
        mode_t                  mode;
 };
 
@@ -38,14 +41,14 @@ struct attribute_group {
  */
 
 #define __ATTR(_name,_mode,_show,_store) { \
-       .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE },     \
+       .attr = {.name = __stringify(_name), .mode = _mode },   \
        .show   = _show,                                        \
        .store  = _store,                                       \
 }
 
 #define __ATTR_RO(_name) { \
-       .attr   = { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE },   \
-       .show   = _name##_show, \
+       .attr   = { .name = __stringify(_name), .mode = 0444 }, \
+       .show   = _name##_show,                                 \
 }
 
 #define __ATTR_NULL { .attr = { .name = NULL } }
@@ -58,8 +61,10 @@ struct bin_attribute {
        struct attribute        attr;
        size_t                  size;
        void                    *private;
-       ssize_t (*read)(struct kobject *, char *, loff_t, size_t);
-       ssize_t (*write)(struct kobject *, char *, loff_t, size_t);
+       ssize_t (*read)(struct kobject *, struct bin_attribute *,
+                       char *, loff_t, size_t);
+       ssize_t (*write)(struct kobject *, struct bin_attribute *,
+                        char *, loff_t, size_t);
        int (*mmap)(struct kobject *, struct bin_attribute *attr,
                    struct vm_area_struct *vma);
 };
@@ -69,23 +74,30 @@ struct sysfs_ops {
        ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
 };
 
+#define SYSFS_TYPE_MASK                0x00ff
 #define SYSFS_ROOT             0x0001
 #define SYSFS_DIR              0x0002
 #define SYSFS_KOBJ_ATTR        0x0004
 #define SYSFS_KOBJ_BIN_ATTR    0x0008
 #define SYSFS_KOBJ_LINK        0x0020
-#define SYSFS_NOT_PINNED       (SYSFS_KOBJ_ATTR | SYSFS_KOBJ_BIN_ATTR | SYSFS_KOBJ_LINK)
+#define SYSFS_COPY_NAME                (SYSFS_DIR | SYSFS_KOBJ_LINK)
+
+#define SYSFS_FLAG_MASK                ~SYSFS_TYPE_MASK
+#define SYSFS_FLAG_REMOVED     0x0100
 
 #ifdef CONFIG_SYSFS
 
+extern int sysfs_schedule_callback(struct kobject *kobj,
+               void (*func)(void *), void *data, struct module *owner);
+
 extern int __must_check
-sysfs_create_dir(struct kobject *, struct dentry *);
+sysfs_create_dir(struct kobject *);
 
 extern void
 sysfs_remove_dir(struct kobject *);
 
 extern int __must_check
-sysfs_rename_dir(struct kobject *, struct dentry *, const char *new_name);
+sysfs_rename_dir(struct kobject *kobj, const char *new_name);
 
 extern int __must_check
 sysfs_move_dir(struct kobject *, struct kobject *);
@@ -122,17 +134,17 @@ void sysfs_remove_file_from_group(struct kobject *kobj,
 
 void sysfs_notify(struct kobject * k, char *dir, char *attr);
 
-
-extern int sysfs_make_shadowed_dir(struct kobject *kobj,
-       void * (*follow_link)(struct dentry *, struct nameidata *));
-extern struct dentry *sysfs_create_shadow_dir(struct kobject *kobj);
-extern void sysfs_remove_shadow_dir(struct dentry *dir);
-
 extern int __must_check sysfs_init(void);
 
 #else /* CONFIG_SYSFS */
 
-static inline int sysfs_create_dir(struct kobject * k, struct dentry *shadow)
+static inline int sysfs_schedule_callback(struct kobject *kobj,
+               void (*func)(void *), void *data, struct module *owner)
+{
+       return -ENOSYS;
+}
+
+static inline int sysfs_create_dir(struct kobject * kobj)
 {
        return 0;
 }
@@ -142,9 +154,7 @@ static inline void sysfs_remove_dir(struct kobject * k)
        ;
 }
 
-static inline int sysfs_rename_dir(struct kobject * k,
-                                       struct dentry *new_parent,
-                                       const char *new_name)
+static inline int sysfs_rename_dir(struct kobject * kobj, const char *new_name)
 {
        return 0;
 }
@@ -219,12 +229,6 @@ static inline void sysfs_notify(struct kobject * k, char *dir, char *attr)
 {
 }
 
-static inline int sysfs_make_shadowed_dir(struct kobject *kobj,
-       void * (*follow_link)(struct dentry *, struct nameidata *))
-{
-       return 0;
-}
-
 static inline int __must_check sysfs_init(void)
 {
        return 0;