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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/nfs/nfs4_vnops.c
          +++ new/usr/src/uts/common/fs/nfs/nfs4_vnops.c
↓ open down ↓ 23 lines elided ↑ open up ↑
  24   24   */
  25   25  /*
  26   26   * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
  27   27   */
  28   28  
  29   29  /*
  30   30   *      Copyright 1983,1984,1985,1986,1987,1988,1989 AT&T.
  31   31   *      All Rights Reserved
  32   32   */
  33   33  
       34 +/*
       35 + * Copyright (c) 2013, Joyent, Inc. All rights reserved.
       36 + */
       37 +
  34   38  #include <sys/param.h>
  35   39  #include <sys/types.h>
  36   40  #include <sys/systm.h>
  37   41  #include <sys/cred.h>
  38   42  #include <sys/time.h>
  39   43  #include <sys/vnode.h>
  40   44  #include <sys/vfs.h>
  41   45  #include <sys/vfs_opreg.h>
  42   46  #include <sys/file.h>
  43   47  #include <sys/filio.h>
↓ open down ↓ 6602 lines elided ↑ open up ↑
6646 6650                                  }
6647 6651                          }
6648 6652                  }
6649 6653          }
6650 6654          nfs_rw_exit(&drp->r_rwlock);
6651 6655          if (error) {
6652 6656                  VN_RELE(vp);
6653 6657          } else {
6654 6658                  vnode_t *tvp;
6655 6659                  rnode4_t *trp;
6656      -                /*
6657      -                 * existing file got truncated, notify.
6658      -                 */
6659 6660                  tvp = vp;
6660 6661                  if (vp->v_type == VREG) {
6661 6662                          trp = VTOR4(vp);
6662 6663                          if (IS_SHADOW(vp, trp))
6663 6664                                  tvp = RTOV4(trp);
6664 6665                  }
6665      -                vnevent_create(tvp, ct);
     6666 +
     6667 +                if (must_trunc) {
     6668 +                        /*
     6669 +                         * existing file got truncated, notify.
     6670 +                         */
     6671 +                        vnevent_create(tvp, ct);
     6672 +                }
     6673 +
6666 6674                  *vpp = vp;
6667 6675          }
6668 6676          return (error);
6669 6677  
6670 6678  create_otw:
6671 6679          dnlc_remove(dvp, nm);
6672 6680  
6673 6681          ASSERT(vattr.va_mask & AT_TYPE);
6674 6682  
6675 6683          /*
↓ open down ↓ 9311 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX