diff options
author | Andy Adamson <andros@netapp.com> | 2011-07-30 20:52:38 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-31 12:18:15 -0400 |
commit | db29c089094b2e686ebc9ed9f002be4a4f94b1f8 (patch) | |
tree | 1929e52e063af05032a1f95ad4d9bb49c7f609dd /fs | |
parent | dae100c2b1b9463996aab9162f2258145c43f7df (diff) |
pnfs: cleanup_layoutcommit
This gives layout driver a chance to cleanup structures they put in at
encode_layoutcommit.
Signed-off-by: Andy Adamson <andros@netapp.com>
[fixup layout header pointer for layoutcommit]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Benny Halevy <bhalevy@tonian.com>
[rm inode and pnfs_layout_hdr args from cleanup_layoutcommit()]
Signed-off-by: Jim Rees <rees@umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4xdr.c | 1 | ||||
-rw-r--r-- | fs/nfs/pnfs.c | 8 | ||||
-rw-r--r-- | fs/nfs/pnfs.h | 3 |
4 files changed, 13 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index e86de799dd12..8c77039e7a81 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -5963,6 +5963,7 @@ static void nfs4_layoutcommit_release(void *calldata) | |||
5963 | struct nfs4_layoutcommit_data *data = calldata; | 5963 | struct nfs4_layoutcommit_data *data = calldata; |
5964 | struct pnfs_layout_segment *lseg, *tmp; | 5964 | struct pnfs_layout_segment *lseg, *tmp; |
5965 | 5965 | ||
5966 | pnfs_cleanup_layoutcommit(data); | ||
5966 | /* Matched by references in pnfs_set_layoutcommit */ | 5967 | /* Matched by references in pnfs_set_layoutcommit */ |
5967 | list_for_each_entry_safe(lseg, tmp, &data->lseg_list, pls_lc_list) { | 5968 | list_for_each_entry_safe(lseg, tmp, &data->lseg_list, pls_lc_list) { |
5968 | list_del_init(&lseg->pls_lc_list); | 5969 | list_del_init(&lseg->pls_lc_list); |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 026166993d11..1dce12f41a4f 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -5599,6 +5599,7 @@ static int decode_layoutcommit(struct xdr_stream *xdr, | |||
5599 | int status; | 5599 | int status; |
5600 | 5600 | ||
5601 | status = decode_op_hdr(xdr, OP_LAYOUTCOMMIT); | 5601 | status = decode_op_hdr(xdr, OP_LAYOUTCOMMIT); |
5602 | res->status = status; | ||
5602 | if (status) | 5603 | if (status) |
5603 | return status; | 5604 | return status; |
5604 | 5605 | ||
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 3a47f7ce1e90..e550e8836c37 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -1411,6 +1411,14 @@ pnfs_set_layoutcommit(struct nfs_write_data *wdata) | |||
1411 | } | 1411 | } |
1412 | EXPORT_SYMBOL_GPL(pnfs_set_layoutcommit); | 1412 | EXPORT_SYMBOL_GPL(pnfs_set_layoutcommit); |
1413 | 1413 | ||
1414 | void pnfs_cleanup_layoutcommit(struct nfs4_layoutcommit_data *data) | ||
1415 | { | ||
1416 | struct nfs_server *nfss = NFS_SERVER(data->args.inode); | ||
1417 | |||
1418 | if (nfss->pnfs_curr_ld->cleanup_layoutcommit) | ||
1419 | nfss->pnfs_curr_ld->cleanup_layoutcommit(data); | ||
1420 | } | ||
1421 | |||
1414 | /* | 1422 | /* |
1415 | * For the LAYOUT4_NFSV4_1_FILES layout type, NFS_DATA_SYNC WRITEs and | 1423 | * For the LAYOUT4_NFSV4_1_FILES layout type, NFS_DATA_SYNC WRITEs and |
1416 | * NFS_UNSTABLE WRITEs with a COMMIT to data servers must store enough | 1424 | * NFS_UNSTABLE WRITEs with a COMMIT to data servers must store enough |
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index bddd8b997e18..606fbde2e757 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h | |||
@@ -113,6 +113,8 @@ struct pnfs_layoutdriver_type { | |||
113 | struct xdr_stream *xdr, | 113 | struct xdr_stream *xdr, |
114 | const struct nfs4_layoutreturn_args *args); | 114 | const struct nfs4_layoutreturn_args *args); |
115 | 115 | ||
116 | void (*cleanup_layoutcommit) (struct nfs4_layoutcommit_data *data); | ||
117 | |||
116 | void (*encode_layoutcommit) (struct pnfs_layout_hdr *layoutid, | 118 | void (*encode_layoutcommit) (struct pnfs_layout_hdr *layoutid, |
117 | struct xdr_stream *xdr, | 119 | struct xdr_stream *xdr, |
118 | const struct nfs4_layoutcommit_args *args); | 120 | const struct nfs4_layoutcommit_args *args); |
@@ -196,6 +198,7 @@ void pnfs_roc_release(struct inode *ino); | |||
196 | void pnfs_roc_set_barrier(struct inode *ino, u32 barrier); | 198 | void pnfs_roc_set_barrier(struct inode *ino, u32 barrier); |
197 | bool pnfs_roc_drain(struct inode *ino, u32 *barrier); | 199 | bool pnfs_roc_drain(struct inode *ino, u32 *barrier); |
198 | void pnfs_set_layoutcommit(struct nfs_write_data *wdata); | 200 | void pnfs_set_layoutcommit(struct nfs_write_data *wdata); |
201 | void pnfs_cleanup_layoutcommit(struct nfs4_layoutcommit_data *data); | ||
199 | int pnfs_layoutcommit_inode(struct inode *inode, bool sync); | 202 | int pnfs_layoutcommit_inode(struct inode *inode, bool sync); |
200 | int _pnfs_return_layout(struct inode *); | 203 | int _pnfs_return_layout(struct inode *); |
201 | int pnfs_ld_write_done(struct nfs_write_data *); | 204 | int pnfs_ld_write_done(struct nfs_write_data *); |