Print this page
patch tsoome-feedback


3622                 kmem_free((void *)(uintptr_t)zc->zc_nvlist_dst, size);
3623                 size = newsize;
3624                 goto again;
3625         } else if (rc != 0) {
3626                 goto out;
3627         }
3628         rc = nvlist_unpack((char *)(uintptr_t)zc->zc_nvlist_dst,
3629             zc->zc_nvlist_dst_size, &nv, 0);
3630         ASSERT(rc == 0);        /* nvlist_unpack should not fail */
3631         if ((rc = nvlist_lookup_nvlist(nv, "stmf_sbd_lu", &nv2)) == 0) {
3632                 rc = nvlist_lookup_string(nv2, ZPROP_VALUE, &ptr);
3633                 if (rc != 0) {
3634                         cmn_err(CE_WARN, "couldn't get value");
3635                 } else {
3636                         *comstarprop = kmem_alloc(strlen(ptr) + 1,
3637                             KM_SLEEP);
3638                         (void) strcpy(*comstarprop, ptr);
3639                 }
3640         }
3641 out:
3642         if (nv != NULL)
3643                 nvlist_free(nv);
3644         kmem_free((void *)(uintptr_t)zc->zc_nvlist_dst, size);
3645         kmem_free(zc, sizeof (zfs_cmd_t));
3646         (void) ldi_close(zfs_lh, FREAD|FWRITE, kcred);
3647 
3648         return (rc);
3649 }
3650 
3651 int
3652 sbd_zvolset(char *zvol_name, char *comstarprop)
3653 {
3654         ldi_handle_t    zfs_lh;
3655         nvlist_t        *nv;
3656         char            *packed = NULL;
3657         size_t          len;
3658         zfs_cmd_t       *zc;
3659         int unused;
3660         int rc;
3661 
3662         if ((rc = ldi_open_by_name("/dev/zfs", FREAD | FWRITE, kcred,




3622                 kmem_free((void *)(uintptr_t)zc->zc_nvlist_dst, size);
3623                 size = newsize;
3624                 goto again;
3625         } else if (rc != 0) {
3626                 goto out;
3627         }
3628         rc = nvlist_unpack((char *)(uintptr_t)zc->zc_nvlist_dst,
3629             zc->zc_nvlist_dst_size, &nv, 0);
3630         ASSERT(rc == 0);        /* nvlist_unpack should not fail */
3631         if ((rc = nvlist_lookup_nvlist(nv, "stmf_sbd_lu", &nv2)) == 0) {
3632                 rc = nvlist_lookup_string(nv2, ZPROP_VALUE, &ptr);
3633                 if (rc != 0) {
3634                         cmn_err(CE_WARN, "couldn't get value");
3635                 } else {
3636                         *comstarprop = kmem_alloc(strlen(ptr) + 1,
3637                             KM_SLEEP);
3638                         (void) strcpy(*comstarprop, ptr);
3639                 }
3640         }
3641 out:

3642         nvlist_free(nv);
3643         kmem_free((void *)(uintptr_t)zc->zc_nvlist_dst, size);
3644         kmem_free(zc, sizeof (zfs_cmd_t));
3645         (void) ldi_close(zfs_lh, FREAD|FWRITE, kcred);
3646 
3647         return (rc);
3648 }
3649 
3650 int
3651 sbd_zvolset(char *zvol_name, char *comstarprop)
3652 {
3653         ldi_handle_t    zfs_lh;
3654         nvlist_t        *nv;
3655         char            *packed = NULL;
3656         size_t          len;
3657         zfs_cmd_t       *zc;
3658         int unused;
3659         int rc;
3660 
3661         if ((rc = ldi_open_by_name("/dev/zfs", FREAD | FWRITE, kcred,