[06/15] reiserfs: open-code reiserfs_mutex_lock_safe() in reiserfs_unpack()
diff mbox

Message ID 1460768127-31822-6-git-send-email-viro@ZenIV.linux.org.uk
State New
Headers show

Commit Message

Al Viro April 16, 2016, 12:55 a.m. UTC
From: Al Viro <viro@zeniv.linux.org.uk>

... and have it use inode_lock()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/reiserfs/ioctl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch
diff mbox

diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c
index 036a1fc..f49afe7 100644
--- a/fs/reiserfs/ioctl.c
+++ b/fs/reiserfs/ioctl.c
@@ -187,7 +187,11 @@  int reiserfs_unpack(struct inode *inode, struct file *filp)
 	}
 
 	/* we need to make sure nobody is changing the file size beneath us */
-	reiserfs_mutex_lock_safe(&inode->i_mutex, inode->i_sb);
+{
+	int depth = reiserfs_write_unlock_nested(inode->i_sb);
+	inode_lock(inode);
+	reiserfs_write_lock_nested(inode->i_sb, depth);
+}
 
 	reiserfs_write_lock(inode->i_sb);