Print this page
NEX-16783 Panic in smbfs_delmap_callback (fix leak)
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Dan Fields <dan.fields@nexenta.com>
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>


  77 
  78 /* Mask values for smbmount structure sm_status field */
  79 #define SM_STATUS_STATFS_BUSY 0x00000001 /* statvfs is in progress */
  80 #define SM_STATUS_STATFS_WANT 0x00000002 /* statvfs wakeup is wanted */
  81 #define SM_STATUS_TIMEO 0x00000004 /* this mount is not responding */
  82 #define SM_STATUS_DEAD  0x00000010 /* connection gone - unmount this */
  83 
  84 extern const struct fs_operation_def    smbfs_vnodeops_template[];
  85 extern struct vnodeops                  *smbfs_vnodeops;
  86 
  87 struct smbnode;
  88 struct smb_share;
  89 
  90 /*
  91  * The values for smi_flags (from nfs_clnt.h)
  92  */
  93 #define SMI_INT         0x04            /* interrupts allowed */
  94 #define SMI_NOAC        0x10            /* don't cache attributes */
  95 #define SMI_LLOCK       0x80            /* local locking only */
  96 #define SMI_ACL         0x2000          /* share supports ACLs */

  97 #define SMI_EXTATTR     0x80000         /* share supports ext. attrs */
  98 #define SMI_DEAD        0x200000        /* mount has been terminated */
  99 
 100 /*
 101  * Stuff returned by smbfs_smb_qfsattr
 102  * See [CIFS] SMB_QUERY_FS_ATTRIBUTE_INFO
 103  */
 104 typedef struct smb_fs_attr_info {
 105         uint32_t        fsa_aflags;     /* Attr. flags [CIFS 4.1.6.6] */
 106         uint32_t        fsa_maxname;    /* max. component length */
 107         char            fsa_tname[FSTYPSZ]; /* type name, i.e. "NTFS" */
 108 } smb_fs_attr_info_t;
 109 
 110 /*
 111  * Corresponds to Darwin: struct smbmount
 112  */
 113 typedef struct smbmntinfo {
 114         struct vfs              *smi_vfsp;      /* mount back pointer to vfs */
 115         struct smbnode          *smi_root;      /* the root node */
 116         struct smb_share        *smi_share;     /* netsmb SMB share conn data */

 117         kmutex_t                smi_lock;       /* mutex for flags, etc. */
 118         uint32_t                smi_flags;      /* NFS-derived flag bits */
 119         uint32_t                smi_status;     /* status bits for this mount */
 120         hrtime_t                smi_statfstime; /* sm_statvfsbuf cache time */
 121         statvfs64_t             smi_statvfsbuf; /* cached statvfs data */
 122         kcondvar_t              smi_statvfs_cv;
 123         smb_fs_attr_info_t      smi_fsa;        /* SMB FS attributes. */
 124 #define smi_fsattr              smi_fsa.fsa_aflags
 125 
 126         /*
 127          * The smbfs node cache for this mount.
 128          * Named "hash" for historical reasons.
 129          * See smbfs_node.h for details.
 130          */
 131         avl_tree_t              smi_hash_avl;
 132         krwlock_t               smi_hash_lk;
 133 
 134         /*
 135          * Kstat statistics
 136          */




  77 
  78 /* Mask values for smbmount structure sm_status field */
  79 #define SM_STATUS_STATFS_BUSY 0x00000001 /* statvfs is in progress */
  80 #define SM_STATUS_STATFS_WANT 0x00000002 /* statvfs wakeup is wanted */
  81 #define SM_STATUS_TIMEO 0x00000004 /* this mount is not responding */
  82 #define SM_STATUS_DEAD  0x00000010 /* connection gone - unmount this */
  83 
  84 extern const struct fs_operation_def    smbfs_vnodeops_template[];
  85 extern struct vnodeops                  *smbfs_vnodeops;
  86 
  87 struct smbnode;
  88 struct smb_share;
  89 
  90 /*
  91  * The values for smi_flags (from nfs_clnt.h)
  92  */
  93 #define SMI_INT         0x04            /* interrupts allowed */
  94 #define SMI_NOAC        0x10            /* don't cache attributes */
  95 #define SMI_LLOCK       0x80            /* local locking only */
  96 #define SMI_ACL         0x2000          /* share supports ACLs */
  97 #define SMI_DIRECTIO    0x40000         /* do direct I/O */
  98 #define SMI_EXTATTR     0x80000         /* share supports ext. attrs */
  99 #define SMI_DEAD        0x200000        /* mount has been terminated */
 100 
 101 /*
 102  * Stuff returned by smbfs_smb_qfsattr
 103  * See [CIFS] SMB_QUERY_FS_ATTRIBUTE_INFO
 104  */
 105 typedef struct smb_fs_attr_info {
 106         uint32_t        fsa_aflags;     /* Attr. flags [CIFS 4.1.6.6] */
 107         uint32_t        fsa_maxname;    /* max. component length */
 108         char            fsa_tname[FSTYPSZ]; /* type name, i.e. "NTFS" */
 109 } smb_fs_attr_info_t;
 110 
 111 /*
 112  * Corresponds to Darwin: struct smbmount
 113  */
 114 typedef struct smbmntinfo {
 115         struct vfs              *smi_vfsp;      /* mount back pointer to vfs */
 116         struct smbnode          *smi_root;      /* the root node */
 117         struct smb_share        *smi_share;     /* netsmb SMB share conn data */
 118         struct taskq            *smi_taskq;     /* for async work */
 119         kmutex_t                smi_lock;       /* mutex for flags, etc. */
 120         uint32_t                smi_flags;      /* NFS-derived flag bits */
 121         uint32_t                smi_status;     /* status bits for this mount */
 122         hrtime_t                smi_statfstime; /* sm_statvfsbuf cache time */
 123         statvfs64_t             smi_statvfsbuf; /* cached statvfs data */
 124         kcondvar_t              smi_statvfs_cv;
 125         smb_fs_attr_info_t      smi_fsa;        /* SMB FS attributes. */
 126 #define smi_fsattr              smi_fsa.fsa_aflags
 127 
 128         /*
 129          * The smbfs node cache for this mount.
 130          * Named "hash" for historical reasons.
 131          * See smbfs_node.h for details.
 132          */
 133         avl_tree_t              smi_hash_avl;
 134         krwlock_t               smi_hash_lk;
 135 
 136         /*
 137          * Kstat statistics
 138          */