Skip to content

Commit

Permalink
sysfs: move struct sysfs_dirent to private header
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Adam J. Richter authored and Greg Kroah-Hartman committed Feb 23, 2007
1 parent 63ce18c commit d56c3ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
11 changes: 11 additions & 0 deletions fs/sysfs/sysfs.h
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
13 changes: 1 addition & 12 deletions include/linux/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
struct kobject;
struct module;
struct nameidata;
struct dentry;

struct attribute {
const char * name;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d56c3ea

Please sign in to comment.