diff options
Diffstat (limited to 'fs/sysfs/dir.c')
-rw-r--r-- | fs/sysfs/dir.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 7e54bac8c4b0..ea9120a830d8 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c | |||
@@ -231,7 +231,7 @@ void release_sysfs_dirent(struct sysfs_dirent * sd) | |||
231 | goto repeat; | 231 | goto repeat; |
232 | } | 232 | } |
233 | 233 | ||
234 | static int sysfs_dentry_delete(struct dentry *dentry) | 234 | static int sysfs_dentry_delete(const struct dentry *dentry) |
235 | { | 235 | { |
236 | struct sysfs_dirent *sd = dentry->d_fsdata; | 236 | struct sysfs_dirent *sd = dentry->d_fsdata; |
237 | return !!(sd->s_flags & SYSFS_FLAG_REMOVED); | 237 | return !!(sd->s_flags & SYSFS_FLAG_REMOVED); |
@@ -239,9 +239,13 @@ static int sysfs_dentry_delete(struct dentry *dentry) | |||
239 | 239 | ||
240 | static int sysfs_dentry_revalidate(struct dentry *dentry, struct nameidata *nd) | 240 | static int sysfs_dentry_revalidate(struct dentry *dentry, struct nameidata *nd) |
241 | { | 241 | { |
242 | struct sysfs_dirent *sd = dentry->d_fsdata; | 242 | struct sysfs_dirent *sd; |
243 | int is_dir; | 243 | int is_dir; |
244 | 244 | ||
245 | if (nd->flags & LOOKUP_RCU) | ||
246 | return -ECHILD; | ||
247 | |||
248 | sd = dentry->d_fsdata; | ||
245 | mutex_lock(&sysfs_mutex); | 249 | mutex_lock(&sysfs_mutex); |
246 | 250 | ||
247 | /* The sysfs dirent has been deleted */ | 251 | /* The sysfs dirent has been deleted */ |
@@ -701,7 +705,7 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry, | |||
701 | /* instantiate and hash dentry */ | 705 | /* instantiate and hash dentry */ |
702 | ret = d_find_alias(inode); | 706 | ret = d_find_alias(inode); |
703 | if (!ret) { | 707 | if (!ret) { |
704 | dentry->d_op = &sysfs_dentry_ops; | 708 | d_set_d_op(dentry, &sysfs_dentry_ops); |
705 | dentry->d_fsdata = sysfs_get(sd); | 709 | dentry->d_fsdata = sysfs_get(sd); |
706 | d_add(dentry, inode); | 710 | d_add(dentry, inode); |
707 | } else { | 711 | } else { |