diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-23 22:41:54 +0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-14 16:35:46 +0400 |
commit | 85d7d618c17a09cfd824c1ad4483c19e6f9637ff (patch) | |
tree | 40ec525ab50573094a1ab402877aac9e4e6053fa /fs/file_table.c | |
parent | c4107b3097465e25f7d6a9b0ac0518b07b24e774 (diff) | |
download | linux-85d7d618c17a09cfd824c1ad4483c19e6f9637ff.tar.gz linux-85d7d618c17a09cfd824c1ad4483c19e6f9637ff.tar.bz2 linux-85d7d618c17a09cfd824c1ad4483c19e6f9637ff.zip |
mark_files_ro(): don't bother with mntget/mntput
mnt_drop_write_file() is safe under any lock
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/file_table.c')
-rw-r--r-- | fs/file_table.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/fs/file_table.c b/fs/file_table.c index a305d9e2d1b2..9ace2781931e 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -483,10 +483,8 @@ void mark_files_ro(struct super_block *sb) { struct file *f; -retry: lg_global_lock(&files_lglock); do_file_list_for_each_entry(sb, f) { - struct vfsmount *mnt; if (!S_ISREG(f->f_path.dentry->d_inode->i_mode)) continue; if (!file_count(f)) @@ -499,12 +497,7 @@ retry: if (file_check_writeable(f) != 0) continue; file_release_write(f); - mnt = mntget(f->f_path.mnt); - /* This can sleep, so we can't hold the spinlock. */ - lg_global_unlock(&files_lglock); - mnt_drop_write(mnt); - mntput(mnt); - goto retry; + mnt_drop_write_file(f); } while_file_list_for_each_entry; lg_global_unlock(&files_lglock); } |