linux_dsm_epyc7002/include
Josef 'Jeff' Sipek 16f1820028 fs: introduce vfs_path_lookup
Stackable file systems, among others, frequently need to lookup paths or
path components starting from an arbitrary point in the namespace
(identified by a dentry and a vfsmount).  Currently, such file systems use
lookup_one_len, which is frowned upon [1] as it does not pass the lookup
intent along; not passing a lookup intent, for example, can trigger BUG_ON's
when stacking on top of NFSv4.

The first patch introduces a new lookup function to allow lookup starting
from an arbitrary point in the namespace.  This approach has been suggested
by Christoph Hellwig [2].

The second patch changes sunrpc to use vfs_path_lookup.

The third patch changes nfsctl.c to use vfs_path_lookup.

The fourth patch marks link_path_walk static.

The fifth, and last patch, unexports path_walk because it is no longer
unnecessary to call it directly, and using the new vfs_path_lookup is
cleaner.

For example, the following snippet of code, looks up "some/path/component"
in a directory pointed to by parent_{dentry,vfsmnt}:

err = vfs_path_lookup(parent_dentry, parent_vfsmnt,
		      "some/path/component", 0, &nd);
if (!err) {
	/* exits */

	...

	/* once done, release the references */
	path_release(&nd);
} else if (err == -ENOENT) {
	/* doesn't exist */
} else {
	/* other error */
}

VFS functions such as lookup_create can be used on the nameidata structure
to pass the create intent to the file system.

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Neil Brown <neilb@suse.de>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-19 10:04:45 -07:00
..
acpi Pull osi-now into release branch 2007-06-02 01:02:09 -04:00
asm-alpha arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-arm arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-arm26 arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-avr32 arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-blackfin fbdev: detect primary display device 2007-07-17 10:23:11 -07:00
asm-cris arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-frv arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-generic define new percpu interface for shared data 2007-07-19 10:04:44 -07:00
asm-h8300 arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-i386 arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-ia64 arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-m32r arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-m68k arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-m68knommu fbdev: detect primary display device 2007-07-17 10:23:11 -07:00
asm-mips arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-parisc arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-powerpc arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-ppc mm: remove ptep_test_and_clear_dirty and ptep_clear_flush_dirty 2007-07-17 10:22:59 -07:00
asm-s390 arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-sh arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-sh64 arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-sparc arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-sparc64 arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-um arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-v850 fbdev: detect primary display device 2007-07-17 10:23:11 -07:00
asm-x86_64 arch: personality independent stack top 2007-07-19 10:04:45 -07:00
asm-xtensa arch: personality independent stack top 2007-07-19 10:04:45 -07:00
crypto
keys
linux fs: introduce vfs_path_lookup 2007-07-19 10:04:45 -07:00
math-emu
media V4L/DVB (5835): saa7146/dvb-ttpci: Fix signedness warnings (gcc 4.1.1, kernel 2.6.22) 2007-07-18 14:24:44 -03:00
mtd UBI: kill homegrown endian macros 2007-07-18 16:53:49 +03:00
net [XFRM]: Fix crash introduced by struct dst_entry reordering 2007-07-18 01:55:52 -07:00
pcmcia PCMCIA-NETDEV : add new ID of lan&modem multifunction card 2007-07-08 22:16:39 -04:00
rdma IB/cm: Include HCA ACK delay in local ACK timeout 2007-07-10 21:50:05 -07:00
rxrpc
scsi [SCSI] Remove unused method scsi_device_cancel 2007-07-14 16:01:16 -05:00
sound [ALSA] version 1.0.14 2007-05-31 11:03:27 +02:00
video tgafb: actually allocate memory for the pseudo_palette 2007-07-17 10:23:12 -07:00
xen xen: Place vcpu_info structure into per-cpu memory 2007-07-18 08:47:45 -07:00
Kbuild