mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +03:00
Provide more flexible object allocation interface
Object allocation performance can be improved for complex operations by providing an interface which returns the newly allocated dnode. This allows the caller to immediately use the dnode without incurring the expense of looking up the dnode by object number. The functions dmu_object_alloc_hold(), zap_create_hold(), and dmu_bonus_hold_by_dnode() were added for this purpose. The zap_create_* functions have been updated to take advantage of this new functionality. The dmu_bonus_hold_impl() function should really have never been included in sys/dmu.h and was removed. It's sole caller was converted to use dmu_bonus_hold_by_dnode(). The new symbols have been exported for use by Lustre. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed by: Matt Ahrens <mahrens@delphix.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #8015
This commit is contained in:
+7
-2
@@ -131,6 +131,11 @@ uint64_t zap_create_flags_dnsize(objset_t *os, int normflags,
|
||||
zap_flags_t flags, dmu_object_type_t ot, int leaf_blockshift,
|
||||
int indirect_blockshift, dmu_object_type_t bonustype, int bonuslen,
|
||||
int dnodesize, dmu_tx_t *tx);
|
||||
uint64_t zap_create_hold(objset_t *os, int normflags, zap_flags_t flags,
|
||||
dmu_object_type_t ot, int leaf_blockshift, int indirect_blockshift,
|
||||
dmu_object_type_t bonustype, int bonuslen, int dnodesize,
|
||||
dnode_t **allocated_dnode, void *tag, dmu_tx_t *tx);
|
||||
|
||||
uint64_t zap_create_link(objset_t *os, dmu_object_type_t ot,
|
||||
uint64_t parent_obj, const char *name, dmu_tx_t *tx);
|
||||
uint64_t zap_create_link_dnsize(objset_t *os, dmu_object_type_t ot,
|
||||
@@ -139,8 +144,8 @@ uint64_t zap_create_link_dnsize(objset_t *os, dmu_object_type_t ot,
|
||||
/*
|
||||
* Initialize an already-allocated object.
|
||||
*/
|
||||
void mzap_create_impl(objset_t *os, uint64_t obj, int normflags,
|
||||
zap_flags_t flags, dmu_tx_t *tx);
|
||||
void mzap_create_impl(dnode_t *dn, int normflags, zap_flags_t flags,
|
||||
dmu_tx_t *tx);
|
||||
|
||||
/*
|
||||
* Create a new zapobj with no attributes from the given (unallocated)
|
||||
|
||||
Reference in New Issue
Block a user