Android O MR1 Preview 2 Release 0.3 (OPP6.171019.012,dragon)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCWiiXXgAKCRDorT+BmrEO
eOUKAJ4pNWPd5T4y42zHPktfuI2dB4gfHQCfUNBbljwwT55P9SMT/OD/KE+BcSY=
=P5ZP
-----END PGP SIGNATURE-----
UPSTREAM: dentry name snapshots

commit: 49d31c2f389acfe83417083e1208422b4091cd9e 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>

Bug: 63689921
Change-Id: I2909171089500f607152d6dba2607c5d1d1f64b8
6 files changed