From afbc61792116c9599afcccfd61204f968401d06e Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Wed, 13 Oct 2021 11:01:01 -0700 Subject: [PATCH] Remove FreeBSD's local copy of the dmu_buf_hold_array() function Make the main dmu_buf_hold_array() function non-static. Reviewed-by: Brian Behlendorf Reviewed-by: Ryan Moeller Signed-off-by: Pawel Jakub Dawidek Closes #12628 --- include/sys/dmu.h | 2 ++ module/os/freebsd/zfs/dmu_os.c | 19 ------------------- module/zfs/dmu.c | 2 +- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/include/sys/dmu.h b/include/sys/dmu.h index 10e29a45c8..942ab9b108 100644 --- a/include/sys/dmu.h +++ b/include/sys/dmu.h @@ -559,6 +559,8 @@ int dmu_spill_hold_existing(dmu_buf_t *bonus, void *tag, dmu_buf_t **dbp); */ int dmu_buf_hold(objset_t *os, uint64_t object, uint64_t offset, void *tag, dmu_buf_t **, int flags); +int dmu_buf_hold_array(objset_t *os, uint64_t object, uint64_t offset, + uint64_t length, int read, void *tag, int *numbufsp, dmu_buf_t ***dbpp); int dmu_buf_hold_by_dnode(dnode_t *dn, uint64_t offset, void *tag, dmu_buf_t **dbp, int flags); int dmu_buf_hold_array_by_dnode(dnode_t *dn, uint64_t offset, diff --git a/module/os/freebsd/zfs/dmu_os.c b/module/os/freebsd/zfs/dmu_os.c index 2cf54a3cef..38488dbda6 100644 --- a/module/os/freebsd/zfs/dmu_os.c +++ b/module/os/freebsd/zfs/dmu_os.c @@ -78,25 +78,6 @@ __FBSDID("$FreeBSD$"); #define dmu_page_unlock(m) #endif -static int -dmu_buf_hold_array(objset_t *os, uint64_t object, uint64_t offset, - uint64_t length, int read, void *tag, int *numbufsp, dmu_buf_t ***dbpp) -{ - dnode_t *dn; - int err; - - err = dnode_hold(os, object, FTAG, &dn); - if (err) - return (err); - - err = dmu_buf_hold_array_by_dnode(dn, offset, length, read, tag, - numbufsp, dbpp, DMU_READ_PREFETCH); - - dnode_rele(dn, FTAG); - - return (err); -} - int dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, vm_page_t *ma, dmu_tx_t *tx) diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index de6bd58abc..b29d82fd79 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -613,7 +613,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, uint64_t offset, uint64_t length, return (0); } -static int +int dmu_buf_hold_array(objset_t *os, uint64_t object, uint64_t offset, uint64_t length, int read, void *tag, int *numbufsp, dmu_buf_t ***dbpp) {