Print this page
11083 support NFS server in zone
Portions contributed by: Dan Kruchinin <dan.kruchinin@nexenta.com>
Portions contributed by: Stepan Zastupov <stepan.zastupov@gmail.com>
Portions contributed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
Portions contributed by: Mike Zeller <mike@mikezeller.net>
Portions contributed by: Dan McDonald <danmcd@joyent.com>
Portions contributed by: Gordon Ross <gordon.w.ross@gmail.com>
Portions contributed by: Vitaliy Gusev <gusev.vitaliy@gmail.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Jason King <jbk@joyent.com>
Reviewed by: C Fraire <cfraire@me.com>
Change-Id: I22f289d357503f9b48a0bc2482cc4328a6d43d16

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/sharefs/sharefs_vfsops.c
          +++ new/usr/src/uts/common/fs/sharefs/sharefs_vfsops.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  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) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
  25   25  
       26 +/*
       27 + * Copyright 2018 Nexenta Systems, Inc.
       28 + */
       29 +
  26   30  #include <sys/atomic.h>
  27   31  #include <sys/cmn_err.h>
  28   32  #include <sys/errno.h>
  29   33  #include <sys/mount.h>
  30   34  #include <sharefs/sharefs.h>
  31   35  #include <sys/vfs_opreg.h>
  32   36  #include <sys/policy.h>
  33   37  #include <sys/sunddi.h>
  34   38  #include <sys/sysmacros.h>
  35   39  #include <sys/systm.h>
↓ open down ↓ 200 lines elided ↑ open up ↑
 236  240          ASSERT(vfsp->vfs_count >= 2);
 237  241  
 238  242          /*
 239  243           * Any active vnodes will result in a hold on the root vnode
 240  244           */
 241  245          data = vfsp->vfs_data;
 242  246          if (data->sharefs_vfs_root->v_count > 1)
 243  247                  return (EBUSY);
 244  248  
 245  249          /*
 246      -         * Only allow an unmount iff there are no entries in memory.
 247      -         */
 248      -        rw_enter(&sharetab_lock, RW_READER);
 249      -        if (sharetab_size != 0) {
 250      -                rw_exit(&sharetab_lock);
 251      -                return (EBUSY);
 252      -        }
 253      -        rw_exit(&sharetab_lock);
 254      -
 255      -        /*
 256  250           * Release the last hold on the root vnode
 257  251           */
 258  252          VN_RELE(data->sharefs_vfs_root);
 259  253  
 260  254          kmem_free(data, sizeof (sharefs_vfs_t));
 261  255  
 262  256          return (0);
 263  257  }
 264  258  
 265  259  static int
↓ open down ↓ 39 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX