author: Miklos Szeredi <mszeredi@redhat.com> 2018-07-26 16:13:11 +0200
committer: Miklos Szeredi <mszeredi@redhat.com> 2018-07-26 16:13:11 +0200
commit: 63576c13bd17848376c8ba4a98f5d5151140c4ac
parent: e8f3bd773d22f488724dffb886a1618da85c2966
Commit Summary:
Diffstat:
1 file changed, 8 insertions, 4 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 0115c2f0a428..2dbd487390a3 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -357,15 +357,21 @@ int fuse_reverse_inval_inode(struct super_block *sb, u64 nodeid,
return 0;
}
-void fuse_lock_inode(struct inode *inode)
+bool fuse_lock_inode(struct inode *inode)
{
- if (!get_fuse_conn(inode)->parallel_dirops)
+ bool locked = false;
+
+ if (!get_fuse_conn(inode)->parallel_dirops) {
mutex_lock(&get_fuse_inode(inode)->mutex);
+ locked = true;
+ }
+
+ return locked;
}
-void fuse_unlock_inode(struct inode *inode)
+void fuse_unlock_inode(struct inode *inode, bool locked)
{
- if (!get_fuse_conn(inode)->parallel_dirops)
+ if (locked)
mutex_unlock(&get_fuse_inode(inode)->mutex);
}