blob: 467defd4e56364188d689c537080ed15be74a602 [file] [log] [blame]
Tom Haynes9b9960a2016-06-14 13:41:28 -07001/*
2 * Copyright (c) 2016 Tom Haynes <loghyr@primarydata.com>
3 */
4#ifndef _NFSD_FLEXFILELAYOUTXDR_H
5#define _NFSD_FLEXFILELAYOUTXDR_H 1
6
7#include <linux/inet.h>
8#include "xdr4.h"
9
10#define FF_FLAGS_NO_LAYOUTCOMMIT 1
11#define FF_FLAGS_NO_IO_THRU_MDS 2
12#define FF_FLAGS_NO_READ_IO 4
13
14struct xdr_stream;
15
16#define FF_NETID_LEN (4)
17#define FF_ADDR_LEN (INET6_ADDRSTRLEN + 8)
18struct pnfs_ff_netaddr {
19 char netid[FF_NETID_LEN + 1];
20 char addr[FF_ADDR_LEN + 1];
21 u32 netid_len;
22 u32 addr_len;
23};
24
25struct pnfs_ff_device_addr {
26 struct pnfs_ff_netaddr netaddr;
27 u32 version;
28 u32 minor_version;
29 u32 rsize;
30 u32 wsize;
31 bool tightly_coupled;
32};
33
34struct pnfs_ff_layout {
35 u32 flags;
36 u32 stats_collect_hint;
37 kuid_t uid;
38 kgid_t gid;
39 struct nfsd4_deviceid deviceid;
40 stateid_t stateid;
41 struct nfs_fh fh;
42};
43
44__be32 nfsd4_ff_encode_getdeviceinfo(struct xdr_stream *xdr,
45 struct nfsd4_getdeviceinfo *gdp);
46__be32 nfsd4_ff_encode_layoutget(struct xdr_stream *xdr,
47 struct nfsd4_layoutget *lgp);
48
49#endif /* _NFSD_FLEXFILELAYOUTXDR_H */