zio: remove zio_ioctl()
It only had one user, zio_flush(), and there are no other vdev ioctls anyway. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Rob Norris <rob.norris@klarasystems.com> Closes #16064
This commit is contained in:
parent
a100a195fa
commit
cac416f106
|
@ -27,7 +27,7 @@
|
||||||
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
|
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
|
||||||
* Copyright 2016 Toomas Soome <tsoome@me.com>
|
* Copyright 2016 Toomas Soome <tsoome@me.com>
|
||||||
* Copyright (c) 2019, Allan Jude
|
* Copyright (c) 2019, Allan Jude
|
||||||
* Copyright (c) 2019, Klara Inc.
|
* Copyright (c) 2019, 2023, 2024, Klara Inc.
|
||||||
* Copyright (c) 2019-2020, Michael Niewöhner
|
* Copyright (c) 2019-2020, Michael Niewöhner
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -579,9 +579,6 @@ extern zio_t *zio_claim(zio_t *pio, spa_t *spa, uint64_t txg,
|
||||||
const blkptr_t *bp,
|
const blkptr_t *bp,
|
||||||
zio_done_func_t *done, void *priv, zio_flag_t flags);
|
zio_done_func_t *done, void *priv, zio_flag_t flags);
|
||||||
|
|
||||||
extern zio_t *zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd,
|
|
||||||
zio_done_func_t *done, void *priv, zio_flag_t flags);
|
|
||||||
|
|
||||||
extern zio_t *zio_trim(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size,
|
extern zio_t *zio_trim(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size,
|
||||||
zio_done_func_t *done, void *priv, zio_priority_t priority,
|
zio_done_func_t *done, void *priv, zio_priority_t priority,
|
||||||
zio_flag_t flags, enum trim_flag trim_flags);
|
zio_flag_t flags, enum trim_flag trim_flags);
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* Copyright (c) 2011, 2022 by Delphix. All rights reserved.
|
* Copyright (c) 2011, 2022 by Delphix. All rights reserved.
|
||||||
* Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
|
* Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2017, Intel Corporation.
|
* Copyright (c) 2017, Intel Corporation.
|
||||||
* Copyright (c) 2019, Klara Inc.
|
* Copyright (c) 2019, 2023, 2024, Klara Inc.
|
||||||
* Copyright (c) 2019, Allan Jude
|
* Copyright (c) 2019, Allan Jude
|
||||||
* Copyright (c) 2021, Datto, Inc.
|
* Copyright (c) 2021, Datto, Inc.
|
||||||
*/
|
*/
|
||||||
|
@ -1449,17 +1449,6 @@ zio_claim(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp,
|
||||||
return (zio);
|
return (zio);
|
||||||
}
|
}
|
||||||
|
|
||||||
zio_t *
|
|
||||||
zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd,
|
|
||||||
zio_done_func_t *done, void *private, zio_flag_t flags)
|
|
||||||
{
|
|
||||||
zio_t *zio = zio_create(pio, spa, 0, NULL, NULL, 0, 0, done, private,
|
|
||||||
ZIO_TYPE_IOCTL, ZIO_PRIORITY_NOW, flags, vd, 0, NULL,
|
|
||||||
ZIO_STAGE_OPEN, ZIO_IOCTL_PIPELINE);
|
|
||||||
zio->io_cmd = cmd;
|
|
||||||
return (zio);
|
|
||||||
}
|
|
||||||
|
|
||||||
zio_t *
|
zio_t *
|
||||||
zio_trim(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size,
|
zio_trim(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size,
|
||||||
zio_done_func_t *done, void *private, zio_priority_t priority,
|
zio_done_func_t *done, void *private, zio_priority_t priority,
|
||||||
|
@ -1626,15 +1615,27 @@ zio_vdev_delegated_io(vdev_t *vd, uint64_t offset, abd_t *data, uint64_t size,
|
||||||
return (zio);
|
return (zio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Send a flush command to the given vdev. Unlike most zio creation functions,
|
||||||
|
* the flush zios are issued immediately. You can wait on pio to pause until
|
||||||
|
* the flushes complete.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
zio_flush(zio_t *pio, vdev_t *vd)
|
zio_flush(zio_t *pio, vdev_t *vd)
|
||||||
{
|
{
|
||||||
|
const zio_flag_t flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE |
|
||||||
|
ZIO_FLAG_DONT_RETRY;
|
||||||
|
|
||||||
if (vd->vdev_nowritecache)
|
if (vd->vdev_nowritecache)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (vd->vdev_children == 0) {
|
if (vd->vdev_children == 0) {
|
||||||
zio_nowait(zio_ioctl(pio, vd->vdev_spa, vd,
|
zio_t *zio = zio_create(pio, vd->vdev_spa, 0, NULL, NULL, 0, 0,
|
||||||
DKIOCFLUSHWRITECACHE, NULL, NULL, ZIO_FLAG_CANFAIL |
|
NULL, NULL, ZIO_TYPE_IOCTL, ZIO_PRIORITY_NOW, flags, vd, 0,
|
||||||
ZIO_FLAG_DONT_PROPAGATE | ZIO_FLAG_DONT_RETRY));
|
NULL, ZIO_STAGE_OPEN, ZIO_IOCTL_PIPELINE);
|
||||||
|
zio->io_cmd = DKIOCFLUSHWRITECACHE;
|
||||||
|
zio_nowait(zio);
|
||||||
} else {
|
} else {
|
||||||
for (uint64_t c = 0; c < vd->vdev_children; c++)
|
for (uint64_t c = 0; c < vd->vdev_children; c++)
|
||||||
zio_flush(pio, vd->vdev_child[c]);
|
zio_flush(pio, vd->vdev_child[c]);
|
||||||
|
|
Loading…
Reference in New Issue