diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-01-22 15:40:57 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-01-22 18:04:28 -0500 |
commit | 5955102c9984fa081b2d570cfac75c97eecf8f3b (patch) | |
tree | a4744386eac4b916e847eb4eedfada158f6527b4 /fs/proc | |
parent | 57b8f112cfe6622ddddb8c2641206bb5fa8a112d (diff) |
wrappers for ->i_mutex access
parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
inode_foo(inode) being mutex_foo(&inode->i_mutex).
Please, use those for access to ->i_mutex; over the coming cycle
->i_mutex will become rwsem, with ->lookup() done with it held
only shared.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/kcore.c | 4 | ||||
-rw-r--r-- | fs/proc/self.c | 4 | ||||
-rw-r--r-- | fs/proc/thread_self.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 92e6726f6e37..a939f5ed7f89 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c | |||
@@ -552,9 +552,9 @@ static int open_kcore(struct inode *inode, struct file *filp) | |||
552 | if (kcore_need_update) | 552 | if (kcore_need_update) |
553 | kcore_update_ram(); | 553 | kcore_update_ram(); |
554 | if (i_size_read(inode) != proc_root_kcore->size) { | 554 | if (i_size_read(inode) != proc_root_kcore->size) { |
555 | mutex_lock(&inode->i_mutex); | 555 | inode_lock(inode); |
556 | i_size_write(inode, proc_root_kcore->size); | 556 | i_size_write(inode, proc_root_kcore->size); |
557 | mutex_unlock(&inode->i_mutex); | 557 | inode_unlock(inode); |
558 | } | 558 | } |
559 | return 0; | 559 | return 0; |
560 | } | 560 | } |
diff --git a/fs/proc/self.c b/fs/proc/self.c index 67e8db442cf0..b6a8d3529fea 100644 --- a/fs/proc/self.c +++ b/fs/proc/self.c | |||
@@ -50,7 +50,7 @@ int proc_setup_self(struct super_block *s) | |||
50 | struct pid_namespace *ns = s->s_fs_info; | 50 | struct pid_namespace *ns = s->s_fs_info; |
51 | struct dentry *self; | 51 | struct dentry *self; |
52 | 52 | ||
53 | mutex_lock(&root_inode->i_mutex); | 53 | inode_lock(root_inode); |
54 | self = d_alloc_name(s->s_root, "self"); | 54 | self = d_alloc_name(s->s_root, "self"); |
55 | if (self) { | 55 | if (self) { |
56 | struct inode *inode = new_inode_pseudo(s); | 56 | struct inode *inode = new_inode_pseudo(s); |
@@ -69,7 +69,7 @@ int proc_setup_self(struct super_block *s) | |||
69 | } else { | 69 | } else { |
70 | self = ERR_PTR(-ENOMEM); | 70 | self = ERR_PTR(-ENOMEM); |
71 | } | 71 | } |
72 | mutex_unlock(&root_inode->i_mutex); | 72 | inode_unlock(root_inode); |
73 | if (IS_ERR(self)) { | 73 | if (IS_ERR(self)) { |
74 | pr_err("proc_fill_super: can't allocate /proc/self\n"); | 74 | pr_err("proc_fill_super: can't allocate /proc/self\n"); |
75 | return PTR_ERR(self); | 75 | return PTR_ERR(self); |
diff --git a/fs/proc/thread_self.c b/fs/proc/thread_self.c index 9eacd59e0360..e58a31e8fb2a 100644 --- a/fs/proc/thread_self.c +++ b/fs/proc/thread_self.c | |||
@@ -52,7 +52,7 @@ int proc_setup_thread_self(struct super_block *s) | |||
52 | struct pid_namespace *ns = s->s_fs_info; | 52 | struct pid_namespace *ns = s->s_fs_info; |
53 | struct dentry *thread_self; | 53 | struct dentry *thread_self; |
54 | 54 | ||
55 | mutex_lock(&root_inode->i_mutex); | 55 | inode_lock(root_inode); |
56 | thread_self = d_alloc_name(s->s_root, "thread-self"); | 56 | thread_self = d_alloc_name(s->s_root, "thread-self"); |
57 | if (thread_self) { | 57 | if (thread_self) { |
58 | struct inode *inode = new_inode_pseudo(s); | 58 | struct inode *inode = new_inode_pseudo(s); |
@@ -71,7 +71,7 @@ int proc_setup_thread_self(struct super_block *s) | |||
71 | } else { | 71 | } else { |
72 | thread_self = ERR_PTR(-ENOMEM); | 72 | thread_self = ERR_PTR(-ENOMEM); |
73 | } | 73 | } |
74 | mutex_unlock(&root_inode->i_mutex); | 74 | inode_unlock(root_inode); |
75 | if (IS_ERR(thread_self)) { | 75 | if (IS_ERR(thread_self)) { |
76 | pr_err("proc_fill_super: can't allocate /proc/thread_self\n"); | 76 | pr_err("proc_fill_super: can't allocate /proc/thread_self\n"); |
77 | return PTR_ERR(thread_self); | 77 | return PTR_ERR(thread_self); |