1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * from nfs_node.c 8.6 (Berkeley) 5/22/95 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clnode.c 220731 2011-04-16 22:15:59Z rmacklem $"); |
37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/fcntl.h> 41#include <sys/lock.h> 42#include <sys/malloc.h> 43#include <sys/mount.h> 44#include <sys/namei.h> --- 152 unchanged lines hidden (view full) --- 197 * Close operations are delayed until now. Any dirty buffers 198 * must be flushed before the close, so that the stateid is 199 * available for the writes. 200 */ 201 (void) ncl_flush(vp, MNT_WAIT, NULL, ap->a_td, 1, 0); 202 (void) nfsrpc_close(vp, 1, ap->a_td); 203 } 204 |
205 mtx_lock(&np->n_mtx); |
206 if (vp->v_type != VDIR) { 207 sp = np->n_sillyrename; 208 np->n_sillyrename = NULL; 209 } else 210 sp = NULL; 211 if (sp) { |
212 mtx_unlock(&np->n_mtx); |
213 (void) ncl_vinvalbuf(vp, 0, ap->a_td, 1); 214 /* 215 * Remove the silly file that was rename'd earlier 216 */ 217 ncl_removeit(sp, vp); 218 crfree(sp->s_cred); 219 vrele(sp->s_dvp); 220 FREE((caddr_t)sp, M_NEWNFSREQ); |
221 mtx_lock(&np->n_mtx); |
222 } 223 np->n_flag &= NMODIFIED; |
224 mtx_unlock(&np->n_mtx); |
225 return (0); 226} 227 228/* 229 * Reclaim an nfsnode so that it can be used for other purposes. 230 */ 231int 232ncl_reclaim(struct vop_reclaim_args *ap) --- 73 unchanged lines hidden --- |