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/nfs3_vnops.c
          +++ new/usr/src/uts/common/fs/nfs/nfs3_vnops.c
↓ open down ↓ 20 lines elided ↑ open up ↑
  21   21  /*
  22   22   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26   26  /*
  27   27   *      Copyright (c) 1983,1984,1985,1986,1987,1988,1989 AT&T.
  28   28   *      All rights reserved.
  29   29   */
  30   30  
       31 +/*
       32 + * Copyright (c) 2013, Joyent, Inc. All rights reserved.
       33 + */
       34 +
  31   35  #include <sys/param.h>
  32   36  #include <sys/types.h>
  33   37  #include <sys/systm.h>
  34   38  #include <sys/cred.h>
  35   39  #include <sys/time.h>
  36   40  #include <sys/vnode.h>
  37   41  #include <sys/vfs.h>
  38   42  #include <sys/vfs_opreg.h>
  39   43  #include <sys/file.h>
  40   44  #include <sys/filio.h>
↓ open down ↓ 2250 lines elided ↑ open up ↑
2291 2295                                          if (!(lfaware & FOFFMAX)) {
2292 2296                                                  mutex_enter(&rp->r_statelock);
2293 2297                                                  if (rp->r_size > MAXOFF32_T)
2294 2298                                                          error = EOVERFLOW;
2295 2299                                                  mutex_exit(&rp->r_statelock);
2296 2300                                          }
2297 2301                                          if (!error) {
2298 2302                                                  vattr.va_mask = AT_SIZE;
2299 2303                                                  error = nfs3setattr(vp,
2300 2304                                                      &vattr, 0, cr);
     2305 +
     2306 +                                                /*
     2307 +                                                 * Existing file was truncated;
     2308 +                                                 * emit a create event.
     2309 +                                                 */
     2310 +                                                vnevent_create(vp, ct);
2301 2311                                          }
2302 2312                                  }
2303 2313                          }
2304 2314                  }
2305 2315                  nfs_rw_exit(&drp->r_rwlock);
2306 2316                  if (error) {
2307 2317                          VN_RELE(vp);
2308 2318                  } else {
2309      -                        /*
2310      -                         * existing file got truncated, notify.
2311      -                         */
2312      -                        vnevent_create(vp, ct);
2313 2319                          *vpp = vp;
2314 2320                  }
     2321 +
2315 2322                  return (error);
2316 2323          }
2317 2324  
2318 2325          dnlc_remove(dvp, nm);
2319 2326  
2320 2327          /*
2321 2328           * Decide what the group-id of the created file should be.
2322 2329           * Set it in attribute list as advisory...
2323 2330           */
2324 2331          error = setdirgid(dvp, &vattr.va_gid, cr);
↓ open down ↓ 4415 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX