Print this page
10084 fop_open() doesn't need to check for a NULL vnode

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/vnode.c
          +++ new/usr/src/uts/common/fs/vnode.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright 2017, Joyent, Inc.
       24 + * Copyright (c) 2018, Joyent, Inc.
  25   25   * Copyright 2016 Nexenta Systems, Inc.  All rights reserved.
  26   26   * Copyright (c) 2011, 2017 by Delphix. All rights reserved.
  27   27   */
  28   28  
  29   29  /*      Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T     */
  30   30  /*        All Rights Reserved   */
  31   31  
  32   32  /*
  33   33   * University Copyright- Copyright (c) 1982, 1986, 1988
  34   34   * The Regents of the University of California
↓ open down ↓ 3326 lines elided ↑ open up ↑
3361 3361          } else {
3362 3362                  /*
3363 3363                   * Some filesystems will return a different vnode,
3364 3364                   * but the same path was still used to open it.
3365 3365                   * So if we do change the vnode and need to
3366 3366                   * copy over the path, do so here, rather than special
3367 3367                   * casing each filesystem. Adjust the vnode counts to
3368 3368                   * reflect the vnode switch.
3369 3369                   */
3370 3370                  VOPSTATS_UPDATE(*vpp, open);
3371      -                if (*vpp != vp && *vpp != NULL) {
     3371 +                if (*vpp != vp) {
3372 3372                          vn_copypath(vp, *vpp);
3373 3373                          if (((*vpp)->v_type == VREG) && (mode & FREAD))
3374 3374                                  atomic_inc_32(&(*vpp)->v_rdcnt);
3375 3375                          if ((vp->v_type == VREG) && (mode & FREAD))
3376 3376                                  atomic_dec_32(&vp->v_rdcnt);
3377 3377                          if (((*vpp)->v_type == VREG) && (mode & FWRITE))
3378 3378                                  atomic_inc_32(&(*vpp)->v_wrcnt);
3379 3379                          if ((vp->v_type == VREG) && (mode & FWRITE))
3380 3380                                  atomic_dec_32(&vp->v_wrcnt);
3381 3381                  }
↓ open down ↓ 1352 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX