android_kernel_google_msm/fs
Al Viro b7f0468bb9 BACKPORT: 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>
[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>
[ghackmann@google.com: backported to 3.10: adjust context]
Signed-off-by: Greg Hackmann <ghackmann@google.com>

Change-Id: I612e687cbffa1a03107331a6b3f00911ffbebd8e
Bug: 63689921
2018-01-13 17:13:38 +03:00
..
9p Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
adfs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
affs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
afs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
autofs4 Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
befs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
bfs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
btrfs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
cachefiles FS-Cache: Handle a write to the page immediately beyond the EOF marker 2016-10-26 23:15:25 +08:00
ceph Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
cifs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
coda fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
configfs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
cramfs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
crypto ext4/fscrypto: avoid RCU lookup in d_revalidate 2016-10-29 23:12:37 +08:00
debugfs BACKPORT: dentry name snapshots 2018-01-13 17:13:38 +03:00
devpts Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
dlm
ecryptfs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
efs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
exofs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
exportfs move d_rcu from overlapping d_child to overlapping d_alias 2017-09-22 19:11:55 +03:00
ext2 Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
ext3 Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
ext4 ext4: Add support for FIDTRIM, a best-effort ioctl for deep discard trim 2017-12-27 22:40:01 +03:00
f2fs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
fat Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
freevxfs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
fscache FS-Cache: Handle a write to the page immediately beyond the EOF marker 2016-10-26 23:15:25 +08:00
fuse Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
gfs2 Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
hfs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
hfsplus Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
hostfs fs: create and use seq_show_option for escaping 2016-04-27 18:55:18 +08:00
hpfs hpfs: update ctime and mtime on directory modification 2016-04-27 18:55:17 +08:00
hppfs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
hugetlbfs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
isofs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
jbd
jbd2 jbd2: Fix unreclaimed pages after truncate in data=journal mode 2016-10-26 23:15:34 +08:00
jffs2 Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
jfs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
lockd lockd: Try to reconnect if statd has moved 2015-02-02 17:04:42 +08:00
logfs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
minix fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
ncpfs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
nfs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
nfs_common
nfsd Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
nilfs2 Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
nls
notify BACKPORT: dentry name snapshots 2018-01-13 17:13:38 +03:00
ntfs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
ocfs2 Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
omfs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
openpromfs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
proc swap: make each swap partition have one address_space 2018-01-01 22:02:05 +03:00
pstore
qnx4 fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
qnx6 fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
quota
ramfs
reiserfs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
romfs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
sdcardfs sdcardfs: Backport and use some 3.10 hlist/hash macros 2017-10-06 10:28:58 +03:00
squashfs
sysfs
sysv Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
ubifs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
udf udf: Check path length when reading symlink 2017-07-10 01:48:57 +03:00
ufs fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
xfs Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
yaffs2
aio.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
anon_inodes.c
attr.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
bad_inode.c
binfmt_aout.c
binfmt_elf.c binfmt_elf: Don't clobber passed executable's file header 2016-10-26 23:15:28 +08:00
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
binfmt_script.c
binfmt_som.c
bio-integrity.c
bio.c
block_dev.c
buffer.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
char_dev.c
compat.c
compat_binfmt_elf.c
compat_ioctl.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
dcache.c BACKPORT: dentry name snapshots 2018-01-13 17:13:38 +03:00
dcookies.c
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
exec.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
fcntl.c
fhandle.c vfs: read file_handle only once in handle_to_path 2016-10-29 23:12:11 +08:00
fifo.c
file.c
file_table.c get rid of s_files and files_lock 2016-03-21 09:17:55 +08:00
filesystems.c fs: Limit sys_mount to only request filesystem modules. 2017-09-22 19:12:20 +03:00
fs-writeback.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
fs_struct.c sdcardfs: override umask on mkdir and create 2017-09-22 19:12:02 +03:00
generic_acl.c BACKPORT: posix_acl: Clear SGID bit when setting file permissions 2017-06-26 20:26:17 +03:00
inode.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
internal.h Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
ioctl.c
ioprio.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
Kconfig Included sdcardfs source code for kernel 3.0 2017-09-22 19:11:56 +03:00
Kconfig.binfmt
libfs.c move d_rcu from overlapping d_child to overlapping d_alias 2017-09-22 19:11:55 +03:00
locks.c locks: allow __break_lease to sleep even when break_time is 0 2014-05-13 14:11:31 +02:00
Makefile Included sdcardfs source code for kernel 3.0 2017-09-22 19:11:56 +03:00
mbcache.c
mount.h proc: Usable inode numbers for the namespace file descriptors. 2015-07-13 11:18:01 -07:00
mpage.c
namei.c BACKPORT: dentry name snapshots 2018-01-13 17:13:38 +03:00
namespace.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
no-block.c
open.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
pipe.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
pnode.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
pnode.h ANDROID: mnt: remount should propagate to slaves of slaves 2017-09-22 19:12:11 +03:00
posix_acl.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
proc_namespace.c vfs: Allow filesystems to access their private mount data 2017-09-22 19:12:06 +03:00
read_write.c
read_write.h
readdir.c kernel: Only expose su when daemon is running 2017-05-19 18:41:25 -06:00
select.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
seq_file.c fs/seq_file: Use vmalloc by default for allocations > PAGE_SIZE 2014-11-18 15:13:24 -08:00
signalfd.c
splice.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
stack.c
stat.c VFS: make vfs_fstat() use f[get|put]_light() 2014-06-07 16:02:04 -07:00
statfs.c
super.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
sync.c fs/sync.c: make sync_file_range(2) use WB_SYNC_NONE writeback 2017-12-31 13:02:49 +03:00
timerfd.c timerfd: support CLOCK_BOOTTIME clock 2017-08-27 19:07:23 +03:00
utimes.c vfs: Add setattr2 for filesystems with per mount permissions 2017-09-22 19:12:07 +03:00
xattr.c
xattr_acl.c