linux/fs/notify
Al Viro 2cbc76ab06 dentry name snapshots
commit 49d31c2f38 upstream.

take_dentry_name_snapshot() takes a safe snapshot of dentry name;
if the name is a short one, it gets copied into caller-supplied
structure, otherwise an extra reference to external name is grabbed
(those are never modified).  In either case the pointer to stable
string is stored into the same structure.

dentry must be held by the caller of take_dentry_name_snapshot(),
but may be freely dropped afterwards - the snapshot will stay
until destroyed by release_dentry_name_snapshot().

Intended use:
	struct name_snapshot s;

	take_dentry_name_snapshot(&s, dentry);
	...
	access s.name
	...
	release_dentry_name_snapshot(&s);

Replaces fsnotify_oldname_...(), gets used in fsnotify to obtain the name
to pass down with event.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[carnil: backport 4.9: adjust context]
[bwh: Backported to 3.16:
 - External names are not ref-counted, so copy them
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2017-08-26 02:14:48 +01:00
..
dnotify inotify: Fix reporting of cookies for inotify events 2014-02-18 11:17:17 +01:00
fanotify fanotify: don't expose EOPENSTALE to userspace 2017-08-26 02:14:39 +01:00
inotify inotify: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:16 -07:00
fdinfo.c fs/notify: don't show f_handle if exportfs_encode_inode_fh failed 2014-10-05 13:41:07 -07:00
fdinfo.h fs, notify: add procfs fdinfo helper 2012-12-17 17:15:28 -08:00
fsnotify.c dentry name snapshots 2017-08-26 02:14:48 +01:00
fsnotify.h fsnotify: remove global fsnotify groups lists 2010-07-28 10:18:54 -04:00
group.c fsnotify: add a way to stop queueing events on group shutdown 2016-11-20 01:17:33 +00:00
inode_mark.c fsnotify: Fix possible use-after-free in inode iteration on umount 2017-03-16 02:26:35 +00:00
Kconfig fanotify: allow fanotify to be built 2010-10-28 17:22:13 -04:00
Makefile fs, notify: add procfs fdinfo helper 2012-12-17 17:15:28 -08:00
mark.c fsnotify: fix oops in fsnotify_clear_marks_by_group_flags() 2015-08-27 12:08:16 +01:00
notification.c fanotify: fix list corruption in fanotify_get_response() 2016-11-20 01:17:33 +00:00
vfsmount_mark.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00