Print this page
7938 Port ZOL #3712 disable LBA weighting on files and SSDs


  42 {
  43         ASSERT(vd->vdev_path != NULL);
  44 }
  45 
  46 static void
  47 vdev_file_rele(vdev_t *vd)
  48 {
  49         ASSERT(vd->vdev_path != NULL);
  50 }
  51 
  52 static int
  53 vdev_file_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize,
  54     uint64_t *ashift)
  55 {
  56         vdev_file_t *vf;
  57         vnode_t *vp;
  58         vattr_t vattr;
  59         int error;
  60 
  61         /*





  62          * We must have a pathname, and it must be absolute.
  63          */
  64         if (vd->vdev_path == NULL || vd->vdev_path[0] != '/') {
  65                 vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL;
  66                 return (SET_ERROR(EINVAL));
  67         }
  68 
  69         /*
  70          * Reopen the device if it's not currently open.  Otherwise,
  71          * just update the physical size of the device.
  72          */
  73         if (vd->vdev_tsd != NULL) {
  74                 ASSERT(vd->vdev_reopening);
  75                 vf = vd->vdev_tsd;
  76                 goto skip_open;
  77         }
  78 
  79         vf = vd->vdev_tsd = kmem_zalloc(sizeof (vdev_file_t), KM_SLEEP);
  80 
  81         /*




  42 {
  43         ASSERT(vd->vdev_path != NULL);
  44 }
  45 
  46 static void
  47 vdev_file_rele(vdev_t *vd)
  48 {
  49         ASSERT(vd->vdev_path != NULL);
  50 }
  51 
  52 static int
  53 vdev_file_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize,
  54     uint64_t *ashift)
  55 {
  56         vdev_file_t *vf;
  57         vnode_t *vp;
  58         vattr_t vattr;
  59         int error;
  60 
  61         /*
  62          * Rotational optimizations only make sense on block devices
  63          */
  64         vd->vdev_nonrot = B_TRUE;
  65 
  66         /*
  67          * We must have a pathname, and it must be absolute.
  68          */
  69         if (vd->vdev_path == NULL || vd->vdev_path[0] != '/') {
  70                 vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL;
  71                 return (SET_ERROR(EINVAL));
  72         }
  73 
  74         /*
  75          * Reopen the device if it's not currently open.  Otherwise,
  76          * just update the physical size of the device.
  77          */
  78         if (vd->vdev_tsd != NULL) {
  79                 ASSERT(vd->vdev_reopening);
  80                 vf = vd->vdev_tsd;
  81                 goto skip_open;
  82         }
  83 
  84         vf = vd->vdev_tsd = kmem_zalloc(sizeof (vdev_file_t), KM_SLEEP);
  85 
  86         /*