working with vn_fullpath

Hiten Pandya hmp at backplane.com
Sun Jun 27 13:20:20 PDT 2004


Andrew Sporner wrote:

Hi,

I am porting my VFS filesystem event stuff to dragonfly
and getting rid of some old workarounds.
I need to convert a vnode to it's pathname and I thought
logically that vn_fullpath() would be the right solution.
Unfortunately it fails with ENOENT.

Are there any specific rules to using this function?
	When I restructured it from textvp_fullpath to vn_fullpath(),
	I also added a manual page to how vn_fullpath is supposed to
	function.
	Also, look at sys/kern/imgact_resident.c for more information
	on how this function is used, the procfs and linprocfs code
	too, which resides in sys/vfs/procfs and
	sys/emulation/linux/i386
	Basically, the one rule to keep in mind is that the vn_fullpath
	can only construct a pathname if *all* its namecache components
	are available, otherwise it returns ENOENT, naturally meaning
	it can't find one of the components.
	Here is a link to the web manual page:

	    http://leaf.dragonflybsd.org/cgi/web-man?vn_fullpath+9

	Hope that answers your queries; otherwise, please do not
	hesitate to ask more questions if any! :-)
		-Hiten
		hmp at xxxxxxxxxxxxx




More information about the Kernel mailing list