diff options
author | Dave Hansen <haveblue@us.ibm.com> | 2006-10-01 02:29:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-01 03:39:30 -0400 |
commit | d8c76e6f45c111c32a4b3e50a2adc9210737b0d8 (patch) | |
tree | 25521b59d48c6d8c9aec1af54dbe5008ad4b215b /fs/sysfs | |
parent | 9a53c3a783c2fa9b969628e65695c11c3e51e673 (diff) |
[PATCH] r/o bind mount prepwork: inc_nlink() helper
This is mostly included for parity with dec_nlink(), where we will have some
more hooks. This one should stay pretty darn straightforward for now.
Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/sysfs')
-rw-r--r-- | fs/sysfs/dir.c | 4 | ||||
-rw-r--r-- | fs/sysfs/mount.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 5f3d725d1125..3aa3434621ca 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c | |||
@@ -103,7 +103,7 @@ static int init_dir(struct inode * inode) | |||
103 | inode->i_fop = &sysfs_dir_operations; | 103 | inode->i_fop = &sysfs_dir_operations; |
104 | 104 | ||
105 | /* directory inodes start off with i_nlink == 2 (for "." entry) */ | 105 | /* directory inodes start off with i_nlink == 2 (for "." entry) */ |
106 | inode->i_nlink++; | 106 | inc_nlink(inode); |
107 | return 0; | 107 | return 0; |
108 | } | 108 | } |
109 | 109 | ||
@@ -137,7 +137,7 @@ static int create_dir(struct kobject * k, struct dentry * p, | |||
137 | if (!error) { | 137 | if (!error) { |
138 | error = sysfs_create(*d, mode, init_dir); | 138 | error = sysfs_create(*d, mode, init_dir); |
139 | if (!error) { | 139 | if (!error) { |
140 | p->d_inode->i_nlink++; | 140 | inc_nlink(p->d_inode); |
141 | (*d)->d_op = &sysfs_dentry_ops; | 141 | (*d)->d_op = &sysfs_dentry_ops; |
142 | d_rehash(*d); | 142 | d_rehash(*d); |
143 | } | 143 | } |
diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c index 40190c489271..20551a1b8a56 100644 --- a/fs/sysfs/mount.c +++ b/fs/sysfs/mount.c | |||
@@ -49,7 +49,7 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent) | |||
49 | inode->i_op = &sysfs_dir_inode_operations; | 49 | inode->i_op = &sysfs_dir_inode_operations; |
50 | inode->i_fop = &sysfs_dir_operations; | 50 | inode->i_fop = &sysfs_dir_operations; |
51 | /* directory inodes start off with i_nlink == 2 (for "." entry) */ | 51 | /* directory inodes start off with i_nlink == 2 (for "." entry) */ |
52 | inode->i_nlink++; | 52 | inc_nlink(inode); |
53 | } else { | 53 | } else { |
54 | pr_debug("sysfs: could not get root inode\n"); | 54 | pr_debug("sysfs: could not get root inode\n"); |
55 | return -ENOMEM; | 55 | return -ENOMEM; |