The VOP_LOOKUP() implementations for CREATE op do not put the name
authorkib <kib@FreeBSD.org>
Thu, 18 Dec 2014 10:01:12 +0000 (10:01 +0000)
committerkib <kib@FreeBSD.org>
Thu, 18 Dec 2014 10:01:12 +0000 (10:01 +0000)
commit77c9d3f4e84458886633ec0fa2d06783735cd524
treed6d1c37be8bcdc191674e99f86893f2fda397461
parentbefcdd660f271babed582714f57d94b131da4af5
The VOP_LOOKUP() implementations for CREATE op do not put the name
into namecache, to avoid cache trashing when doing large operations.
E.g., tar archive extraction is not usually followed by access to many
of the files created.

Right now, each VOP_LOOKUP() implementation explicitely knowns about
this quirk and tests for both MAKEENTRY flag presence and op != CREATE
to make the call to cache_enter().  Centralize the handling of the
quirk into VFS, by deciding to cache only by MAKEENTRY flag in VOP.
VFS now sets NOCACHE flag for CREATE namei() calls.

Note that the change in semantic is backward-compatible and could be
merged to the stable branch, and is compatible with non-changed
third-party filesystems which correctly handle MAKEENTRY.

Suggested by: Chris Torek <torek@pi-coral.com>
Reviewed by: mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
17 files changed:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
sys/fs/ext2fs/ext2_lookup.c
sys/fs/fuse/fuse_vnops.c
sys/fs/msdosfs/msdosfs_lookup.c
sys/fs/nandfs/nandfs_vnops.c
sys/fs/nfsclient/nfs_clvnops.c
sys/fs/nfsserver/nfs_nfsdserv.c
sys/fs/tmpfs/tmpfs_vnops.c
sys/fs/unionfs/union_subr.c
sys/fs/unionfs/union_vnops.c
sys/kern/uipc_usrreq.c
sys/kern/vfs_syscalls.c
sys/kern/vfs_vnops.c
sys/nfsclient/nfs_vnops.c
sys/nfsserver/nfs_serv.c
sys/ufs/ffs/ffs_snapshot.c
sys/ufs/ufs/ufs_lookup.c