diff options
author | Amir Goldstein <amir73il@gmail.com> | 2018-10-18 18:37:14 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-10-27 00:34:40 +0300 |
commit | 1e92e3072c1456abedf51c9dedd245d2ba0daa4f (patch) | |
tree | 4d6e3e2299a97e4015a8b84646ee25c3b2db0c9c /fs/overlayfs/overlayfs.h | |
parent | 0e32992f7faccd50d1b00032de83e87a35fed247 (diff) | |
download | linux-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.h | 10 |
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); |