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


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





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




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