From d5a5ec46934c00d1c2e59ece2a32aad1ba9c982e Mon Sep 17 00:00:00 2001 From: Fedor Uporov <60701163+fuporovvStack@users.noreply.github.com> Date: Tue, 26 Oct 2021 17:07:53 -0700 Subject: [PATCH] Remove unused function zvol_set_volblocksize() Reviewed-by: Brian Behlendorf Reviewed-by: George Melikov Signed-off-by: Fedor Uporov Closes #12688 --- include/sys/zvol.h | 1 - module/zfs/zvol.c | 45 --------------------------------------------- 2 files changed, 46 deletions(-) diff --git a/include/sys/zvol.h b/include/sys/zvol.h index 8efb7f5e6..a0f180013 100644 --- a/include/sys/zvol.h +++ b/include/sys/zvol.h @@ -50,7 +50,6 @@ extern int zvol_get_stats(objset_t *, nvlist_t *); extern boolean_t zvol_is_zvol(const char *); extern void zvol_create_cb(objset_t *, void *, cred_t *, dmu_tx_t *); extern int zvol_set_volsize(const char *, uint64_t); -extern int zvol_set_volblocksize(const char *, uint64_t); extern int zvol_set_snapdev(const char *, zprop_source_t, uint64_t); extern int zvol_set_volmode(const char *, zprop_source_t, uint64_t); extern zvol_state_handle_t *zvol_suspend(const char *); diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c index 5438e8f92..d50cce7d7 100644 --- a/module/zfs/zvol.c +++ b/module/zfs/zvol.c @@ -407,51 +407,6 @@ zvol_check_volblocksize(const char *name, uint64_t volblocksize) return (0); } -/* - * Set ZFS_PROP_VOLBLOCKSIZE set entry point. - */ -int -zvol_set_volblocksize(const char *name, uint64_t volblocksize) -{ - zvol_state_t *zv; - dmu_tx_t *tx; - int error; - - zv = zvol_find_by_name(name, RW_READER); - - if (zv == NULL) - return (SET_ERROR(ENXIO)); - - ASSERT(MUTEX_HELD(&zv->zv_state_lock)); - ASSERT(RW_READ_HELD(&zv->zv_suspend_lock)); - - if (zv->zv_flags & ZVOL_RDONLY) { - mutex_exit(&zv->zv_state_lock); - rw_exit(&zv->zv_suspend_lock); - return (SET_ERROR(EROFS)); - } - - tx = dmu_tx_create(zv->zv_objset); - dmu_tx_hold_bonus(tx, ZVOL_OBJ); - error = dmu_tx_assign(tx, TXG_WAIT); - if (error) { - dmu_tx_abort(tx); - } else { - error = dmu_object_set_blocksize(zv->zv_objset, ZVOL_OBJ, - volblocksize, 0, tx); - if (error == ENOTSUP) - error = SET_ERROR(EBUSY); - dmu_tx_commit(tx); - if (error == 0) - zv->zv_volblocksize = volblocksize; - } - - mutex_exit(&zv->zv_state_lock); - rw_exit(&zv->zv_suspend_lock); - - return (SET_ERROR(error)); -} - /* * Replay a TX_TRUNCATE ZIL transaction if asked. TX_TRUNCATE is how we * implement DKIOCFREE/free-long-range.