vfs: define struct filename and have getname() return it
authorJeff Layton <jlayton@redhat.com>
Wed, 10 Oct 2012 19:25:28 +0000 (15:25 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 13 Oct 2012 00:14:55 +0000 (20:14 -0400)
commit91a27b2a756784714e924e5e854b919273082d26
tree3913246b7d6e62703ec915f481e3a7159393f0f0
parent8e377d15078a501c4da98471f56396343c407d92
vfs: define struct filename and have getname() return it

getname() is intended to copy pathname strings from userspace into a
kernel buffer. The result is just a string in kernel space. It would
however be quite helpful to be able to attach some ancillary info to
the string.

For instance, we could attach some audit-related info to reduce the
amount of audit-related processing needed. When auditing is enabled,
we could also call getname() on the string more than once and not
need to recopy it from userspace.

This patchset converts the getname()/putname() interfaces to return
a struct instead of a string. For now, the struct just tracks the
string in kernel space and the original userland pointer for it.

Later, we'll add other information to the struct as it becomes
convenient.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
40 files changed:
arch/alpha/kernel/osf_sys.c
arch/arm64/kernel/sys.c
arch/arm64/kernel/sys_compat.c
arch/avr32/kernel/process.c
arch/blackfin/kernel/process.c
arch/cris/arch-v10/kernel/process.c
arch/cris/arch-v32/kernel/process.c
arch/h8300/kernel/process.c
arch/hexagon/kernel/syscall.c
arch/ia64/kernel/process.c
arch/m32r/kernel/process.c
arch/microblaze/kernel/sys_microblaze.c
arch/mips/kernel/linux32.c
arch/mips/kernel/syscall.c
arch/openrisc/kernel/process.c
arch/parisc/hpux/fs.c
arch/parisc/kernel/process.c
arch/parisc/kernel/sys_parisc32.c
arch/score/kernel/sys_score.c
arch/sh/kernel/process_32.c
arch/sh/kernel/process_64.c
arch/sparc/kernel/process_32.c
arch/sparc/kernel/process_64.c
arch/sparc/kernel/sys_sparc32.c
arch/tile/kernel/process.c
arch/unicore32/kernel/sys.c
arch/xtensa/kernel/process.c
fs/compat.c
fs/exec.c
fs/filesystems.c
fs/namei.c
fs/namespace.c
fs/open.c
fs/quota/quota.c
include/linux/audit.h
include/linux/fs.h
ipc/mqueue.c
kernel/acct.c
kernel/auditsc.c
mm/swapfile.c