diff options
author | Andy Adamson <andros@netapp.com> | 2011-05-22 12:53:10 -0400 |
---|---|---|
committer | Boaz Harrosh <bharrosh@panasas.com> | 2011-05-29 13:54:37 -0400 |
commit | 04a555498e03b3804e2dec916a4669f5f560e503 (patch) | |
tree | 4fab39683df70cee7f7aea7d7718072a811ad153 /fs/nfs | |
parent | 8a1636c459cb7a4b32ba4024cd1b2ba21fba6aed (diff) |
pnfs: encode_layoutreturn
Add a layout driver method to encode the layout type specific
opaque part of layout return in-line in the xdr stream.
Currently the pnfs-objects layout driver uses it to encode i/o error
information on LAYOUTRETURN.
Signed-off-by: Andy Adamson <andros@netapp.com>
[fixup layout header pointer for encode_layoutreturn]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 9 | ||||
-rw-r--r-- | fs/nfs/pnfs.h | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index f24212064356..d464badc0067 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -1920,8 +1920,13 @@ encode_layoutreturn(struct xdr_stream *xdr, | |||
1920 | spin_lock(&args->inode->i_lock); | 1920 | spin_lock(&args->inode->i_lock); |
1921 | xdr_encode_opaque_fixed(p, &args->stateid.data, NFS4_STATEID_SIZE); | 1921 | xdr_encode_opaque_fixed(p, &args->stateid.data, NFS4_STATEID_SIZE); |
1922 | spin_unlock(&args->inode->i_lock); | 1922 | spin_unlock(&args->inode->i_lock); |
1923 | p = reserve_space(xdr, 4); | 1923 | if (NFS_SERVER(args->inode)->pnfs_curr_ld->encode_layoutreturn) { |
1924 | *p = cpu_to_be32(0); | 1924 | NFS_SERVER(args->inode)->pnfs_curr_ld->encode_layoutreturn( |
1925 | NFS_I(args->inode)->layout, xdr, args); | ||
1926 | } else { | ||
1927 | p = reserve_space(xdr, 4); | ||
1928 | *p = cpu_to_be32(0); | ||
1929 | } | ||
1925 | hdr->nops++; | 1930 | hdr->nops++; |
1926 | hdr->replen += decode_layoutreturn_maxsz; | 1931 | hdr->replen += decode_layoutreturn_maxsz; |
1927 | } | 1932 | } |
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index af3967a893a1..1b6b207a8806 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h | |||
@@ -104,6 +104,10 @@ struct pnfs_layoutdriver_type { | |||
104 | enum pnfs_try_status (*write_pagelist) (struct nfs_write_data *nfs_data, int how); | 104 | enum pnfs_try_status (*write_pagelist) (struct nfs_write_data *nfs_data, int how); |
105 | 105 | ||
106 | void (*free_deviceid_node) (struct nfs4_deviceid_node *); | 106 | void (*free_deviceid_node) (struct nfs4_deviceid_node *); |
107 | |||
108 | void (*encode_layoutreturn) (struct pnfs_layout_hdr *layoutid, | ||
109 | struct xdr_stream *xdr, | ||
110 | const struct nfs4_layoutreturn_args *args); | ||
107 | }; | 111 | }; |
108 | 112 | ||
109 | struct pnfs_layout_hdr { | 113 | struct pnfs_layout_hdr { |