diff options
author | ru <ru@FreeBSD.org> | 2011-05-04 13:27:45 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2011-05-04 13:27:45 +0000 |
commit | b0a86c9f257a1311ae8daa811c6c3b6e199f05e5 (patch) | |
tree | 4b861261899defb3fa31ca5958853bd86a0388d8 /sys/fs | |
parent | c5a0d73cf16c8dff00d2586d802bc17e15a00566 (diff) | |
download | FreeBSD-src-b0a86c9f257a1311ae8daa811c6c3b6e199f05e5.zip FreeBSD-src-b0a86c9f257a1311ae8daa811c6c3b6e199f05e5.tar.gz |
Implemented a mount option "nocto" that disables cache coherency
checking at open time. It may improve performance for read-only
NFS mounts. Use deliberately.
MFC after: 1 week
Reviewed by: rmacklem, jhb (earlier version)
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/nfsclient/nfs_clvfsops.c | 4 | ||||
-rw-r--r-- | sys/fs/nfsclient/nfs_clvnops.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 9280f41..8b4fc6a 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -716,7 +716,7 @@ static const char *nfs_opts[] = { "from", "nfs_args", "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "resvport", "readahead", "hostname", "timeout", "addr", "fh", "nfsv3", "sec", "principal", "nfsv4", "gssname", "allgssname", "dirpath", - "negnametimeo", + "negnametimeo", "nocto", NULL }; /* @@ -833,6 +833,8 @@ nfs_mount(struct mount *mp) } if (vfs_getopt(mp->mnt_optnew, "allgssname", NULL, NULL) == 0) args.flags |= NFSMNT_ALLGSSNAME; + if (vfs_getopt(mp->mnt_optnew, "nocto", NULL, NULL) == 0) + args.flags |= NFSMNT_NOCTO; if (vfs_getopt(mp->mnt_optnew, "readdirsize", (void **)&opt, NULL) == 0) { if (opt == NULL) { vfs_mount_error(mp, "illegal readdirsize"); diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index cc9563a..6dc709f 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1026,7 +1026,8 @@ nfs_lookup(struct vop_lookup_args *ap) */ newvp = *vpp; newnp = VTONFS(newvp); - if ((flags & (ISLASTCN | ISOPEN)) == (ISLASTCN | ISOPEN) && + if (!(nmp->nm_flag & NFSMNT_NOCTO) && + (flags & (ISLASTCN | ISOPEN)) == (ISLASTCN | ISOPEN) && !(newnp->n_flag & NMODIFIED)) { mtx_lock(&newnp->n_mtx); newnp->n_attrstamp = 0; |