mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Add sa_spill_rele() interface
Add a SA interface which allows us to release the spill block from a SA handle without destroying the handle. This is useful because we can then ensure that a copy of the dirty spill block is not made at sync time due to the extra hold. Susequent calls to sa_update() or sa_lookup() with transparently refetch the spill block dbuf from the ARC hash. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
@@ -1333,6 +1333,19 @@ sa_idx_tab_hold(objset_t *os, sa_idx_tab_t *idx_tab)
|
||||
(void) refcount_add(&idx_tab->sa_refcount, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
sa_spill_rele(sa_handle_t *hdl)
|
||||
{
|
||||
mutex_enter(&hdl->sa_lock);
|
||||
if (hdl->sa_spill) {
|
||||
sa_idx_tab_rele(hdl->sa_os, hdl->sa_spill_tab);
|
||||
dmu_buf_rele(hdl->sa_spill, NULL);
|
||||
hdl->sa_spill = NULL;
|
||||
hdl->sa_spill_tab = NULL;
|
||||
}
|
||||
mutex_exit(&hdl->sa_lock);
|
||||
}
|
||||
|
||||
void
|
||||
sa_handle_destroy(sa_handle_t *hdl)
|
||||
{
|
||||
@@ -1994,6 +2007,7 @@ EXPORT_SYMBOL(sa_handle_get_from_db);
|
||||
EXPORT_SYMBOL(sa_handle_destroy);
|
||||
EXPORT_SYMBOL(sa_buf_hold);
|
||||
EXPORT_SYMBOL(sa_buf_rele);
|
||||
EXPORT_SYMBOL(sa_spill_rele);
|
||||
EXPORT_SYMBOL(sa_lookup);
|
||||
EXPORT_SYMBOL(sa_update);
|
||||
EXPORT_SYMBOL(sa_remove);
|
||||
|
||||
Reference in New Issue
Block a user