mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 01:51:39 +00:00
pNFS: Add infrastructure for cleaning up per-layout commit structures
Ensure that both the file and flexfiles layout types clean up when freeing the layout segments. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
parent
e3b9f7e60b
commit
a9901899b6
7 changed files with 121 additions and 4 deletions
|
@ -580,6 +580,7 @@ ff_layout_free_lseg(struct pnfs_layout_segment *lseg)
|
|||
kfree(ffl->commit_info.buckets);
|
||||
ffl->commit_info.buckets = NULL;
|
||||
}
|
||||
pnfs_generic_ds_cinfo_release_lseg(&ffl->commit_info, lseg);
|
||||
spin_unlock(&inode->i_lock);
|
||||
}
|
||||
_ff_layout_free_lseg(fls);
|
||||
|
@ -2003,6 +2004,15 @@ ff_layout_get_ds_info(struct inode *inode)
|
|||
return &FF_LAYOUT_FROM_HDR(layout)->commit_info;
|
||||
}
|
||||
|
||||
static void
|
||||
ff_layout_release_ds_info(struct pnfs_ds_commit_info *fl_cinfo,
|
||||
struct inode *inode)
|
||||
{
|
||||
spin_lock(&inode->i_lock);
|
||||
pnfs_generic_ds_cinfo_destroy(fl_cinfo);
|
||||
spin_unlock(&inode->i_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
ff_layout_free_deviceid_node(struct nfs4_deviceid_node *d)
|
||||
{
|
||||
|
@ -2503,6 +2513,7 @@ static struct pnfs_layoutdriver_type flexfilelayout_type = {
|
|||
.pg_read_ops = &ff_layout_pg_read_ops,
|
||||
.pg_write_ops = &ff_layout_pg_write_ops,
|
||||
.get_ds_info = ff_layout_get_ds_info,
|
||||
.release_ds_info = ff_layout_release_ds_info,
|
||||
.free_deviceid_node = ff_layout_free_deviceid_node,
|
||||
.mark_request_commit = pnfs_layout_mark_request_commit,
|
||||
.clear_request_commit = pnfs_generic_clear_request_commit,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue