[pnfs] [PATCH 3/7] nfs4_pnfs_layout_segment: use for layoutcommit
Benny Halevy
bhalevy at panasas.com
Thu Aug 30 09:13:38 EDT 2007
Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
fs/nfs/nfs4proc.c | 2 +-
fs/nfs/nfs4xdr.c | 6 +++---
fs/nfs/pnfs.c | 9 +++++----
include/linux/pnfs_xdr.h | 3 +--
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5dd588a..fd0a4bd 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2657,7 +2657,7 @@ static int _pnfs_proc_layoutcommit(struct pnfs_layoutcommit_data *data)
};
int status;
- dprintk("NFS call layoutcommit %lld @ %lld\n", data->args.length, data->args.offset);
+ dprintk("NFS call layoutcommit %lld @ %lld\n", data->args.lseg.length, data->args.lseg.offset);
nfs_fattr_init(fattr);
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 24d8764..dfa0b82 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -1663,12 +1663,12 @@ static int encode_pnfs_layoutcommit(struct xdr_stream *xdr, const struct pnfs_la
if (args->new_layout_size > PNFS_LAYOUT_MAXSIZE)
return -EINVAL;
- dprintk("%s: %llu@%llu lbw: %llu type: %d\n", __FUNCTION__, args->length, args->offset, args->lastbytewritten, args->layout_type);
+ dprintk("%s: %llu@%llu lbw: %llu type: %d\n", __FUNCTION__, args->lseg.length, args->lseg.offset, args->lastbytewritten, args->layout_type);
RESERVE_SPACE(40);
WRITE32(OP_LAYOUTCOMMIT);
- WRITE64(args->offset);
- WRITE64(args->length);
+ WRITE64(args->lseg.offset);
+ WRITE64(args->lseg.length);
WRITE32(0); /* reclaim */
WRITE32(1); /* newoffset = TRUE */
WRITE64(args->lastbytewritten);
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index a286cbc..d7e91aa 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1356,8 +1356,9 @@ pnfs_layoutcommit_setup(struct pnfs_layoutcommit_data *data, int sync)
/* Set values from inode so it can be reset
*/
- data->args.offset = nfsi->pnfs_write_begin_pos;
- data->args.length = nfsi->pnfs_write_end_pos - nfsi->pnfs_write_begin_pos + 1;
+ data->args.lseg.iomode = IOMODE_RW;
+ data->args.lseg.offset = nfsi->pnfs_write_begin_pos;
+ data->args.lseg.length = nfsi->pnfs_write_end_pos - nfsi->pnfs_write_begin_pos + 1;
data->args.lastbytewritten = nfsi->pnfs_write_end_pos;
data->args.bitmask = nfss->attr_bitmask;
data->res.server = nfss;
@@ -1393,8 +1394,8 @@ pnfs_layoutcommit_setup(struct pnfs_layoutcommit_data *data, int sync)
dprintk("NFS: %4d initiated layoutcommit call. %llu@%llu lbw: %llu "
"type: %d new_layout_size: %d\n",
data->task.tk_pid,
- data->args.length,
- data->args.offset,
+ data->args.lseg.length,
+ data->args.lseg.offset,
data->args.lastbytewritten,
data->args.layout_type,
data->args.new_layout_size);
diff --git a/include/linux/pnfs_xdr.h b/include/linux/pnfs_xdr.h
index 9bcb2b4..c4f0785 100644
--- a/include/linux/pnfs_xdr.h
+++ b/include/linux/pnfs_xdr.h
@@ -61,8 +61,7 @@ struct pnfs_layoutcommit_arg {
struct nfs_fh *fh;
/* Values set by layout driver */
- __u64 offset;
- __u64 length;
+ struct nfs4_pnfs_layout_segment lseg;
__u32 layout_type;
__u32 new_layout_size;
void* new_layout;
--
1.5.2.5
More information about the pNFS
mailing list