sit: fix a double free on error path
[linux/fpc-iii.git] / fs / nfsd / blocklayoutxdr.h
blob397bc7563a4927c9673e5715bbb79e0cd1c6006b
1 #ifndef _NFSD_BLOCKLAYOUTXDR_H
2 #define _NFSD_BLOCKLAYOUTXDR_H 1
4 #include <linux/blkdev.h>
5 #include "xdr4.h"
7 struct iomap;
8 struct xdr_stream;
10 struct pnfs_block_extent {
11 struct nfsd4_deviceid vol_id;
12 u64 foff;
13 u64 len;
14 u64 soff;
15 enum pnfs_block_extent_state es;
18 struct pnfs_block_range {
19 u64 foff;
20 u64 len;
24 * Random upper cap for the uuid length to avoid unbounded allocation.
25 * Not actually limited by the protocol.
27 #define PNFS_BLOCK_UUID_LEN 128
29 struct pnfs_block_volume {
30 enum pnfs_block_volume_type type;
31 union {
32 struct {
33 u64 offset;
34 u32 sig_len;
35 u8 sig[PNFS_BLOCK_UUID_LEN];
36 } simple;
37 struct {
38 enum scsi_code_set code_set;
39 enum scsi_designator_type designator_type;
40 int designator_len;
41 u8 designator[256];
42 u64 pr_key;
43 } scsi;
47 struct pnfs_block_deviceaddr {
48 u32 nr_volumes;
49 struct pnfs_block_volume volumes[];
52 __be32 nfsd4_block_encode_getdeviceinfo(struct xdr_stream *xdr,
53 struct nfsd4_getdeviceinfo *gdp);
54 __be32 nfsd4_block_encode_layoutget(struct xdr_stream *xdr,
55 struct nfsd4_layoutget *lgp);
56 int nfsd4_block_decode_layoutupdate(__be32 *p, u32 len, struct iomap **iomapp,
57 u32 block_size);
58 int nfsd4_scsi_decode_layoutupdate(__be32 *p, u32 len, struct iomap **iomapp,
59 u32 block_size);
61 #endif /* _NFSD_BLOCKLAYOUTXDR_H */