xref: /openbmc/linux/fs/nfsd/flexfilelayoutxdr.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
29b9960a0STom Haynes /*
39b9960a0STom Haynes  * Copyright (c) 2016 Tom Haynes <loghyr@primarydata.com>
49b9960a0STom Haynes  */
59b9960a0STom Haynes #ifndef _NFSD_FLEXFILELAYOUTXDR_H
69b9960a0STom Haynes #define _NFSD_FLEXFILELAYOUTXDR_H 1
79b9960a0STom Haynes 
89b9960a0STom Haynes #include <linux/inet.h>
99b9960a0STom Haynes #include "xdr4.h"
109b9960a0STom Haynes 
119b9960a0STom Haynes #define FF_FLAGS_NO_LAYOUTCOMMIT 1
129b9960a0STom Haynes #define FF_FLAGS_NO_IO_THRU_MDS  2
139b9960a0STom Haynes #define FF_FLAGS_NO_READ_IO      4
149b9960a0STom Haynes 
159b9960a0STom Haynes struct xdr_stream;
169b9960a0STom Haynes 
179b9960a0STom Haynes #define FF_NETID_LEN		(4)
189b9960a0STom Haynes #define FF_ADDR_LEN		(INET6_ADDRSTRLEN + 8)
199b9960a0STom Haynes struct pnfs_ff_netaddr {
209b9960a0STom Haynes 	char				netid[FF_NETID_LEN + 1];
219b9960a0STom Haynes 	char				addr[FF_ADDR_LEN + 1];
229b9960a0STom Haynes 	u32				netid_len;
239b9960a0STom Haynes 	u32				addr_len;
249b9960a0STom Haynes };
259b9960a0STom Haynes 
269b9960a0STom Haynes struct pnfs_ff_device_addr {
279b9960a0STom Haynes 	struct pnfs_ff_netaddr		netaddr;
289b9960a0STom Haynes 	u32				version;
299b9960a0STom Haynes 	u32				minor_version;
309b9960a0STom Haynes 	u32				rsize;
319b9960a0STom Haynes 	u32				wsize;
329b9960a0STom Haynes 	bool				tightly_coupled;
339b9960a0STom Haynes };
349b9960a0STom Haynes 
359b9960a0STom Haynes struct pnfs_ff_layout {
369b9960a0STom Haynes 	u32				flags;
379b9960a0STom Haynes 	u32				stats_collect_hint;
389b9960a0STom Haynes 	kuid_t				uid;
399b9960a0STom Haynes 	kgid_t				gid;
409b9960a0STom Haynes 	struct nfsd4_deviceid		deviceid;
419b9960a0STom Haynes 	stateid_t			stateid;
429b9960a0STom Haynes 	struct nfs_fh			fh;
439b9960a0STom Haynes };
449b9960a0STom Haynes 
459b9960a0STom Haynes __be32 nfsd4_ff_encode_getdeviceinfo(struct xdr_stream *xdr,
469b9960a0STom Haynes 		struct nfsd4_getdeviceinfo *gdp);
479b9960a0STom Haynes __be32 nfsd4_ff_encode_layoutget(struct xdr_stream *xdr,
489b9960a0STom Haynes 		struct nfsd4_layoutget *lgp);
499b9960a0STom Haynes 
509b9960a0STom Haynes #endif /* _NFSD_FLEXFILELAYOUTXDR_H */
51