diff options
author | kib <kib@FreeBSD.org> | 2014-12-18 10:01:12 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2014-12-18 10:01:12 +0000 |
commit | 77c9d3f4e84458886633ec0fa2d06783735cd524 (patch) | |
tree | d6d1c37be8bcdc191674e99f86893f2fda397461 /sys/fs/nandfs/nandfs_vnops.c | |
parent | befcdd660f271babed582714f57d94b131da4af5 (diff) | |
download | FreeBSD-src-77c9d3f4e84458886633ec0fa2d06783735cd524.zip FreeBSD-src-77c9d3f4e84458886633ec0fa2d06783735cd524.tar.gz |
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
Diffstat (limited to 'sys/fs/nandfs/nandfs_vnops.c')
-rw-r--r-- | sys/fs/nandfs/nandfs_vnops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/nandfs/nandfs_vnops.c b/sys/fs/nandfs/nandfs_vnops.c index 2c92f8b..65dcf64 100644 --- a/sys/fs/nandfs/nandfs_vnops.c +++ b/sys/fs/nandfs/nandfs_vnops.c @@ -478,7 +478,7 @@ out: * the file might not be found and thus putting it into the namecache * might be seen as negative caching. */ - if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) + if ((cnp->cn_flags & MAKEENTRY) != 0) cache_enter(dvp, *vpp, cnp); return (error); |