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/hfsplus | |
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/hfsplus')
-rw-r--r-- | fs/hfsplus/dir.c | 4 | ||||
-rw-r--r-- | fs/hfsplus/inode.c | 8 | ||||
-rw-r--r-- | fs/hfsplus/ioctl.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index d0f39dcbb58e..a4e867e08947 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c | |||
@@ -284,9 +284,9 @@ static int hfsplus_dir_release(struct inode *inode, struct file *file) | |||
284 | { | 284 | { |
285 | struct hfsplus_readdir_data *rd = file->private_data; | 285 | struct hfsplus_readdir_data *rd = file->private_data; |
286 | if (rd) { | 286 | if (rd) { |
287 | mutex_lock(&inode->i_mutex); | 287 | inode_lock(inode); |
288 | list_del(&rd->list); | 288 | list_del(&rd->list); |
289 | mutex_unlock(&inode->i_mutex); | 289 | inode_unlock(inode); |
290 | kfree(rd); | 290 | kfree(rd); |
291 | } | 291 | } |
292 | return 0; | 292 | return 0; |
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 19b33f8151f1..1a6394cdb54e 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -229,14 +229,14 @@ static int hfsplus_file_release(struct inode *inode, struct file *file) | |||
229 | if (HFSPLUS_IS_RSRC(inode)) | 229 | if (HFSPLUS_IS_RSRC(inode)) |
230 | inode = HFSPLUS_I(inode)->rsrc_inode; | 230 | inode = HFSPLUS_I(inode)->rsrc_inode; |
231 | if (atomic_dec_and_test(&HFSPLUS_I(inode)->opencnt)) { | 231 | if (atomic_dec_and_test(&HFSPLUS_I(inode)->opencnt)) { |
232 | mutex_lock(&inode->i_mutex); | 232 | inode_lock(inode); |
233 | hfsplus_file_truncate(inode); | 233 | hfsplus_file_truncate(inode); |
234 | if (inode->i_flags & S_DEAD) { | 234 | if (inode->i_flags & S_DEAD) { |
235 | hfsplus_delete_cat(inode->i_ino, | 235 | hfsplus_delete_cat(inode->i_ino, |
236 | HFSPLUS_SB(sb)->hidden_dir, NULL); | 236 | HFSPLUS_SB(sb)->hidden_dir, NULL); |
237 | hfsplus_delete_inode(inode); | 237 | hfsplus_delete_inode(inode); |
238 | } | 238 | } |
239 | mutex_unlock(&inode->i_mutex); | 239 | inode_unlock(inode); |
240 | } | 240 | } |
241 | return 0; | 241 | return 0; |
242 | } | 242 | } |
@@ -286,7 +286,7 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end, | |||
286 | error = filemap_write_and_wait_range(inode->i_mapping, start, end); | 286 | error = filemap_write_and_wait_range(inode->i_mapping, start, end); |
287 | if (error) | 287 | if (error) |
288 | return error; | 288 | return error; |
289 | mutex_lock(&inode->i_mutex); | 289 | inode_lock(inode); |
290 | 290 | ||
291 | /* | 291 | /* |
292 | * Sync inode metadata into the catalog and extent trees. | 292 | * Sync inode metadata into the catalog and extent trees. |
@@ -327,7 +327,7 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end, | |||
327 | if (!test_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags)) | 327 | if (!test_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags)) |
328 | blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); | 328 | blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); |
329 | 329 | ||
330 | mutex_unlock(&inode->i_mutex); | 330 | inode_unlock(inode); |
331 | 331 | ||
332 | return error; | 332 | return error; |
333 | } | 333 | } |
diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c index 0624ce4e0702..32a49e292b6a 100644 --- a/fs/hfsplus/ioctl.c +++ b/fs/hfsplus/ioctl.c | |||
@@ -93,7 +93,7 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags) | |||
93 | goto out_drop_write; | 93 | goto out_drop_write; |
94 | } | 94 | } |
95 | 95 | ||
96 | mutex_lock(&inode->i_mutex); | 96 | inode_lock(inode); |
97 | 97 | ||
98 | if ((flags & (FS_IMMUTABLE_FL|FS_APPEND_FL)) || | 98 | if ((flags & (FS_IMMUTABLE_FL|FS_APPEND_FL)) || |
99 | inode->i_flags & (S_IMMUTABLE|S_APPEND)) { | 99 | inode->i_flags & (S_IMMUTABLE|S_APPEND)) { |
@@ -126,7 +126,7 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags) | |||
126 | mark_inode_dirty(inode); | 126 | mark_inode_dirty(inode); |
127 | 127 | ||
128 | out_unlock_inode: | 128 | out_unlock_inode: |
129 | mutex_unlock(&inode->i_mutex); | 129 | inode_unlock(inode); |
130 | out_drop_write: | 130 | out_drop_write: |
131 | mnt_drop_write_file(file); | 131 | mnt_drop_write_file(file); |
132 | out: | 132 | out: |