vfs: introduce inode 'inuse' lock
authorAmir Goldstein <amir73il@gmail.com>
Wed, 21 Jun 2017 12:28:32 +0000 (15:28 +0300)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 4 Jul 2017 20:03:16 +0000 (22:03 +0200)
commitad0af7104dadccd55cd2b390271677fac142650f
tree1e377c42709b12efc4e01507143ebba09f389bc7
parent04a01ac7ed3c5cd718713ef6341249a143c96b10
vfs: introduce inode 'inuse' lock

Added an i_state flag I_INUSE and helpers to set/clear/test the bit.

The 'inuse' lock is an 'advisory' inode lock, that can be used to extend
exclusive create protection beyond parent->i_mutex lock among cooperating
users.

This is going to be used by overlayfs to get exclusive ownership on upper
and work dirs among overlayfs mounts.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/overlayfs.h
fs/overlayfs/util.c
include/linux/fs.h