orangefs: don't open-code inode_lock/inode_unlock
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 12 Apr 2016 04:43:20 +0000 (00:43 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 2 May 2016 23:47:23 +0000 (19:47 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/orangefs/file.c
fs/orangefs/orangefs-kernel.h

index ae92795ed9658d476a6ab229582086986fc2ad27..491e82c6f705fc8d915a7f942b7f04a2bdcc16f6 100644 (file)
@@ -445,7 +445,7 @@ static ssize_t orangefs_file_write_iter(struct kiocb *iocb, struct iov_iter *ite
 
        gossip_debug(GOSSIP_FILE_DEBUG, "orangefs_file_write_iter\n");
 
-       mutex_lock(&file->f_mapping->host->i_mutex);
+       inode_lock(file->f_mapping->host);
 
        /* Make sure generic_write_checks sees an up to date inode size. */
        if (file->f_flags & O_APPEND) {
@@ -492,7 +492,7 @@ static ssize_t orangefs_file_write_iter(struct kiocb *iocb, struct iov_iter *ite
 
 out:
 
-       mutex_unlock(&file->f_mapping->host->i_mutex);
+       inode_unlock(file->f_mapping->host);
        return rc;
 }
 
index a9925e296ceb4c5f9b20fd47d37becd13941c90a..2281882f718eed1cd1e1cf50ec7aaf7b23ab3794 100644 (file)
@@ -612,11 +612,11 @@ do {                                                                      \
 static inline void orangefs_i_size_write(struct inode *inode, loff_t i_size)
 {
 #if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
-       mutex_lock(&inode->i_mutex);
+       inode_lock(inode);
 #endif
        i_size_write(inode, i_size);
 #if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
-       mutex_unlock(&inode->i_mutex);
+       inode_unlock(inode);
 #endif
 }