summaryrefslogtreecommitdiff
path: root/fs/overlayfs/overlayfs.h
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2018-10-18 18:37:14 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2018-10-27 00:34:40 +0300
commit1e92e3072c1456abedf51c9dedd245d2ba0daa4f (patch)
tree4d6e3e2299a97e4015a8b84646ee25c3b2db0c9c /fs/overlayfs/overlayfs.h
parent0e32992f7faccd50d1b00032de83e87a35fed247 (diff)
downloadlinux-1e92e3072c1456abedf51c9dedd245d2ba0daa4f.tar.xz
ovl: abstract ovl_inode lock with a helper
The abstraction improves code readabilty (to some). Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/overlayfs.h')
-rw-r--r--fs/overlayfs/overlayfs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
index b48ef22ef96b..5e45cb3630a0 100644
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -290,6 +290,16 @@ static inline unsigned int ovl_xino_bits(struct super_block *sb)
return ofs->xino_bits;
}
+static inline int ovl_inode_lock(struct inode *inode)
+{
+ return mutex_lock_interruptible(&OVL_I(inode)->lock);
+}
+
+static inline void ovl_inode_unlock(struct inode *inode)
+{
+ mutex_unlock(&OVL_I(inode)->lock);
+}
+
/* namei.c */
int ovl_check_fh_len(struct ovl_fh *fh, int fh_len);