mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
ZVOL: Minor code cleanup
- Remove zsda_tx field, it is used only once. - Remove unneeded string lengths checks, all names are terminated. - Replace few explicit MAXNAMELEN usages with sizeof(). - Change dsname from MAXNAMELEN to ZFS_MAX_DATASET_NAME_LEN, as expected by dsl_dataset_name(). Both are 256 bytes now, but it is better to be safe. This should have no functional difference. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored by: iXsystems, Inc. Closes #15535
This commit is contained in:
@@ -1199,7 +1199,7 @@ zvol_alloc(dev_t dev, const char *name)
|
||||
zso->zvo_queue->queuedata = zv;
|
||||
zso->zvo_dev = dev;
|
||||
zv->zv_open_count = 0;
|
||||
strlcpy(zv->zv_name, name, MAXNAMELEN);
|
||||
strlcpy(zv->zv_name, name, sizeof (zv->zv_name));
|
||||
|
||||
zfs_rangelock_init(&zv->zv_rangelock, NULL, NULL);
|
||||
rw_init(&zv->zv_suspend_lock, NULL, RW_DEFAULT, NULL);
|
||||
|
||||
Reference in New Issue
Block a user