Page MenuHomeFreeBSD

namei: Update documentation.
AcceptedPublic

Authored by des on Fri, May 16, 2:57 PM.
Tags
None
Referenced Files
F117508132: D50375.id155563.diff
Mon, May 19, 8:52 AM
F117506884: D50375.id155576.diff
Mon, May 19, 8:26 AM
Unknown Object (File)
Sat, May 17, 7:44 AM

Details

Reviewers
mjg
kib
markj
Group Reviewers
Klara
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 64237
Build 61121: arc lint + arc unit

Event Timeline

des requested review of this revision.Fri, May 16, 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
236–237

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
80

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
80

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
129

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
51

The flags are no longer u_long, it is uint64_t

143

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
129

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

143

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
143

I will handle this myself then.