aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-09-20 03:05:12 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:51:11 -0400
commitdc2f75f0e0cac645c22c85bcf429683b3fa0d2d9 (patch)
tree775a89f5abae0cdc9688a32a6209d74c61cb5975
parentd6b4fd2faeb9ddf55ce09cf90b88981e579ee010 (diff)
sysfs: make sysfs_root a regular directory dirent
sysfs_root is different from a regular directory dirent in that it's of type SYSFS_ROOT and doesn't have a name. These differences aren't used by anybody and only adds to complexity. Make sysfs_root a regular directory dirent. Signed-off-by: Tejun Heo <htejun@gmail.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--fs/sysfs/inode.c5
-rw-r--r--fs/sysfs/mount.c3
-rw-r--r--fs/sysfs/sysfs.h9
3 files changed, 6 insertions, 11 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index b6ac4e6d6e79..c40fb9fdd04c 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -157,11 +157,6 @@ static void sysfs_init_inode(struct sysfs_dirent *sd, struct inode *inode)
157 157
158 /* initialize inode according to type */ 158 /* initialize inode according to type */
159 switch (sysfs_type(sd)) { 159 switch (sysfs_type(sd)) {
160 case SYSFS_ROOT:
161 inode->i_op = &sysfs_dir_inode_operations;
162 inode->i_fop = &sysfs_dir_operations;
163 inc_nlink(inode); /* directory, account for "." */
164 break;
165 case SYSFS_DIR: 160 case SYSFS_DIR:
166 inode->i_op = &sysfs_dir_inode_operations; 161 inode->i_op = &sysfs_dir_inode_operations;
167 inode->i_fop = &sysfs_dir_operations; 162 inode->i_fop = &sysfs_dir_operations;
diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index 28bf359981fc..465902c18d31 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -24,8 +24,9 @@ static const struct super_operations sysfs_ops = {
24}; 24};
25 25
26struct sysfs_dirent sysfs_root = { 26struct sysfs_dirent sysfs_root = {
27 .s_name = "",
27 .s_count = ATOMIC_INIT(1), 28 .s_count = ATOMIC_INIT(1),
28 .s_flags = SYSFS_ROOT, 29 .s_flags = SYSFS_DIR,
29 .s_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO, 30 .s_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO,
30 .s_ino = 1, 31 .s_ino = 1,
31}; 32};
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 2a68bfa46e43..60405a6e4c22 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -48,11 +48,10 @@ struct sysfs_dirent {
48#define SD_DEACTIVATED_BIAS INT_MIN 48#define SD_DEACTIVATED_BIAS INT_MIN
49 49
50#define SYSFS_TYPE_MASK 0x00ff 50#define SYSFS_TYPE_MASK 0x00ff
51#define SYSFS_ROOT 0x0001 51#define SYSFS_DIR 0x0001
52#define SYSFS_DIR 0x0002 52#define SYSFS_KOBJ_ATTR 0x0002
53#define SYSFS_KOBJ_ATTR 0x0004 53#define SYSFS_KOBJ_BIN_ATTR 0x0004
54#define SYSFS_KOBJ_BIN_ATTR 0x0008 54#define SYSFS_KOBJ_LINK 0x0008
55#define SYSFS_KOBJ_LINK 0x0020
56#define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK) 55#define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK)
57 56
58#define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK 57#define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK