Print this page
NEX-6276 SMB sparse file support
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-4083 Upstream changes from illumos 5917 and 5995
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
NEX-3620 need upstream cleanups for smbsrv
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
SMB-11 SMB2 message parse & dispatch
SMB-12 SMB2 Negotiate Protocol
SMB-13 SMB2 Session Setup
SMB-14 SMB2 Logoff
SMB-15 SMB2 Tree Connect
SMB-16 SMB2 Tree Disconnect
SMB-17 SMB2 Create
SMB-18 SMB2 Close
SMB-19 SMB2 Flush
SMB-20 SMB2 Read
SMB-21 SMB2 Write
SMB-22 SMB2 Lock/Unlock
SMB-23 SMB2 Ioctl
SMB-24 SMB2 Cancel
SMB-25 SMB2 Echo
SMB-26 SMB2 Query Dir
SMB-27 SMB2 Change Notify
SMB-28 SMB2 Query Info
SMB-29 SMB2 Set Info
SMB-30 SMB2 Oplocks
SMB-53 SMB2 Create Context options
(SMB2 code review cleanup 1, 2, 3)
SMB-50 User-mode SMB server
 Includes work by these authors:
 Thomas Keiser <thomas.keiser@nexenta.com>
 Albert Lee <trisk@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/smbsrv/libfksmbsrv/common/fake_vfs.c
          +++ new/usr/src/lib/smbsrv/libfksmbsrv/common/fake_vfs.c
↓ open down ↓ 2 lines elided ↑ open up ↑
   3    3   * Common Development and Distribution License ("CDDL"), version 1.0.
   4    4   * You may only use this file in accordance with the terms of version
   5    5   * 1.0 of the CDDL.
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  
  12   12  /*
  13      - * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
       13 + * Copyright 2016 Nexenta Systems, Inc.  All rights reserved.
  14   14   */
  15   15  
  16   16  #include <sys/types.h>
  17   17  #include <sys/param.h>
  18   18  #include <sys/t_lock.h>
  19   19  #include <sys/errno.h>
  20   20  #include <sys/cred.h>
  21   21  #include <sys/user.h>
  22   22  #include <sys/uio.h>
  23   23  #include <sys/file.h>
↓ open down ↓ 19 lines elided ↑ open up ↑
  43   43  
  44   44  #include "vncache.h"
  45   45  
  46   46  #define VFTBITS(feature)        ((feature) & 0xFFFFFFFFLL)
  47   47  
  48   48  static uint64_t vfs_features = VFSFT_XVATTR;
  49   49  
  50   50  vnode_t *rootdir = NULL;        /* pointer to root inode vnode. */
  51   51  
  52   52  static struct vfs fake_rootvfs;
       53 +static struct vfsops fake_vfsops;
  53   54  struct vfs *rootvfs = NULL;
       55 +static struct vfssw fake_vfssw = {
       56 +        .vsw_name = "fake"      /* see smb_tree.c:smb_mtype[] */
       57 +};
  54   58  
  55   59  int
  56   60  fksmbsrv_vfs_init(void)
  57   61  {
  58   62          struct stat st;
  59   63          int err, fd;
  60   64          vnode_t *vp;
  61   65          char *name = "/";
  62   66  
  63   67          if (rootvfs == NULL) {
  64   68                  rootvfs = &fake_rootvfs;
  65   69                  rootvfs->vfs_mntpt = refstr_alloc(name);
  66   70                  rootvfs->vfs_fsid.val[0] = 1;
       71 +                rootvfs->vfs_op = &fake_vfsops;
  67   72          }
  68   73  
  69   74          if (rootdir == NULL) {
  70   75                  if (lstat(name, &st) == -1)
  71   76                          return (errno);
  72   77                  fd = open(name, O_RDONLY, 0);
  73   78                  if (fd < 0) {
  74   79                          return (errno);
  75   80                  }
  76   81                  if (fstat(fd, &st) == -1) {
↓ open down ↓ 42 lines elided ↑ open up ↑
 119  124  vfsops_t *
 120  125  vfs_getops(vfs_t *vfsp)
 121  126  {
 122  127          return (vfsp->vfs_op);
 123  128  }
 124  129  
 125  130  /* ARGSUSED */
 126  131  struct vfssw *
 127  132  vfs_getvfsswbyvfsops(vfsops_t *vfsops)
 128  133  {
      134 +        if (vfsops == &fake_vfsops)
      135 +                return (&fake_vfssw);
 129  136          return (NULL);
 130  137  }
 131  138  
 132  139  /* ARGSUSED */
 133  140  void
 134  141  vfs_unrefvfssw(struct vfssw *vswp)
 135  142  {
 136  143  }
 137  144  
 138  145  /* ARGSUSED */
↓ open down ↓ 106 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX