reiserfs: open-code reiserfs_mutex_lock_safe() in reiserfs_unpack()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 15 Apr 2016 18:44:31 +0000 (14:44 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 2 May 2016 23:47:23 +0000 (19:47 -0400)
... and have it use inode_lock()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/reiserfs/ioctl.c

index 57045f423893f5d813dd92c5b3c621a3e0efde08..2f1ddc9080132f9fe9a08c66f1cd999913ee67be 100644 (file)
@@ -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);