Print this page
NEX-15279 support NFS server in zone
NEX-15520 online NFS shares cause zoneadm halt to hang in nfs_export_zone_fini
Portions contributed by: Dan Kruchinin dan.kruchinin@nexenta.com
Portions contributed by: Stepan Zastupov stepan.zastupov@gmail.com
Reviewed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sharefs/sharefs.h
          +++ new/usr/src/uts/common/sharefs/sharefs.h
↓ open down ↓ 16 lines elided ↑ open up ↑
  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 2007 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
       27 +/*
       28 + * Copyright 2018 Nexenta Systems, Inc.
       29 + */
       30 +
  27   31  #ifndef _SHAREFS_SHAREFS_H
  28   32  #define _SHAREFS_SHAREFS_H
  29   33  
  30      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  31      -
  32   34  /*
  33   35   * This header provides service for the sharefs module.
  34   36   */
  35   37  
  36   38  #include <sys/modctl.h>
  37   39  #include <sys/vfs.h>
  38   40  #include <sys/vnode.h>
  39   41  #include <sys/gfs.h>
  40   42  #include <sharefs/share.h>
  41   43  #include <sharefs/sharetab.h>
↓ open down ↓ 18 lines elided ↑ open up ↑
  60   62  
  61   63  /*
  62   64   * VFS data object
  63   65   */
  64   66  typedef struct sharefs_vfs {
  65   67          vnode_t *sharefs_vfs_root;
  66   68  } sharefs_vfs_t;
  67   69  
  68   70  #define SHAREFS_NAME_MAX        MAXNAMELEN
  69   71  
  70      -/*
  71      - * The lock ordering whenever sharefs_lock and sharetab_lock both
  72      - * need to be held is: sharefs_lock and then sharetab_lock.
  73      - */
  74      -extern krwlock_t        sharefs_lock;   /* lock for the vnode ops */
  75      -extern sharetab_t       *sharefs_sharetab;      /* The sharetab. */
       72 +typedef struct sharetab_globals {
       73 +        /*
       74 +         * The lock ordering whenever sharefs_lock and sharetab_lock both
       75 +         * need to be held is: sharefs_lock and then sharetab_lock.
       76 +         */
       77 +        krwlock_t       sharefs_lock;   /* lock for the vnode ops */
       78 +        sharetab_t      *sharefs_sharetab;      /* The sharetab. */
  76   79  
  77      -extern uint_t           sharetab_count; /* How many shares? */
  78      -extern krwlock_t        sharetab_lock;  /* lock for the cached sharetab */
  79      -extern size_t           sharetab_size;  /* How big is the sharetab file? */
       80 +        uint_t          sharetab_count; /* How many shares? */
       81 +        krwlock_t       sharetab_lock;  /* lock for the cached sharetab */
       82 +        size_t          sharetab_size;  /* How big is the sharetab file? */
  80   83  
  81      -extern timestruc_t      sharetab_mtime; /* Last mod to sharetab */
  82      -extern timestruc_t      sharetab_snap_time;     /* Last snap */
  83      -extern uint_t           sharetab_generation;    /* Which copy is it? */
       84 +        timestruc_t     sharetab_mtime; /* Last mod to sharetab */
       85 +        timestruc_t     sharetab_snap_time;     /* Last snap */
       86 +        uint_t          sharetab_generation;    /* Which copy is it? */
       87 +} sharetab_globals_t;
  84   88  
  85   89  #define SHAREFS_INO_FILE        0x80
  86   90  
  87   91  extern vnode_t *sharefs_create_root_file(vfs_t *);
       92 +extern sharetab_globals_t *sharetab_get_globals(zone_t *zone);
  88   93  
  89   94  /*
  90   95   * Sharetab file
  91   96   *
  92   97   * Note that even though the sharetab code does not explictly
  93   98   * use 'sharefs_file', it is required by GFS that the first
  94   99   * field of the private data be a gfs_file_t.
  95  100   */
  96  101  typedef struct shnode_t {
  97  102          gfs_file_t      sharefs_file;           /* gfs file */
↓ open down ↓ 26 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX