1
0
Fork 0
remarkable-linux/fs/debugfs
Al Viro ad25f11ed2 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-06 18:59:43 -07:00
..
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
file.c debugfs: propagate release() call result 2016-09-27 12:45:57 +02:00
inode.c dentry name snapshots 2017-08-06 18:59:43 -07:00
internal.h debugfs: remove extra debugfs_create_file_unsafe() declaration 2016-08-31 15:08:10 +02:00