mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 17:11:46 +00:00
pNFS: Enable per-layout segment commit structures
Enable adding and lookup of per-layout segment commits in filelayout and flexfilelayout. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
parent
a9901899b6
commit
ba827c9abb
4 changed files with 117 additions and 6 deletions
|
@ -2004,6 +2004,24 @@ ff_layout_get_ds_info(struct inode *inode)
|
|||
return &FF_LAYOUT_FROM_HDR(layout)->commit_info;
|
||||
}
|
||||
|
||||
static void
|
||||
ff_layout_setup_ds_info(struct pnfs_ds_commit_info *fl_cinfo,
|
||||
struct pnfs_layout_segment *lseg)
|
||||
{
|
||||
struct nfs4_ff_layout_segment *flseg = FF_LAYOUT_LSEG(lseg);
|
||||
struct inode *inode = lseg->pls_layout->plh_inode;
|
||||
struct pnfs_commit_array *array, *new;
|
||||
|
||||
new = pnfs_alloc_commit_array(flseg->mirror_array_cnt, GFP_NOIO);
|
||||
if (new) {
|
||||
spin_lock(&inode->i_lock);
|
||||
array = pnfs_add_commit_array(fl_cinfo, new, lseg);
|
||||
spin_unlock(&inode->i_lock);
|
||||
if (array != new)
|
||||
pnfs_free_commit_array(new);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ff_layout_release_ds_info(struct pnfs_ds_commit_info *fl_cinfo,
|
||||
struct inode *inode)
|
||||
|
@ -2513,6 +2531,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,
|
||||
.setup_ds_info = ff_layout_setup_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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue