diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-06-21 08:28:32 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2017-07-04 16:03:16 -0400 |
commit | ad0af7104dadccd55cd2b390271677fac142650f (patch) | |
tree | 1e377c42709b12efc4e01507143ebba09f389bc7 /include/linux/fs.h | |
parent | 04a01ac7ed3c5cd718713ef6341249a143c96b10 (diff) |
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>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 3e68cabb8457..75a5fafaf096 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1930,6 +1930,9 @@ static inline bool HAS_UNMAPPED_ID(struct inode *inode) | |||
1930 | * wb stat updates to grab mapping->tree_lock. See | 1930 | * wb stat updates to grab mapping->tree_lock. See |
1931 | * inode_switch_wb_work_fn() for details. | 1931 | * inode_switch_wb_work_fn() for details. |
1932 | * | 1932 | * |
1933 | * I_OVL_INUSE Used by overlayfs to get exclusive ownership on upper | ||
1934 | * and work dirs among overlayfs mounts. | ||
1935 | * | ||
1933 | * Q: What is the difference between I_WILL_FREE and I_FREEING? | 1936 | * Q: What is the difference between I_WILL_FREE and I_FREEING? |
1934 | */ | 1937 | */ |
1935 | #define I_DIRTY_SYNC (1 << 0) | 1938 | #define I_DIRTY_SYNC (1 << 0) |
@@ -1950,6 +1953,7 @@ static inline bool HAS_UNMAPPED_ID(struct inode *inode) | |||
1950 | #define __I_DIRTY_TIME_EXPIRED 12 | 1953 | #define __I_DIRTY_TIME_EXPIRED 12 |
1951 | #define I_DIRTY_TIME_EXPIRED (1 << __I_DIRTY_TIME_EXPIRED) | 1954 | #define I_DIRTY_TIME_EXPIRED (1 << __I_DIRTY_TIME_EXPIRED) |
1952 | #define I_WB_SWITCH (1 << 13) | 1955 | #define I_WB_SWITCH (1 << 13) |
1956 | #define I_OVL_INUSE (1 << 14) | ||
1953 | 1957 | ||
1954 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) | 1958 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) |
1955 | #define I_DIRTY_ALL (I_DIRTY | I_DIRTY_TIME) | 1959 | #define I_DIRTY_ALL (I_DIRTY | I_DIRTY_TIME) |