-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NFS/pNFS: Clean up pNFS commit operations
Move the pNFS commit related operations into a separate structure that can be carried by the pnfs_ds_commit_info. Signed-off-by: Trond Myklebust <[email protected]>
- Loading branch information
Trond Myklebust
committed
Mar 27, 2020
1 parent
0aa647b
commit 9c455a8
Showing
6 changed files
with
98 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ MODULE_AUTHOR("Dean Hildebrand <[email protected]>"); | |
MODULE_DESCRIPTION("The NFSv4 file layout driver"); | ||
|
||
#define FILELAYOUT_POLL_RETRY_MAX (15*HZ) | ||
static const struct pnfs_commit_ops filelayout_commit_ops; | ||
|
||
static loff_t | ||
filelayout_get_dense_offset(struct nfs4_filelayout_segment *flseg, | ||
|
@@ -1045,6 +1046,7 @@ filelayout_alloc_layout_hdr(struct inode *inode, gfp_t gfp_flags) | |
if (flo == NULL) | ||
return NULL; | ||
pnfs_init_ds_commit_info(&flo->commit_info); | ||
flo->commit_info.ops = &filelayout_commit_ops; | ||
return &flo->generic_hdr; | ||
} | ||
|
||
|
@@ -1094,6 +1096,16 @@ filelayout_release_ds_info(struct pnfs_ds_commit_info *fl_cinfo, | |
spin_unlock(&inode->i_lock); | ||
} | ||
|
||
static const struct pnfs_commit_ops filelayout_commit_ops = { | ||
.setup_ds_info = filelayout_setup_ds_info, | ||
.release_ds_info = filelayout_release_ds_info, | ||
.mark_request_commit = filelayout_mark_request_commit, | ||
.clear_request_commit = pnfs_generic_clear_request_commit, | ||
.scan_commit_lists = pnfs_generic_scan_commit_lists, | ||
.recover_commit_reqs = pnfs_generic_recover_commit_reqs, | ||
.search_commit_reqs = pnfs_generic_search_commit_reqs, | ||
.commit_pagelist = filelayout_commit_pagelist, | ||
}; | ||
|
||
static struct pnfs_layoutdriver_type filelayout_type = { | ||
.id = LAYOUT_NFSV4_1_FILES, | ||
|
@@ -1108,14 +1120,6 @@ static struct pnfs_layoutdriver_type filelayout_type = { | |
.pg_read_ops = &filelayout_pg_read_ops, | ||
.pg_write_ops = &filelayout_pg_write_ops, | ||
.get_ds_info = &filelayout_get_ds_info, | ||
.setup_ds_info = filelayout_setup_ds_info, | ||
.release_ds_info = filelayout_release_ds_info, | ||
.mark_request_commit = filelayout_mark_request_commit, | ||
.clear_request_commit = pnfs_generic_clear_request_commit, | ||
.scan_commit_lists = pnfs_generic_scan_commit_lists, | ||
.recover_commit_reqs = pnfs_generic_recover_commit_reqs, | ||
.search_commit_reqs = pnfs_generic_search_commit_reqs, | ||
.commit_pagelist = filelayout_commit_pagelist, | ||
.read_pagelist = filelayout_read_pagelist, | ||
.write_pagelist = filelayout_write_pagelist, | ||
.alloc_deviceid_node = filelayout_alloc_deviceid_node, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters