aboutsummaryrefslogtreecommitdiff
path: root/fs/notify/fanotify
diff options
context:
space:
mode:
authorAmir Goldstein2022-04-22 15:03:22 +0300
committerJan Kara2022-04-25 14:42:45 +0200
commitc3638b5b13740fa31762d414bbce8b7a694e582a (patch)
treeb09af564485d7f9dd3b960747076c69a19356d4b /fs/notify/fanotify
parentaabb45fdcb31f00f1e7cae2bce83e83474a87c03 (diff)
fsnotify: allow adding an inode mark without pinning inode
fsnotify_add_mark() and variants implicitly take a reference on inode when attaching a mark to an inode. Make that behavior opt-out with the mark flag FSNOTIFY_MARK_FLAG_NO_IREF. Instead of taking the inode reference when attaching connector to inode and dropping the inode reference when detaching connector from inode, take the inode reference on attach of the first mark that wants to hold an inode reference and drop the inode reference on detach of the last mark that wants to hold an inode reference. Backends can "upgrade" an existing mark to take an inode reference, but cannot "downgrade" a mark with inode reference to release the refernce. This leaves the choice to the backend whether or not to pin the inode when adding an inode mark. This is intended to be used when adding a mark with ignored mask that is used for optimization in cases where group can afford getting unneeded events and reinstate the mark with ignored mask when inode is accessed again after being evicted. Link: https://lore.kernel.org/r/20220422120327.3459282-12-amir73il@gmail.com Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/notify/fanotify')
0 files changed, 0 insertions, 0 deletions