Print this page
NEX-14666 Need to provide SMB 2.1 Client
NEX-17187 panic in smbfs_acl_store
NEX-17231 smbfs create xattr files finds wrong file
NEX-17224 smbfs lookup EINVAL should be ENOENT
NEX-17260 SMB1 client fails to list directory after NEX-14666
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
and: (cleanup)
5404 smbfs needs mmap support
Portions contributed by: Gordon Ross <gordon.w.ross@gmail.com>
Reviewed by: C Fraire <cfraire@me.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Richard Lowe <richlowe@richlowe.net>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/smbclnt/smbfs/smbfs_node.h
          +++ new/usr/src/uts/common/fs/smbclnt/smbfs/smbfs_node.h
↓ open down ↓ 25 lines elided ↑ open up ↑
  26   26   * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  27   27   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  28   28   * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  29   29   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30   30   * SUCH DAMAGE.
  31   31   *
  32   32   * $Id: smbfs_node.h,v 1.31.52.1 2005/05/27 02:35:28 lindak Exp $
  33   33   */
  34   34  
  35   35  /*
  36      - * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  37   36   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  38   37   * Use is subject to license terms.
       38 + *
       39 + * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  39   40   */
  40   41  
  41   42  #ifndef _FS_SMBFS_NODE_H_
  42   43  #define _FS_SMBFS_NODE_H_
  43   44  
  44   45  /*
  45   46   * Much code copied into here from Sun NFS.
  46   47   * Compare with nfs_clnt.h
  47   48   */
  48   49  
↓ open down ↓ 130 lines elided ↑ open up ↑
 179  180   *      set r_modaddr and release r_statelock as long as the r_rwlock
 180  181   *      writer lock is held.
 181  182   *
 182  183   * 64-bit offsets: the code formerly assumed that atomic reads of
 183  184   * r_size were safe and reliable; on 32-bit architectures, this is
 184  185   * not true since an intervening bus cycle from another processor
 185  186   * could update half of the size field.  The r_statelock must now
 186  187   * be held whenever any kind of access of r_size is made.
 187  188   *
 188  189   * Lock ordering:
 189      - *      r_rwlock > r_lkserlock > r_statelock
      190 + *      r_rwlock > r_lkserlock > r_statelock
 190  191   */
 191  192  
 192  193  typedef struct smbnode {
 193  194          /* Our linkage in the node cache AVL tree (see above). */
 194  195          smbfs_node_hdr_t        r__hdr;
 195  196  
 196  197          /* short-hand names for r__hdr members */
 197  198  #define r_avl_node      r__hdr.hdr_avl_node
 198  199  #define n_rpath         r__hdr.hdr_n_rpath
 199  200  #define n_rplen         r__hdr.hdr_n_rplen
↓ open down ↓ 14 lines elided ↑ open up ↑
 214  215  
 215  216          /*
 216  217           * File handle, directory search handle,
 217  218           * and reference counts for them, etc.
 218  219           * Lock for these is: r_lkserlock
 219  220           */
 220  221          int             n_dirrefs;
 221  222          struct smbfs_fctx       *n_dirseq;      /* ff context */
 222  223          int             n_dirofs;       /* last ff offset */
 223  224          int             n_fidrefs;
 224      -        uint16_t        n_fid;          /* file handle */
      225 +        smb_fh_t        *n_fid;         /* file handle */
 225  226          enum vtype      n_ovtype;       /* vnode type opened */
 226      -        uint32_t        n_rights;       /* granted rights */
 227      -        int             n_vcgenid;      /* gereration no. (reconnect) */
 228  227  
 229  228          /*
 230  229           * Misc. bookkeeping
 231  230           */
 232  231          cred_t          *r_cred;        /* current credentials */
 233  232          u_offset_t      r_nextr;        /* next read offset (read-ahead) */
 234  233          long            r_mapcnt;       /* count of mmapped pages */
      234 +        uint_t          r_inmap;        /* to serialize read/write and mmap */
 235  235          uint_t          r_count;        /* # of refs not reflect in v_count */
 236  236          uint_t          r_awcount;      /* # of outstanding async write */
 237  237          uint_t          r_gcount;       /* getattrs waiting to flush pages */
 238  238          uint_t          r_flags;        /* flags, see below */
 239      -        uint32_t        n_flag;         /* NXXX flags below */
      239 +        uint32_t        n_flag;         /* N--- flags below */
 240  240          uint_t          r_error;        /* async write error */
 241  241          kcondvar_t      r_cv;           /* condvar for blocked threads */
 242  242          avl_tree_t      r_dir;          /* cache of readdir responses */
 243  243          rddir_cache     *r_direof;      /* pointer to the EOF entry */
      244 +        u_offset_t      r_modaddr;      /* address for page in writenp */
 244  245          kthread_t       *r_serial;      /* id of purging thread */
 245  246          list_t          r_indelmap;     /* list of delmap callers */
 246  247  
 247  248          /*
 248  249           * Attributes: local, and as last seen on the server.
 249  250           * See notes above re: r_size vs r_attr.fa_size, etc.
 250  251           */
 251  252          smbfattr_t      r_attr;         /* attributes from the server */
 252  253          hrtime_t        r_attrtime;     /* time attributes become invalid */
 253  254          hrtime_t        r_mtime;        /* client time file last modified */
↓ open down ↓ 21 lines elided ↑ open up ↑
 275  276  #define NFLUSHWANT      0x00002 /* they should gone ... */
 276  277  #define NMODIFIED       0x00004 /* bogus, until async IO implemented */
 277  278  #define NREFPARENT      0x00010 /* node holds parent from recycling */
 278  279  #define NGOTIDS         0x00020
 279  280  #define NRDIRSERIAL     0x00080 /* serialize readdir operation */
 280  281  #define NISMAPPED       0x00800
 281  282  #define NFLUSHWIRE      0x01000
 282  283  #define NATTRCHANGED    0x02000 /* kill cached attributes at close */
 283  284  #define NALLOC          0x04000 /* being created */
 284  285  #define NWALLOC         0x08000 /* awaiting creation */
 285      -#define N_XATTR         0x10000 /* extended attribute (dir or file) */
      286 +#define N_XATTR         0x10000 /* extended attribute (dir or file) */
 286  287  
 287  288  /*
 288  289   * Flag bits in: smbnode_t .r_flags
 289  290   */
 290  291  #define RREADDIRPLUS    0x1     /* issue a READDIRPLUS instead of READDIR */
 291  292  #define RDIRTY          0x2     /* dirty pages from write operation */
 292  293  #define RSTALE          0x4     /* file handle is stale */
 293  294  #define RMODINPROGRESS  0x8     /* page modification happening */
 294  295  #define RTRUNCATE       0x10    /* truncating, don't commit */
 295  296  #define RHAVEVERF       0x20    /* have a write verifier to compare against */
↓ open down ↓ 28 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX