Page MenuHomeFreeBSD

namei: Update documentation.
ClosedPublic

Authored by des on May 16 2025, 2:57 PM.
Tags
None
Referenced Files
F120077021: D50375.diff
Sat, Jun 14, 8:38 PM
Unknown Object (File)
Tue, Jun 3, 7:04 PM
Unknown Object (File)
Tue, Jun 3, 3:29 AM
Unknown Object (File)
Sun, Jun 1, 7:15 PM
Unknown Object (File)
Sat, May 31, 11:04 PM
Unknown Object (File)
Sat, May 31, 12:59 AM
Unknown Object (File)
Wed, May 28, 2:06 AM
Unknown Object (File)
Tue, May 27, 11:21 AM

Details

Summary

This should have been done 2+ years ago when the td argument was dropped
from NDINIT() and the NDFREE() macro and the SAVENAME and SAVESTART
flags were retired.

MFC after: 3 days
Fixes: 7e1d3eefd410 ("vfs: remove the unused thread argument from NDINIT*")
Fixes: 269c564b90d3 ("vfs: retire NDFREE")
Sponsored by: NetApp, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 64219
Build 61103: arc lint + arc unit

Event Timeline

des requested review of this revision.May 16 2025, 2:57 PM

Please use standard trailer format for Fixes (one commit per line) for the sake of existing and/or new tooling

Fixes: 7e1d3eefd410 ("vfs: remove the unused thread argument from NDINIT*")
Fixes: 269c564b90d3 ("vfs: retire NDFREE")
share/man/man9/namei.9
215

turns out we no longer have SAVENAME, so still needs a little more work

SAVENAME and SAVESTART are no more

des edited the summary of this revision. (Show Details)
markj added a subscriber: markj.
markj added inline comments.
share/man/man9/namei.9
74

There is also NDINIT_AT, NDINIT_ATRIGHTS, NDINIT_ATVP.

This revision is now accepted and ready to land.Fri, May 16, 8:38 PM
des edited the summary of this revision. (Show Details)

NDINIT_AT

This revision now requires review to proceed.Fri, May 16, 10:17 PM
des marked an inline comment as done.Fri, May 16, 10:17 PM
des added inline comments.
share/man/man9/namei.9
74

I'll add NDINIT_AT as it's pretty important these days. I have no idea what the others do, though, and I don't want to speculate.

markj added inline comments.
share/man/man9/namei.9
122

The NDINIT_ATRIGHTS macros is equivalent to NDINIT_AT, but additionally takes a set of Capsicum rights and verifies that the directory file descriptor carries those rights before proceeding the with the lookup, otherwise ENOTCAPABLE is returned.

NDINIT_ATVP takes a vnode instead of a file descriptor for the starting directory.

This revision is now accepted and ready to land.Sat, May 17, 12:03 AM
share/man/man9/namei.9
50

The flags are no longer u_long, it is uint64_t

136

I think the most useful bit from this manpage for most casual readers would be an example for the simple NDINIT with corresponding NDFREE_PNBUF() and error handling. Just such code

        struct nameidata nd;

	NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE,
	    uap->path);
	if ((error = namei(&nd)) != 0)
		return (error);
	NDFREE_PNBUF(&nd);

would be a huge step in describing the interface.

des marked 2 inline comments as done.Sat, May 17, 7:02 AM
des added inline comments.
share/man/man9/namei.9
122

Thank you, I'll add these later as I'm pressed for time.

136

The current text does not describe AUDITVNODE1 and again, I don't like to speculate. If you can describe the missing flags, I'll add them and your example in a subsequent commit.

share/man/man9/namei.9
136

I will handle this myself then.

This revision was automatically updated to reflect the committed changes.