aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/file.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-01-22 15:40:57 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2016-01-22 18:04:28 -0500
commit5955102c9984fa081b2d570cfac75c97eecf8f3b (patch)
treea4744386eac4b916e847eb4eedfada158f6527b4 /fs/ocfs2/file.c
parent57b8f112cfe6622ddddb8c2641206bb5fa8a112d (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/ocfs2/file.c')
-rw-r--r--fs/ocfs2/file.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index d63127932509..7cb38fdca229 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1872,7 +1872,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
1872 if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) 1872 if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb))
1873 return -EROFS; 1873 return -EROFS;
1874 1874
1875 mutex_lock(&inode->i_mutex); 1875 inode_lock(inode);
1876 1876
1877 /* 1877 /*
1878 * This prevents concurrent writes on other nodes 1878 * This prevents concurrent writes on other nodes
@@ -1991,7 +1991,7 @@ out_rw_unlock:
1991 ocfs2_rw_unlock(inode, 1); 1991 ocfs2_rw_unlock(inode, 1);
1992 1992
1993out: 1993out:
1994 mutex_unlock(&inode->i_mutex); 1994 inode_unlock(inode);
1995 return ret; 1995 return ret;
1996} 1996}
1997 1997
@@ -2299,7 +2299,7 @@ static ssize_t ocfs2_file_write_iter(struct kiocb *iocb,
2299 appending = iocb->ki_flags & IOCB_APPEND ? 1 : 0; 2299 appending = iocb->ki_flags & IOCB_APPEND ? 1 : 0;
2300 direct_io = iocb->ki_flags & IOCB_DIRECT ? 1 : 0; 2300 direct_io = iocb->ki_flags & IOCB_DIRECT ? 1 : 0;
2301 2301
2302 mutex_lock(&inode->i_mutex); 2302 inode_lock(inode);
2303 2303
2304relock: 2304relock:
2305 /* 2305 /*
@@ -2435,7 +2435,7 @@ out:
2435 ocfs2_rw_unlock(inode, rw_level); 2435 ocfs2_rw_unlock(inode, rw_level);
2436 2436
2437out_mutex: 2437out_mutex:
2438 mutex_unlock(&inode->i_mutex); 2438 inode_unlock(inode);
2439 2439
2440 if (written) 2440 if (written)
2441 ret = written; 2441 ret = written;
@@ -2547,7 +2547,7 @@ static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int whence)
2547 struct inode *inode = file->f_mapping->host; 2547 struct inode *inode = file->f_mapping->host;
2548 int ret = 0; 2548 int ret = 0;
2549 2549
2550 mutex_lock(&inode->i_mutex); 2550 inode_lock(inode);
2551 2551
2552 switch (whence) { 2552 switch (whence) {
2553 case SEEK_SET: 2553 case SEEK_SET:
@@ -2585,7 +2585,7 @@ static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int whence)
2585 offset = vfs_setpos(file, offset, inode->i_sb->s_maxbytes); 2585 offset = vfs_setpos(file, offset, inode->i_sb->s_maxbytes);
2586 2586
2587out: 2587out:
2588 mutex_unlock(&inode->i_mutex); 2588 inode_unlock(inode);
2589 if (ret) 2589 if (ret)
2590 return ret; 2590 return ret;
2591 return offset; 2591 return offset;