aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/inode.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2009-11-20 19:08:56 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 14:24:54 -0500
commit832b6af198aefe6034310e124594cc8b833c0ef9 (patch)
tree853eec8f7449dd7fc51c6d4c9b70ea44b81cf0d9 /fs/sysfs/inode.c
parenta16bbc3430ed94b543222f4c8ef68025f8493e93 (diff)
sysfs: Propagate renames to the vfs on demand
By teaching sysfs_revalidate to hide a dentry for a sysfs_dirent if the sysfs_dirent has been renamed, and by teaching sysfs_lookup to return the original dentry if the sysfs dirent has been renamed. I can show the results of renames correctly without having to update the dcache during the directory rename. This massively simplifies the rename logic allowing a lot of weird sysfs special cases to be removed along with a lot of now unnecesary helper code. Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r--fs/sysfs/inode.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 1ffd5559926f..9f783d4e4b51 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -205,17 +205,6 @@ static inline void set_inode_attr(struct inode * inode, struct iattr * iattr)
205 inode->i_ctime = iattr->ia_ctime; 205 inode->i_ctime = iattr->ia_ctime;
206} 206}
207 207
208
209/*
210 * sysfs has a different i_mutex lock order behavior for i_mutex than other
211 * filesystems; sysfs i_mutex is called in many places with subsystem locks
212 * held. At the same time, many of the VFS locking rules do not apply to
213 * sysfs at all (cross directory rename for example). To untangle this mess
214 * (which gives false positives in lockdep), we're giving sysfs inodes their
215 * own class for i_mutex.
216 */
217static struct lock_class_key sysfs_inode_imutex_key;
218
219static int sysfs_count_nlink(struct sysfs_dirent *sd) 208static int sysfs_count_nlink(struct sysfs_dirent *sd)
220{ 209{
221 struct sysfs_dirent *child; 210 struct sysfs_dirent *child;
@@ -268,7 +257,6 @@ static void sysfs_init_inode(struct sysfs_dirent *sd, struct inode *inode)
268 inode->i_mapping->a_ops = &sysfs_aops; 257 inode->i_mapping->a_ops = &sysfs_aops;
269 inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info; 258 inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info;
270 inode->i_op = &sysfs_inode_operations; 259 inode->i_op = &sysfs_inode_operations;
271 lockdep_set_class(&inode->i_mutex, &sysfs_inode_imutex_key);
272 260
273 set_default_inode_attr(inode, sd->s_mode); 261 set_default_inode_attr(inode, sd->s_mode);
274 sysfs_refresh_inode(sd, inode); 262 sysfs_refresh_inode(sd, inode);