sysfs: move struct sysfs_dirent to private header
authorAdam J. Richter <adam@yggdrasil.com>
Fri, 16 Feb 2007 13:35:25 +0000 (21:35 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 23 Feb 2007 22:52:09 +0000 (14:52 -0800)
struct sysfs_dirent is private to the fs/sysfs/ subtree.  It is
not even referenced as an opaque structure outside of that subtree.

The following patch moves the declaration from include/linux/sysfs.h to
fs/sysfs/sysfs.h, making it clearer that nothing else in the kernel
dereferences it.

I have been running this patch for years.  Please integrate and forward
upstream if there are no objections.

From: "Adam J. Richter" <adam@yggdrasil.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/sysfs/sysfs.h
include/linux/sysfs.h

index d976b0005549e9deb720352298550dfed644a839..a77c57e5a6d5d983116203656559911142251c87 100644 (file)
@@ -1,3 +1,14 @@
+struct sysfs_dirent {
+       atomic_t                s_count;
+       struct list_head        s_sibling;
+       struct list_head        s_children;
+       void                    * s_element;
+       int                     s_type;
+       umode_t                 s_mode;
+       struct dentry           * s_dentry;
+       struct iattr            * s_iattr;
+       atomic_t                s_event;
+};
 
 extern struct vfsmount * sysfs_mount;
 extern struct kmem_cache *sysfs_dir_cachep;
index 192de3afa96ba9244a5e69e98f0e66b17fc6df66..f07065cba7c1392304d4db9fd35530ce3034f95c 100644 (file)
@@ -17,6 +17,7 @@
 struct kobject;
 struct module;
 struct nameidata;
+struct dentry;
 
 struct attribute {
        const char              * name;
@@ -68,18 +69,6 @@ struct sysfs_ops {
        ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
 };
 
-struct sysfs_dirent {
-       atomic_t                s_count;
-       struct list_head        s_sibling;
-       struct list_head        s_children;
-       void                    * s_element;
-       int                     s_type;
-       umode_t                 s_mode;
-       struct dentry           * s_dentry;
-       struct iattr            * s_iattr;
-       atomic_t                s_event;
-};
-
 #define SYSFS_ROOT             0x0001
 #define SYSFS_DIR              0x0002
 #define SYSFS_KOBJ_ATTR        0x0004