From: Matthew Macy Date: Fri, 11 Oct 2019 17:06:18 +0000 (-0700) Subject: Expose dmu_buf_hold_array_by_dnode to platform code X-Git-Tag: zfs-2.0.0~937 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=af1698f59b79eff7e96332518512069ce5824b31;p=mirror_zfs.git Expose dmu_buf_hold_array_by_dnode to platform code FreeBSD uses this in its pager ops routines Reviewed-by: Brian Behlendorf Reviewed-by: Ryan Moeller Signed-off-by: Matt Macy Closes #9431 --- diff --git a/include/sys/dmu.h b/include/sys/dmu.h index 236b90141..33a7667df 100644 --- a/include/sys/dmu.h +++ b/include/sys/dmu.h @@ -564,7 +564,9 @@ int dmu_buf_hold(objset_t *os, uint64_t object, uint64_t offset, void *tag, dmu_buf_t **, int flags); 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, + uint64_t length, boolean_t read, void *tag, int *numbufsp, + dmu_buf_t ***dbpp, uint32_t flags); /* * Add a reference to a dmu buffer that has already been held via * dmu_buf_hold() in the current context. diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index 895cac58e..78c673433 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -489,7 +489,7 @@ dmu_spill_hold_by_bonus(dmu_buf_t *bonus, uint32_t flags, void *tag, * and can induce severe lock contention when writing to several files * whose dnodes are in the same block. */ -static int +int dmu_buf_hold_array_by_dnode(dnode_t *dn, uint64_t offset, uint64_t length, boolean_t read, void *tag, int *numbufsp, dmu_buf_t ***dbpp, uint32_t flags) {