Print this page
    
1845 allow disable of UNMAP via stmfadm(1M).
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/uts/common/sys/stmf_sbd_ioctl.h
          +++ new/usr/src/uts/common/sys/stmf_sbd_ioctl.h
   1    1  /*
   2    2   * CDDL HEADER START
   3    3   *
   4    4   * The contents of this file are subject to the terms of the
   5    5   * Common Development and Distribution License (the "License").
   6    6   * You may not use this file except in compliance with the License.
   7    7   *
   8    8   * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9   * or http://www.opensolaris.org/os/licensing.
  10   10   * See the License for the specific language governing permissions
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   *
  25   25   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  26   26   */
  27   27  
  28   28  #ifndef _STMF_SBD_IOCTL_H
  29   29  #define _STMF_SBD_IOCTL_H
  30   30  
  31   31  #ifdef  __cplusplus
  32   32  extern "C" {
  33   33  #endif
  34   34  
  35   35  /*
  36   36   * error codes from sbd.
  37   37   */
  38   38  typedef enum sbd_ret {
  39   39          SBD_RET_META_CREATION_FAILED = 0x01,
  40   40          SBD_RET_INVALID_BLKSIZE,
  41   41          SBD_RET_REQUIRES_SEPARATE_META,
  42   42          SBD_RET_FILE_ALREADY_REGISTERED,
  43   43          SBD_RET_GUID_ALREADY_REGISTERED,
  44   44          SBD_RET_DATA_PATH_NOT_ABSOLUTE,
  45   45          SBD_RET_META_PATH_NOT_ABSOLUTE,
  46   46          SBD_RET_META_FILE_LOOKUP_FAILED,
  47   47          SBD_RET_ZFS_META_CREATE_FAILED,
  48   48          SBD_ZVOL_META_NAME_MISMATCH,
  49   49          SBD_RET_DATA_FILE_LOOKUP_FAILED,
  50   50          SBD_RET_WRONG_META_FILE_TYPE,
  51   51          SBD_RET_WRONG_DATA_FILE_TYPE,
  52   52          SBD_RET_DATA_FILE_OPEN_FAILED,
  53   53          SBD_RET_META_FILE_OPEN_FAILED,
  54   54          SBD_RET_DATA_FILE_GETATTR_FAILED,
  55   55          SBD_RET_META_FILE_GETATTR_FAILED,
  56   56          SBD_RET_FILE_SIZE_ERROR,
  
    | 
      ↓ open down ↓ | 
    56 lines elided | 
    
      ↑ open up ↑ | 
  
  57   57          SBD_RET_FILE_ALIGN_ERROR,
  58   58          SBD_RET_SIZE_OUT_OF_RANGE,
  59   59          SBD_RET_SIZE_NOT_SUPPORTED_BY_FS,
  60   60          SBD_RET_NO_META,
  61   61          SBD_RET_VERSION_NOT_SUPPORTED,
  62   62          SBD_RET_LU_BUSY,
  63   63          SBD_RET_NOT_FOUND,
  64   64          SBD_RET_INSUFFICIENT_BUF_SPACE,
  65   65          SBD_RET_WRITE_CACHE_SET_FAILED,
  66   66          SBD_RET_ACCESS_STATE_FAILED,
       67 +        SBD_RET_UNMAP_SET_FAILED,
  67   68  
  68   69          SBD_RET_MAX_VAL
  69   70  } sbd_ret_t;
  70   71  
  71   72  #define SBD_IOCTL_DEF(n)        ((((int)0x5B) << 16) | (n))
  72   73  #define SBD_IOCTL_CREATE_AND_REGISTER_LU                SBD_IOCTL_DEF(1)
  73   74  #define SBD_IOCTL_IMPORT_LU                             SBD_IOCTL_DEF(2)
  74   75  #define SBD_IOCTL_DELETE_LU                             SBD_IOCTL_DEF(3)
  75   76  #define SBD_IOCTL_MODIFY_LU                             SBD_IOCTL_DEF(4)
  76   77  #define SBD_IOCTL_GET_LU_PROPS                          SBD_IOCTL_DEF(5)
  77   78  #define SBD_IOCTL_GET_LU_LIST                           SBD_IOCTL_DEF(6)
  78   79  #define SBD_IOCTL_SET_LU_STANDBY                        SBD_IOCTL_DEF(7)
  79   80  #define SBD_IOCTL_SET_GLOBAL_LU                         SBD_IOCTL_DEF(8)
  80   81  #define SBD_IOCTL_GET_GLOBAL_LU                         SBD_IOCTL_DEF(9)
  81   82  #define SBD_IOCTL_GET_UNMAP_PROPS                       SBD_IOCTL_DEF(10)
  82   83  
  83   84  typedef struct sbd_create_and_reg_lu {
  84   85          uint32_t        slu_struct_size;
  85      -        uint16_t        slu_meta_fname_valid:1,
       86 +        uint32_t        slu_meta_fname_valid:1,
  86   87                          slu_lu_size_valid:1,
  87   88                          slu_blksize_valid:1,
  88   89                          slu_vid_valid:1,
  89   90                          slu_pid_valid:1,
  90   91                          slu_rev_valid:1,
  91   92                          slu_serial_valid:1,
  92   93                          slu_alias_valid:1,
  93   94                          slu_mgmt_url_valid:1,
  94   95                          slu_guid_valid:1,
  95   96                          slu_company_id_valid:1,
  96   97                          slu_host_id_valid:1,
  97   98                          slu_writeback_cache_disable_valid:1,
  98   99                          slu_writeback_cache_disable:1,
  99      -                        slu_write_protected:1;
      100 +                        slu_write_protected:1,
      101 +                        slu_unmap_valid:1,
      102 +                        slu_unmap:1;
      103 +        uint32_t        slu_pad1;       /* To preserve 64-bit alignment */
      104 +        uint16_t        slu_pad2;       /* for the following fields. */
 100  105          uint16_t        slu_meta_fname_off;
 101  106          uint64_t        slu_lu_size;
 102  107          uint16_t        slu_data_fname_off;
 103  108          uint16_t        slu_serial_off;
 104  109          uint8_t         slu_serial_size;
 105  110          uint8_t         slu_ret_filesize_nbits;
 106  111          uint16_t        slu_blksize;
 107  112          uint32_t        slu_company_id;
 108  113          uint16_t        slu_alias_off;
 109  114          uint16_t        slu_mgmt_url_off;
 110  115          uint32_t        slu_host_id;
 111  116          char            slu_rev[4];
 112  117          char            slu_vid[8];
 113  118          char            slu_pid[16];
 114  119          uint8_t         slu_guid[16];
 115  120          char            slu_buf[8];     /* likely more than 8 */
 116  121  } sbd_create_and_reg_lu_t;
 117  122  
 118  123  typedef struct sbd_global_props {
 119  124          uint32_t        mlu_struct_size;
 120  125          uint32_t        mlu_vid_valid:1,
 121  126                          mlu_pid_valid:1,
 122  127                          mlu_rev_valid:1,
 123  128                          mlu_serial_valid:1,
 124  129                          mlu_mgmt_url_valid:1,
 125  130                          mlu_company_id_valid:1,
 126  131                          mlu_host_id_valid:1;
 127  132          uint16_t        mlu_serial_off;
 128  133          uint8_t         mlu_serial_size;
 129  134          uint8_t         mlu_rsvd1;
 130  135          uint32_t        mlu_company_id;
 131  136          uint16_t        mlu_mgmt_url_off;
 132  137          uint16_t        rsvd1;
 133  138          uint32_t        mlu_host_id;
 134  139          uint32_t        mlu_buf_size_needed;
 135  140          char            mlu_rev[4];
 136  141          char            mlu_vid[8];
 137  142          char            mlu_pid[16];
 138  143          char            mlu_buf[8];     /* likely more than 8 */
 139  144  } sbd_global_props_t;
 140  145  
 141  146  typedef struct sbd_set_lu_standby {
 142  147          uint8_t         stlu_guid[16];
 143  148  } sbd_set_lu_standby_t;
 144  149  
 145  150  
 146  151  typedef struct sbd_import_lu {
 147  152          uint32_t        ilu_struct_size;
 148  153          uint32_t        ilu_rsvd;
 149  154          uint8_t         ilu_ret_guid[16];
 150  155          char            ilu_meta_fname[8]; /* Can be more than 8 */
 151  156  } sbd_import_lu_t;
 152  157  
 153  158  typedef struct sbd_modify_lu {
 154  159          uint32_t        mlu_struct_size;
 155  160          uint32_t        mlu_lu_size_valid:1,
  
    | 
      ↓ open down ↓ | 
    46 lines elided | 
    
      ↑ open up ↑ | 
  
 156  161                          mlu_serial_valid:1,
 157  162                          mlu_alias_valid:1,
 158  163                          mlu_mgmt_url_valid:1,
 159  164                          mlu_writeback_cache_disable_valid:1,
 160  165                          mlu_writeback_cache_disable:1,
 161  166                          mlu_write_protected_valid:1,
 162  167                          mlu_write_protected:1,
 163  168                          mlu_by_guid:1,
 164  169                          mlu_by_fname:1,
 165  170                          mlu_standby_valid:1,
 166      -                        mlu_standby:1;
      171 +                        mlu_standby:1,
      172 +                        mlu_unmap_valid:1,
      173 +                        mlu_unmap:1;
 167  174          uint64_t        mlu_lu_size;
 168  175          uint16_t        mlu_alias_off;
 169  176          uint16_t        mlu_mgmt_url_off;
 170  177          uint16_t        mlu_serial_off;
 171  178          uint16_t        mlu_serial_size;
 172  179          uint16_t        mlu_fname_off;
 173  180          uint16_t        mlu_rsvd1;
 174  181          uint32_t        mlu_rsvd2;
 175  182          uint8_t         mlu_input_guid[16];
 176  183          char            mlu_buf[8]; /* can be more than 8 */
 177  184  } sbd_modify_lu_t;
 178  185  
 179  186  typedef struct sbd_delete_lu {
 180  187          uint32_t        dlu_struct_size;
 181  188          uint16_t        dlu_by_guid:1,
 182  189                          dlu_by_meta_name:1;
 183  190          uint16_t        dlu_rsvd;
 184  191          uint8_t         dlu_guid[16];
 185  192          uint8_t         dlu_meta_name[8];
 186  193  } sbd_delete_lu_t;
 187  194  
 188  195  /*
 189  196   * sbd access states
 190  197   */
 191  198  #define SBD_LU_ACTIVE                   1
 192  199  #define SBD_LU_TRANSITION_TO_ACTIVE     2
 193  200  #define SBD_LU_STANDBY                  3
 194  201  #define SBD_LU_TRANSITION_TO_STANDBY    4
 195  202  
 196  203  typedef struct sbd_lu_props {
 197  204          uint32_t        slp_input_guid:1,       /* GUID or meta filename */
  
    | 
      ↓ open down ↓ | 
    21 lines elided | 
    
      ↑ open up ↑ | 
  
 198  205                          slp_separate_meta:1,
 199  206                          slp_meta_fname_valid:1,
 200  207                          slp_data_fname_valid:1,
 201  208                          slp_zfs_meta:1,
 202  209                          slp_alias_valid:1,
 203  210                          slp_mgmt_url_valid:1,
 204  211                          slp_lu_vid:1,
 205  212                          slp_lu_pid:1,
 206  213                          slp_lu_rev:1,
 207  214                          slp_serial_valid:1,
      215 +                        slp_unmap_cur:1,
      216 +                        slp_unmap_saved:1,
 208  217                          slp_writeback_cache_disable_cur:1,
 209  218                          slp_writeback_cache_disable_saved:1,
 210  219                          slp_write_protected:1;
 211  220          uint16_t        slp_meta_fname_off;
 212  221          uint16_t        slp_data_fname_off;
 213  222          uint64_t        slp_lu_size;
 214  223          uint16_t        slp_serial_off;
 215  224          uint16_t        slp_blksize;
 216  225          uint16_t        slp_alias_off;
 217  226          uint16_t        slp_mgmt_url_off;
 218  227          uint32_t        slp_buf_size_needed;    /* Upon return */
 219  228          uint16_t        slp_serial_size;
 220  229          uint16_t        slp_access_state;
 221  230          char            slp_rev[4];
 222  231          char            slp_vid[8];
 223  232          char            slp_pid[16];
 224  233          uint8_t         slp_guid[16];
 225  234          uint8_t         slp_buf[8];     /* likely more than 8 */
 226  235  } sbd_lu_props_t;
 227  236  
 228  237  typedef struct sbd_unmap_props {
 229  238          uint32_t        sup_found_lu:1,
 230  239                          sup_zvol_path_valid:1,
 231  240                          sup_guid_valid:1,
 232  241                          sup_unmap_enabled;
 233  242          uint32_t        sup_rsvd;
 234  243          char            sup_zvol_path[256];
 235  244          uint8_t         sup_guid[16];
 236  245  } sbd_unmap_props_t;
 237  246  
 238  247  #ifdef  __cplusplus
 239  248  }
 240  249  #endif
 241  250  
 242  251  #endif /* _STMF_SBD_IOCTL_H */
  
    | 
      ↓ open down ↓ | 
    25 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX