Print this page
3484 enhance and document tail follow support
Reviewed by: Joshua M. Clulow <jmc@joyent.com>
*** 21,30 ****
--- 21,33 ----
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+ /*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
/*
* File Events Notification
* ------------------------
*
*** 1963,1973 ****
event |= FILE_ACCESS;
}
if (op & FOP_ATTRIB_MASK) {
event |= FILE_ATTRIB;
}
!
if (event) {
port_fop_sendevent(vp, event, NULL, NULL);
}
}
--- 1966,1978 ----
event |= FILE_ACCESS;
}
if (op & FOP_ATTRIB_MASK) {
event |= FILE_ATTRIB;
}
! if (op & FOP_TRUNC_MASK) {
! event |= FILE_TRUNC;
! }
if (event) {
port_fop_sendevent(vp, event, NULL, NULL);
}
}
*** 2145,2154 ****
--- 2150,2162 ----
int retval;
vnode_t *vp = (vnode_t *)vf->fa_fnode->fn_available;
int events = 0;
retval = vnext_setattr(vf, vap, flags, cr, ct);
+ if (vap->va_mask & AT_SIZE) {
+ events |= FOP_FILE_TRUNC;
+ }
if (vap->va_mask & (AT_SIZE|AT_MTIME)) {
events |= FOP_FILE_SETATTR_MTIME;
}
if (vap->va_mask & AT_ATIME) {
events |= FOP_FILE_SETATTR_ATIME;
*** 2320,2331 ****
break;
case VE_RMDIR:
port_fop_sendevent(vp, FILE_DELETE, dvp, name);
break;
case VE_CREATE:
! port_fop_sendevent(vp, FILE_MODIFIED|FILE_ATTRIB,
! NULL, NULL);
break;
case VE_LINK:
port_fop_sendevent(vp, FILE_ATTRIB, NULL, NULL);
break;
--- 2328,2339 ----
break;
case VE_RMDIR:
port_fop_sendevent(vp, FILE_DELETE, dvp, name);
break;
case VE_CREATE:
! port_fop_sendevent(vp,
! FILE_MODIFIED|FILE_ATTRIB|FILE_TRUNC, NULL, NULL);
break;
case VE_LINK:
port_fop_sendevent(vp, FILE_ATTRIB, NULL, NULL);
break;