diff options
| author | Peng Tao <tao.peng@primarydata.com> | 2014-11-16 20:30:36 -0500 |
|---|---|---|
| committer | Tom Haynes <loghyr@primarydata.com> | 2015-02-03 14:06:49 -0500 |
| commit | 15eb67c15342d212b0c8a540b6d6bd2dfad52a63 (patch) | |
| tree | d757ddb7e60cf5eb6bbb796cdb66626232f77beb | |
| parent | ceb11e13df3e78b450730c615037133c57b90c3b (diff) | |
nfs41: add range to layoutreturn args
So that callers can specify which range to return.
Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
| -rw-r--r-- | fs/nfs/nfs4xdr.c | 6 | ||||
| -rw-r--r-- | fs/nfs/pnfs.c | 4 | ||||
| -rw-r--r-- | include/linux/nfs_xdr.h | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 3c3ff633dd17..56d4c91a48f3 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
| @@ -2012,11 +2012,11 @@ encode_layoutreturn(struct xdr_stream *xdr, | |||
| 2012 | p = reserve_space(xdr, 16); | 2012 | p = reserve_space(xdr, 16); |
| 2013 | *p++ = cpu_to_be32(0); /* reclaim. always 0 for now */ | 2013 | *p++ = cpu_to_be32(0); /* reclaim. always 0 for now */ |
| 2014 | *p++ = cpu_to_be32(args->layout_type); | 2014 | *p++ = cpu_to_be32(args->layout_type); |
| 2015 | *p++ = cpu_to_be32(args->iomode); | 2015 | *p++ = cpu_to_be32(args->range.iomode); |
| 2016 | *p = cpu_to_be32(RETURN_FILE); | 2016 | *p = cpu_to_be32(RETURN_FILE); |
| 2017 | p = reserve_space(xdr, 16); | 2017 | p = reserve_space(xdr, 16); |
| 2018 | p = xdr_encode_hyper(p, 0); | 2018 | p = xdr_encode_hyper(p, args->range.offset); |
| 2019 | p = xdr_encode_hyper(p, NFS4_MAX_UINT64); | 2019 | p = xdr_encode_hyper(p, args->range.length); |
| 2020 | spin_lock(&args->inode->i_lock); | 2020 | spin_lock(&args->inode->i_lock); |
| 2021 | encode_nfs4_stateid(xdr, &args->stateid); | 2021 | encode_nfs4_stateid(xdr, &args->stateid); |
| 2022 | spin_unlock(&args->inode->i_lock); | 2022 | spin_unlock(&args->inode->i_lock); |
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 685af4fb39ca..9549b89e494b 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
| @@ -916,7 +916,9 @@ pnfs_send_layoutreturn(struct pnfs_layout_hdr *lo, nfs4_stateid stateid, | |||
| 916 | lrp->args.stateid = stateid; | 916 | lrp->args.stateid = stateid; |
| 917 | lrp->args.layout_type = NFS_SERVER(ino)->pnfs_curr_ld->id; | 917 | lrp->args.layout_type = NFS_SERVER(ino)->pnfs_curr_ld->id; |
| 918 | lrp->args.inode = ino; | 918 | lrp->args.inode = ino; |
| 919 | lrp->args.iomode = iomode; | 919 | lrp->args.range.iomode = iomode; |
| 920 | lrp->args.range.offset = 0; | ||
| 921 | lrp->args.range.length = NFS4_MAX_UINT64; | ||
| 920 | lrp->args.layout = lo; | 922 | lrp->args.layout = lo; |
| 921 | lrp->clp = NFS_SERVER(ino)->nfs_client; | 923 | lrp->clp = NFS_SERVER(ino)->nfs_client; |
| 922 | lrp->cred = lo->plh_lc_cred; | 924 | lrp->cred = lo->plh_lc_cred; |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 6400a1e01aa4..363792356d25 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -293,7 +293,7 @@ struct nfs4_layoutreturn_args { | |||
| 293 | struct nfs4_sequence_args seq_args; | 293 | struct nfs4_sequence_args seq_args; |
| 294 | struct pnfs_layout_hdr *layout; | 294 | struct pnfs_layout_hdr *layout; |
| 295 | struct inode *inode; | 295 | struct inode *inode; |
| 296 | enum pnfs_iomode iomode; | 296 | struct pnfs_layout_range range; |
| 297 | nfs4_stateid stateid; | 297 | nfs4_stateid stateid; |
| 298 | __u32 layout_type; | 298 | __u32 layout_type; |
| 299 | }; | 299 | }; |
