nfs_clnode.c revision 1.1.1.1.4.2 1 1.1.1.1.4.2 rmind /* $NetBSD: nfs_clnode.c,v 1.1.1.1.4.2 2014/05/18 17:46:05 rmind Exp $ */
2 1.1.1.1.4.2 rmind /*-
3 1.1.1.1.4.2 rmind * Copyright (c) 1989, 1993
4 1.1.1.1.4.2 rmind * The Regents of the University of California. All rights reserved.
5 1.1.1.1.4.2 rmind *
6 1.1.1.1.4.2 rmind * This code is derived from software contributed to Berkeley by
7 1.1.1.1.4.2 rmind * Rick Macklem at The University of Guelph.
8 1.1.1.1.4.2 rmind *
9 1.1.1.1.4.2 rmind * Redistribution and use in source and binary forms, with or without
10 1.1.1.1.4.2 rmind * modification, are permitted provided that the following conditions
11 1.1.1.1.4.2 rmind * are met:
12 1.1.1.1.4.2 rmind * 1. Redistributions of source code must retain the above copyright
13 1.1.1.1.4.2 rmind * notice, this list of conditions and the following disclaimer.
14 1.1.1.1.4.2 rmind * 2. Redistributions in binary form must reproduce the above copyright
15 1.1.1.1.4.2 rmind * notice, this list of conditions and the following disclaimer in the
16 1.1.1.1.4.2 rmind * documentation and/or other materials provided with the distribution.
17 1.1.1.1.4.2 rmind * 4. Neither the name of the University nor the names of its contributors
18 1.1.1.1.4.2 rmind * may be used to endorse or promote products derived from this software
19 1.1.1.1.4.2 rmind * without specific prior written permission.
20 1.1.1.1.4.2 rmind *
21 1.1.1.1.4.2 rmind * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 1.1.1.1.4.2 rmind * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 1.1.1.1.4.2 rmind * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 1.1.1.1.4.2 rmind * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 1.1.1.1.4.2 rmind * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 1.1.1.1.4.2 rmind * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 1.1.1.1.4.2 rmind * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 1.1.1.1.4.2 rmind * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 1.1.1.1.4.2 rmind * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 1.1.1.1.4.2 rmind * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 1.1.1.1.4.2 rmind * SUCH DAMAGE.
32 1.1.1.1.4.2 rmind *
33 1.1.1.1.4.2 rmind * from nfs_node.c 8.6 (Berkeley) 5/22/95
34 1.1.1.1.4.2 rmind */
35 1.1.1.1.4.2 rmind
36 1.1.1.1.4.2 rmind #include <sys/cdefs.h>
37 1.1.1.1.4.2 rmind /* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clnode.c 248084 2013-03-09 02:32:23Z attilio "); */
38 1.1.1.1.4.2 rmind __RCSID("$NetBSD: nfs_clnode.c,v 1.1.1.1.4.2 2014/05/18 17:46:05 rmind Exp $");
39 1.1.1.1.4.2 rmind
40 1.1.1.1.4.2 rmind #include "opt_kdtrace.h"
41 1.1.1.1.4.2 rmind
42 1.1.1.1.4.2 rmind #include <sys/param.h>
43 1.1.1.1.4.2 rmind #include <sys/systm.h>
44 1.1.1.1.4.2 rmind #include <sys/fcntl.h>
45 1.1.1.1.4.2 rmind #include <sys/lock.h>
46 1.1.1.1.4.2 rmind #include <sys/malloc.h>
47 1.1.1.1.4.2 rmind #include <sys/mount.h>
48 1.1.1.1.4.2 rmind #include <sys/namei.h>
49 1.1.1.1.4.2 rmind #include <sys/proc.h>
50 1.1.1.1.4.2 rmind #include <sys/socket.h>
51 1.1.1.1.4.2 rmind #include <sys/sysctl.h>
52 1.1.1.1.4.2 rmind #include <sys/taskqueue.h>
53 1.1.1.1.4.2 rmind #include <sys/vnode.h>
54 1.1.1.1.4.2 rmind
55 1.1.1.1.4.2 rmind #include <vm/uma.h>
56 1.1.1.1.4.2 rmind
57 1.1.1.1.4.2 rmind #include <fs/nfs/nfsport.h>
58 1.1.1.1.4.2 rmind #include <fs/nfsclient/nfsnode.h>
59 1.1.1.1.4.2 rmind #include <fs/nfsclient/nfsmount.h>
60 1.1.1.1.4.2 rmind #include <fs/nfsclient/nfs.h>
61 1.1.1.1.4.2 rmind #include <fs/nfsclient/nfs_kdtrace.h>
62 1.1.1.1.4.2 rmind
63 1.1.1.1.4.2 rmind #include <nfs/nfs_lock.h>
64 1.1.1.1.4.2 rmind
65 1.1.1.1.4.2 rmind extern struct vop_vector newnfs_vnodeops;
66 1.1.1.1.4.2 rmind extern struct buf_ops buf_ops_newnfs;
67 1.1.1.1.4.2 rmind MALLOC_DECLARE(M_NEWNFSREQ);
68 1.1.1.1.4.2 rmind
69 1.1.1.1.4.2 rmind uma_zone_t newnfsnode_zone;
70 1.1.1.1.4.2 rmind
71 1.1.1.1.4.2 rmind static void nfs_freesillyrename(void *arg, __unused int pending);
72 1.1.1.1.4.2 rmind
73 1.1.1.1.4.2 rmind void
74 1.1.1.1.4.2 rmind ncl_nhinit(void)
75 1.1.1.1.4.2 rmind {
76 1.1.1.1.4.2 rmind
77 1.1.1.1.4.2 rmind newnfsnode_zone = uma_zcreate("NCLNODE", sizeof(struct nfsnode), NULL,
78 1.1.1.1.4.2 rmind NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
79 1.1.1.1.4.2 rmind }
80 1.1.1.1.4.2 rmind
81 1.1.1.1.4.2 rmind void
82 1.1.1.1.4.2 rmind ncl_nhuninit(void)
83 1.1.1.1.4.2 rmind {
84 1.1.1.1.4.2 rmind uma_zdestroy(newnfsnode_zone);
85 1.1.1.1.4.2 rmind }
86 1.1.1.1.4.2 rmind
87 1.1.1.1.4.2 rmind /*
88 1.1.1.1.4.2 rmind * ONLY USED FOR THE ROOT DIRECTORY. nfscl_nget() does the rest. If this
89 1.1.1.1.4.2 rmind * function is going to be used to get Regular Files, code must be added
90 1.1.1.1.4.2 rmind * to fill in the "struct nfsv4node".
91 1.1.1.1.4.2 rmind * Look up a vnode/nfsnode by file handle.
92 1.1.1.1.4.2 rmind * Callers must check for mount points!!
93 1.1.1.1.4.2 rmind * In all cases, a pointer to a
94 1.1.1.1.4.2 rmind * nfsnode structure is returned.
95 1.1.1.1.4.2 rmind */
96 1.1.1.1.4.2 rmind int
97 1.1.1.1.4.2 rmind ncl_nget(struct mount *mntp, u_int8_t *fhp, int fhsize, struct nfsnode **npp,
98 1.1.1.1.4.2 rmind int lkflags)
99 1.1.1.1.4.2 rmind {
100 1.1.1.1.4.2 rmind struct thread *td = curthread; /* XXX */
101 1.1.1.1.4.2 rmind struct nfsnode *np;
102 1.1.1.1.4.2 rmind struct vnode *vp;
103 1.1.1.1.4.2 rmind struct vnode *nvp;
104 1.1.1.1.4.2 rmind int error;
105 1.1.1.1.4.2 rmind u_int hash;
106 1.1.1.1.4.2 rmind struct nfsmount *nmp;
107 1.1.1.1.4.2 rmind struct nfsfh *nfhp;
108 1.1.1.1.4.2 rmind
109 1.1.1.1.4.2 rmind nmp = VFSTONFS(mntp);
110 1.1.1.1.4.2 rmind *npp = NULL;
111 1.1.1.1.4.2 rmind
112 1.1.1.1.4.2 rmind hash = fnv_32_buf(fhp, fhsize, FNV1_32_INIT);
113 1.1.1.1.4.2 rmind
114 1.1.1.1.4.2 rmind MALLOC(nfhp, struct nfsfh *, sizeof (struct nfsfh) + fhsize,
115 1.1.1.1.4.2 rmind M_NFSFH, M_WAITOK);
116 1.1.1.1.4.2 rmind bcopy(fhp, &nfhp->nfh_fh[0], fhsize);
117 1.1.1.1.4.2 rmind nfhp->nfh_len = fhsize;
118 1.1.1.1.4.2 rmind error = vfs_hash_get(mntp, hash, lkflags,
119 1.1.1.1.4.2 rmind td, &nvp, newnfs_vncmpf, nfhp);
120 1.1.1.1.4.2 rmind FREE(nfhp, M_NFSFH);
121 1.1.1.1.4.2 rmind if (error)
122 1.1.1.1.4.2 rmind return (error);
123 1.1.1.1.4.2 rmind if (nvp != NULL) {
124 1.1.1.1.4.2 rmind *npp = VTONFS(nvp);
125 1.1.1.1.4.2 rmind return (0);
126 1.1.1.1.4.2 rmind }
127 1.1.1.1.4.2 rmind np = uma_zalloc(newnfsnode_zone, M_WAITOK | M_ZERO);
128 1.1.1.1.4.2 rmind
129 1.1.1.1.4.2 rmind error = getnewvnode("newnfs", mntp, &newnfs_vnodeops, &nvp);
130 1.1.1.1.4.2 rmind if (error) {
131 1.1.1.1.4.2 rmind uma_zfree(newnfsnode_zone, np);
132 1.1.1.1.4.2 rmind return (error);
133 1.1.1.1.4.2 rmind }
134 1.1.1.1.4.2 rmind vp = nvp;
135 1.1.1.1.4.2 rmind KASSERT(vp->v_bufobj.bo_bsize != 0, ("ncl_nget: bo_bsize == 0"));
136 1.1.1.1.4.2 rmind vp->v_bufobj.bo_ops = &buf_ops_newnfs;
137 1.1.1.1.4.2 rmind vp->v_data = np;
138 1.1.1.1.4.2 rmind np->n_vnode = vp;
139 1.1.1.1.4.2 rmind /*
140 1.1.1.1.4.2 rmind * Initialize the mutex even if the vnode is going to be a loser.
141 1.1.1.1.4.2 rmind * This simplifies the logic in reclaim, which can then unconditionally
142 1.1.1.1.4.2 rmind * destroy the mutex (in the case of the loser, or if hash_insert
143 1.1.1.1.4.2 rmind * happened to return an error no special casing is needed).
144 1.1.1.1.4.2 rmind */
145 1.1.1.1.4.2 rmind mtx_init(&np->n_mtx, "NEWNFSnode lock", NULL, MTX_DEF | MTX_DUPOK);
146 1.1.1.1.4.2 rmind /*
147 1.1.1.1.4.2 rmind * NFS supports recursive and shared locking.
148 1.1.1.1.4.2 rmind */
149 1.1.1.1.4.2 rmind lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL);
150 1.1.1.1.4.2 rmind VN_LOCK_AREC(vp);
151 1.1.1.1.4.2 rmind VN_LOCK_ASHARE(vp);
152 1.1.1.1.4.2 rmind /*
153 1.1.1.1.4.2 rmind * Are we getting the root? If so, make sure the vnode flags
154 1.1.1.1.4.2 rmind * are correct
155 1.1.1.1.4.2 rmind */
156 1.1.1.1.4.2 rmind if ((fhsize == nmp->nm_fhsize) &&
157 1.1.1.1.4.2 rmind !bcmp(fhp, nmp->nm_fh, fhsize)) {
158 1.1.1.1.4.2 rmind if (vp->v_type == VNON)
159 1.1.1.1.4.2 rmind vp->v_type = VDIR;
160 1.1.1.1.4.2 rmind vp->v_vflag |= VV_ROOT;
161 1.1.1.1.4.2 rmind }
162 1.1.1.1.4.2 rmind
163 1.1.1.1.4.2 rmind MALLOC(np->n_fhp, struct nfsfh *, sizeof (struct nfsfh) + fhsize,
164 1.1.1.1.4.2 rmind M_NFSFH, M_WAITOK);
165 1.1.1.1.4.2 rmind bcopy(fhp, np->n_fhp->nfh_fh, fhsize);
166 1.1.1.1.4.2 rmind np->n_fhp->nfh_len = fhsize;
167 1.1.1.1.4.2 rmind error = insmntque(vp, mntp);
168 1.1.1.1.4.2 rmind if (error != 0) {
169 1.1.1.1.4.2 rmind *npp = NULL;
170 1.1.1.1.4.2 rmind FREE((caddr_t)np->n_fhp, M_NFSFH);
171 1.1.1.1.4.2 rmind mtx_destroy(&np->n_mtx);
172 1.1.1.1.4.2 rmind uma_zfree(newnfsnode_zone, np);
173 1.1.1.1.4.2 rmind return (error);
174 1.1.1.1.4.2 rmind }
175 1.1.1.1.4.2 rmind error = vfs_hash_insert(vp, hash, lkflags,
176 1.1.1.1.4.2 rmind td, &nvp, newnfs_vncmpf, np->n_fhp);
177 1.1.1.1.4.2 rmind if (error)
178 1.1.1.1.4.2 rmind return (error);
179 1.1.1.1.4.2 rmind if (nvp != NULL) {
180 1.1.1.1.4.2 rmind *npp = VTONFS(nvp);
181 1.1.1.1.4.2 rmind /* vfs_hash_insert() vput()'s the losing vnode */
182 1.1.1.1.4.2 rmind return (0);
183 1.1.1.1.4.2 rmind }
184 1.1.1.1.4.2 rmind *npp = np;
185 1.1.1.1.4.2 rmind
186 1.1.1.1.4.2 rmind return (0);
187 1.1.1.1.4.2 rmind }
188 1.1.1.1.4.2 rmind
189 1.1.1.1.4.2 rmind /*
190 1.1.1.1.4.2 rmind * Do the vrele(sp->s_dvp) as a separate task in order to avoid a
191 1.1.1.1.4.2 rmind * deadlock because of a LOR when vrele() locks the directory vnode.
192 1.1.1.1.4.2 rmind */
193 1.1.1.1.4.2 rmind static void
194 1.1.1.1.4.2 rmind nfs_freesillyrename(void *arg, __unused int pending)
195 1.1.1.1.4.2 rmind {
196 1.1.1.1.4.2 rmind struct sillyrename *sp;
197 1.1.1.1.4.2 rmind
198 1.1.1.1.4.2 rmind sp = arg;
199 1.1.1.1.4.2 rmind vrele(sp->s_dvp);
200 1.1.1.1.4.2 rmind free(sp, M_NEWNFSREQ);
201 1.1.1.1.4.2 rmind }
202 1.1.1.1.4.2 rmind
203 1.1.1.1.4.2 rmind int
204 1.1.1.1.4.2 rmind ncl_inactive(struct vop_inactive_args *ap)
205 1.1.1.1.4.2 rmind {
206 1.1.1.1.4.2 rmind struct nfsnode *np;
207 1.1.1.1.4.2 rmind struct sillyrename *sp;
208 1.1.1.1.4.2 rmind struct vnode *vp = ap->a_vp;
209 1.1.1.1.4.2 rmind boolean_t retv;
210 1.1.1.1.4.2 rmind
211 1.1.1.1.4.2 rmind np = VTONFS(vp);
212 1.1.1.1.4.2 rmind
213 1.1.1.1.4.2 rmind if (NFS_ISV4(vp) && vp->v_type == VREG) {
214 1.1.1.1.4.2 rmind /*
215 1.1.1.1.4.2 rmind * Since mmap()'d files do I/O after VOP_CLOSE(), the NFSv4
216 1.1.1.1.4.2 rmind * Close operations are delayed until now. Any dirty
217 1.1.1.1.4.2 rmind * buffers/pages must be flushed before the close, so that the
218 1.1.1.1.4.2 rmind * stateid is available for the writes.
219 1.1.1.1.4.2 rmind */
220 1.1.1.1.4.2 rmind if (vp->v_object != NULL) {
221 1.1.1.1.4.2 rmind VM_OBJECT_WLOCK(vp->v_object);
222 1.1.1.1.4.2 rmind retv = vm_object_page_clean(vp->v_object, 0, 0,
223 1.1.1.1.4.2 rmind OBJPC_SYNC);
224 1.1.1.1.4.2 rmind VM_OBJECT_WUNLOCK(vp->v_object);
225 1.1.1.1.4.2 rmind } else
226 1.1.1.1.4.2 rmind retv = TRUE;
227 1.1.1.1.4.2 rmind if (retv == TRUE) {
228 1.1.1.1.4.2 rmind (void)ncl_flush(vp, MNT_WAIT, NULL, ap->a_td, 1, 0);
229 1.1.1.1.4.2 rmind (void)nfsrpc_close(vp, 1, ap->a_td);
230 1.1.1.1.4.2 rmind }
231 1.1.1.1.4.2 rmind }
232 1.1.1.1.4.2 rmind
233 1.1.1.1.4.2 rmind mtx_lock(&np->n_mtx);
234 1.1.1.1.4.2 rmind if (vp->v_type != VDIR) {
235 1.1.1.1.4.2 rmind sp = np->n_sillyrename;
236 1.1.1.1.4.2 rmind np->n_sillyrename = NULL;
237 1.1.1.1.4.2 rmind } else
238 1.1.1.1.4.2 rmind sp = NULL;
239 1.1.1.1.4.2 rmind if (sp) {
240 1.1.1.1.4.2 rmind mtx_unlock(&np->n_mtx);
241 1.1.1.1.4.2 rmind (void) ncl_vinvalbuf(vp, 0, ap->a_td, 1);
242 1.1.1.1.4.2 rmind /*
243 1.1.1.1.4.2 rmind * Remove the silly file that was rename'd earlier
244 1.1.1.1.4.2 rmind */
245 1.1.1.1.4.2 rmind ncl_removeit(sp, vp);
246 1.1.1.1.4.2 rmind crfree(sp->s_cred);
247 1.1.1.1.4.2 rmind TASK_INIT(&sp->s_task, 0, nfs_freesillyrename, sp);
248 1.1.1.1.4.2 rmind taskqueue_enqueue(taskqueue_thread, &sp->s_task);
249 1.1.1.1.4.2 rmind mtx_lock(&np->n_mtx);
250 1.1.1.1.4.2 rmind }
251 1.1.1.1.4.2 rmind np->n_flag &= NMODIFIED;
252 1.1.1.1.4.2 rmind mtx_unlock(&np->n_mtx);
253 1.1.1.1.4.2 rmind return (0);
254 1.1.1.1.4.2 rmind }
255 1.1.1.1.4.2 rmind
256 1.1.1.1.4.2 rmind /*
257 1.1.1.1.4.2 rmind * Reclaim an nfsnode so that it can be used for other purposes.
258 1.1.1.1.4.2 rmind */
259 1.1.1.1.4.2 rmind int
260 1.1.1.1.4.2 rmind ncl_reclaim(struct vop_reclaim_args *ap)
261 1.1.1.1.4.2 rmind {
262 1.1.1.1.4.2 rmind struct vnode *vp = ap->a_vp;
263 1.1.1.1.4.2 rmind struct nfsnode *np = VTONFS(vp);
264 1.1.1.1.4.2 rmind struct nfsdmap *dp, *dp2;
265 1.1.1.1.4.2 rmind
266 1.1.1.1.4.2 rmind /*
267 1.1.1.1.4.2 rmind * If the NLM is running, give it a chance to abort pending
268 1.1.1.1.4.2 rmind * locks.
269 1.1.1.1.4.2 rmind */
270 1.1.1.1.4.2 rmind if (nfs_reclaim_p != NULL)
271 1.1.1.1.4.2 rmind nfs_reclaim_p(ap);
272 1.1.1.1.4.2 rmind
273 1.1.1.1.4.2 rmind /*
274 1.1.1.1.4.2 rmind * Destroy the vm object and flush associated pages.
275 1.1.1.1.4.2 rmind */
276 1.1.1.1.4.2 rmind vnode_destroy_vobject(vp);
277 1.1.1.1.4.2 rmind
278 1.1.1.1.4.2 rmind if (NFS_ISV4(vp) && vp->v_type == VREG)
279 1.1.1.1.4.2 rmind /*
280 1.1.1.1.4.2 rmind * We can now safely close any remaining NFSv4 Opens for
281 1.1.1.1.4.2 rmind * this file. Most opens will have already been closed by
282 1.1.1.1.4.2 rmind * ncl_inactive(), but there are cases where it is not
283 1.1.1.1.4.2 rmind * called, so we need to do it again here.
284 1.1.1.1.4.2 rmind */
285 1.1.1.1.4.2 rmind (void) nfsrpc_close(vp, 1, ap->a_td);
286 1.1.1.1.4.2 rmind
287 1.1.1.1.4.2 rmind vfs_hash_remove(vp);
288 1.1.1.1.4.2 rmind
289 1.1.1.1.4.2 rmind /*
290 1.1.1.1.4.2 rmind * Call nfscl_reclaimnode() to save attributes in the delegation,
291 1.1.1.1.4.2 rmind * as required.
292 1.1.1.1.4.2 rmind */
293 1.1.1.1.4.2 rmind if (vp->v_type == VREG)
294 1.1.1.1.4.2 rmind nfscl_reclaimnode(vp);
295 1.1.1.1.4.2 rmind
296 1.1.1.1.4.2 rmind /*
297 1.1.1.1.4.2 rmind * Free up any directory cookie structures and
298 1.1.1.1.4.2 rmind * large file handle structures that might be associated with
299 1.1.1.1.4.2 rmind * this nfs node.
300 1.1.1.1.4.2 rmind */
301 1.1.1.1.4.2 rmind if (vp->v_type == VDIR) {
302 1.1.1.1.4.2 rmind dp = LIST_FIRST(&np->n_cookies);
303 1.1.1.1.4.2 rmind while (dp) {
304 1.1.1.1.4.2 rmind dp2 = dp;
305 1.1.1.1.4.2 rmind dp = LIST_NEXT(dp, ndm_list);
306 1.1.1.1.4.2 rmind FREE((caddr_t)dp2, M_NFSDIROFF);
307 1.1.1.1.4.2 rmind }
308 1.1.1.1.4.2 rmind }
309 1.1.1.1.4.2 rmind if (np->n_writecred != NULL)
310 1.1.1.1.4.2 rmind crfree(np->n_writecred);
311 1.1.1.1.4.2 rmind FREE((caddr_t)np->n_fhp, M_NFSFH);
312 1.1.1.1.4.2 rmind if (np->n_v4 != NULL)
313 1.1.1.1.4.2 rmind FREE((caddr_t)np->n_v4, M_NFSV4NODE);
314 1.1.1.1.4.2 rmind mtx_destroy(&np->n_mtx);
315 1.1.1.1.4.2 rmind uma_zfree(newnfsnode_zone, vp->v_data);
316 1.1.1.1.4.2 rmind vp->v_data = NULL;
317 1.1.1.1.4.2 rmind return (0);
318 1.1.1.1.4.2 rmind }
319 1.1.1.1.4.2 rmind
320 1.1.1.1.4.2 rmind /*
321 1.1.1.1.4.2 rmind * Invalidate both the access and attribute caches for this vnode.
322 1.1.1.1.4.2 rmind */
323 1.1.1.1.4.2 rmind void
324 1.1.1.1.4.2 rmind ncl_invalcaches(struct vnode *vp)
325 1.1.1.1.4.2 rmind {
326 1.1.1.1.4.2 rmind struct nfsnode *np = VTONFS(vp);
327 1.1.1.1.4.2 rmind int i;
328 1.1.1.1.4.2 rmind
329 1.1.1.1.4.2 rmind mtx_lock(&np->n_mtx);
330 1.1.1.1.4.2 rmind for (i = 0; i < NFS_ACCESSCACHESIZE; i++)
331 1.1.1.1.4.2 rmind np->n_accesscache[i].stamp = 0;
332 1.1.1.1.4.2 rmind KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp);
333 1.1.1.1.4.2 rmind np->n_attrstamp = 0;
334 1.1.1.1.4.2 rmind KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
335 1.1.1.1.4.2 rmind mtx_unlock(&np->n_mtx);
336 1.1.1.1.4.2 rmind }
337 1.1.1.1.4.2 rmind
338