diff options
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r-- | fs/sysfs/inode.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index e3f091a81c72..c81b22f3ace1 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -202,18 +202,6 @@ static inline void set_inode_attr(struct inode * inode, struct iattr * iattr) | |||
202 | inode->i_ctime = iattr->ia_ctime; | 202 | inode->i_ctime = iattr->ia_ctime; |
203 | } | 203 | } |
204 | 204 | ||
205 | static int sysfs_count_nlink(struct sysfs_dirent *sd) | ||
206 | { | ||
207 | struct sysfs_dirent *child; | ||
208 | int nr = 0; | ||
209 | |||
210 | for (child = sd->s_dir.children; child; child = child->s_sibling) | ||
211 | if (sysfs_type(child) == SYSFS_DIR) | ||
212 | nr++; | ||
213 | |||
214 | return nr + 2; | ||
215 | } | ||
216 | |||
217 | static void sysfs_refresh_inode(struct sysfs_dirent *sd, struct inode *inode) | 205 | static void sysfs_refresh_inode(struct sysfs_dirent *sd, struct inode *inode) |
218 | { | 206 | { |
219 | struct sysfs_inode_attrs *iattrs = sd->s_iattr; | 207 | struct sysfs_inode_attrs *iattrs = sd->s_iattr; |
@@ -230,7 +218,7 @@ static void sysfs_refresh_inode(struct sysfs_dirent *sd, struct inode *inode) | |||
230 | } | 218 | } |
231 | 219 | ||
232 | if (sysfs_type(sd) == SYSFS_DIR) | 220 | if (sysfs_type(sd) == SYSFS_DIR) |
233 | inode->i_nlink = sysfs_count_nlink(sd); | 221 | set_nlink(inode, sd->s_dir.subdirs + 2); |
234 | } | 222 | } |
235 | 223 | ||
236 | int sysfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | 224 | int sysfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) |
@@ -336,8 +324,6 @@ int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const void *ns, const cha | |||
336 | sysfs_addrm_start(&acxt, dir_sd); | 324 | sysfs_addrm_start(&acxt, dir_sd); |
337 | 325 | ||
338 | sd = sysfs_find_dirent(dir_sd, ns, name); | 326 | sd = sysfs_find_dirent(dir_sd, ns, name); |
339 | if (sd && (sd->s_ns != ns)) | ||
340 | sd = NULL; | ||
341 | if (sd) | 327 | if (sd) |
342 | sysfs_remove_one(&acxt, sd); | 328 | sysfs_remove_one(&acxt, sd); |
343 | 329 | ||