Print this page
3484 enhance and document tail follow support
Reviewed by: Joshua M. Clulow <jmc@joyent.com>

*** 22,31 **** --- 22,35 ---- /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ + /* + * Copyright (c) 2013, Joyent, Inc. All rights reserved. + */ + #include <sys/types.h> #include <sys/param.h> #include <sys/t_lock.h> #include <sys/systm.h> #include <sys/sysmacros.h>
*** 976,985 **** --- 980,991 ---- } else { error = tdirlookup(parent, nm, &oldtp, cred); } if (error == 0) { /* name found */ + boolean_t trunc = B_FALSE; + ASSERT(oldtp); rw_enter(&oldtp->tn_rwlock, RW_WRITER); /*
*** 1003,1012 **** --- 1009,1019 ---- if ((*vpp)->v_type == VREG && (vap->va_mask & AT_SIZE) && vap->va_size == 0) { rw_enter(&oldtp->tn_contents, RW_WRITER); (void) tmpnode_trunc(tm, oldtp, 0); rw_exit(&oldtp->tn_contents); + trunc = B_TRUE; } rw_exit(&oldtp->tn_rwlock); if (IS_DEVVP(*vpp)) { struct vnode *newvp;
*** 1017,1029 **** return (ENOSYS); } *vpp = newvp; } ! if (error == 0) { vnevent_create(*vpp, ct); ! } return (0); } if (error != ENOENT) return (error); --- 1024,1036 ---- return (ENOSYS); } *vpp = newvp; } ! if (trunc) vnevent_create(*vpp, ct); ! return (0); } if (error != ENOENT) return (error);