Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * NFSv4 flexfile layout driver data structures.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright (c) 2014, Primary Data, Inc. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * Tao Peng <bergwolf@primarydata.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #ifndef FS_NFS_NFS4FLEXFILELAYOUT_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #define FS_NFS_NFS4FLEXFILELAYOUT_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #define FF_FLAGS_NO_LAYOUTCOMMIT 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #define FF_FLAGS_NO_IO_THRU_MDS  2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #define FF_FLAGS_NO_READ_IO      4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/refcount.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include "../pnfs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) /* XXX: Let's filter out insanely large mirror count for now to avoid oom
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * due to network error etc. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #define NFS4_FLEXFILE_LAYOUT_MAX_MIRROR_CNT 4096
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) /* LAYOUTSTATS report interval in ms */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #define FF_LAYOUTSTATS_REPORT_INTERVAL (60000L)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #define FF_LAYOUTSTATS_MAXDEV 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) struct nfs4_ff_ds_version {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	u32				version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	u32				minor_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	u32				rsize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	u32				wsize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	bool				tightly_coupled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) /* chained in global deviceid hlist */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) struct nfs4_ff_layout_ds {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	struct nfs4_deviceid_node	id_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	u32				ds_versions_cnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	struct nfs4_ff_ds_version	*ds_versions;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	struct nfs4_pnfs_ds		*ds;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) struct nfs4_ff_layout_ds_err {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	struct list_head		list; /* linked in mirror error_list */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	u64				offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	u64				length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	int				status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	enum nfs_opnum4			opnum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	nfs4_stateid			stateid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	struct nfs4_deviceid		deviceid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) struct nfs4_ff_io_stat {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	__u64				ops_requested;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	__u64				bytes_requested;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	__u64				ops_completed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	__u64				bytes_completed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	__u64				bytes_not_delivered;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	ktime_t				total_busy_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	ktime_t				aggregate_completion_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) struct nfs4_ff_busy_timer {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	ktime_t start_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	atomic_t n_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) struct nfs4_ff_layoutstat {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	struct nfs4_ff_io_stat io_stat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	struct nfs4_ff_busy_timer busy_timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) struct nfs4_ff_layout_mirror {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	struct pnfs_layout_hdr		*layout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	struct list_head		mirrors;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	u32				ds_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	u32				efficiency;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	struct nfs4_deviceid		devid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	struct nfs4_ff_layout_ds	*mirror_ds;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	u32				fh_versions_cnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	struct nfs_fh			*fh_versions;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	nfs4_stateid			stateid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	const struct cred __rcu		*ro_cred;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	const struct cred __rcu		*rw_cred;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	refcount_t			ref;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	spinlock_t			lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	unsigned long			flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	struct nfs4_ff_layoutstat	read_stat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	struct nfs4_ff_layoutstat	write_stat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	ktime_t				start_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	u32				report_interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) #define NFS4_FF_MIRROR_STAT_AVAIL	(0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) struct nfs4_ff_layout_segment {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	struct pnfs_layout_segment	generic_hdr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	u64				stripe_unit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	u32				flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	u32				mirror_array_cnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	struct nfs4_ff_layout_mirror	*mirror_array[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) struct nfs4_flexfile_layout {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	struct pnfs_layout_hdr generic_hdr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	struct pnfs_ds_commit_info commit_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	struct list_head	mirrors;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	struct list_head	error_list; /* nfs4_ff_layout_ds_err */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	ktime_t			last_report_time; /* Layoutstat report times */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) struct nfs4_flexfile_layoutreturn_args {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	struct list_head errors;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	struct nfs42_layoutstat_devinfo devinfo[FF_LAYOUTSTATS_MAXDEV];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	unsigned int num_errors;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	unsigned int num_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	struct page *pages[1];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) static inline struct nfs4_flexfile_layout *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) FF_LAYOUT_FROM_HDR(struct pnfs_layout_hdr *lo)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	return container_of(lo, struct nfs4_flexfile_layout, generic_hdr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) static inline struct nfs4_ff_layout_segment *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) FF_LAYOUT_LSEG(struct pnfs_layout_segment *lseg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	return container_of(lseg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 			    struct nfs4_ff_layout_segment,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 			    generic_hdr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) static inline struct nfs4_ff_layout_ds *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) FF_LAYOUT_MIRROR_DS(struct nfs4_deviceid_node *node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	return container_of(node, struct nfs4_ff_layout_ds, id_node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) static inline struct nfs4_ff_layout_mirror *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) FF_LAYOUT_COMP(struct pnfs_layout_segment *lseg, u32 idx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	struct nfs4_ff_layout_segment *fls = FF_LAYOUT_LSEG(lseg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	if (idx < fls->mirror_array_cnt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 		return fls->mirror_array[idx];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) static inline struct nfs4_deviceid_node *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) FF_LAYOUT_DEVID_NODE(struct pnfs_layout_segment *lseg, u32 idx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	struct nfs4_ff_layout_mirror *mirror = FF_LAYOUT_COMP(lseg, idx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	if (mirror != NULL) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 		struct nfs4_ff_layout_ds *mirror_ds = mirror->mirror_ds;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 		if (!IS_ERR_OR_NULL(mirror_ds))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 			return &mirror_ds->id_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) static inline u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) FF_LAYOUT_MIRROR_COUNT(struct pnfs_layout_segment *lseg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	return FF_LAYOUT_LSEG(lseg)->mirror_array_cnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) static inline bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) ff_layout_no_fallback_to_mds(struct pnfs_layout_segment *lseg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	return FF_LAYOUT_LSEG(lseg)->flags & FF_FLAGS_NO_IO_THRU_MDS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) static inline bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) ff_layout_no_read_on_rw(struct pnfs_layout_segment *lseg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	return FF_LAYOUT_LSEG(lseg)->flags & FF_FLAGS_NO_READ_IO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) nfs4_ff_layout_ds_version(const struct nfs4_ff_layout_mirror *mirror)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	return mirror->mirror_ds->ds_versions[0].version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) struct nfs4_ff_layout_ds *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) nfs4_ff_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 			    gfp_t gfp_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) void nfs4_ff_layout_put_deviceid(struct nfs4_ff_layout_ds *mirror_ds);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) void nfs4_ff_layout_free_deviceid(struct nfs4_ff_layout_ds *mirror_ds);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) int ff_layout_track_ds_error(struct nfs4_flexfile_layout *flo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 			     struct nfs4_ff_layout_mirror *mirror, u64 offset,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 			     u64 length, int status, enum nfs_opnum4 opnum,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 			     gfp_t gfp_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) void ff_layout_send_layouterror(struct pnfs_layout_segment *lseg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) int ff_layout_encode_ds_ioerr(struct xdr_stream *xdr, const struct list_head *head);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) void ff_layout_free_ds_ioerr(struct list_head *head);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) unsigned int ff_layout_fetch_ds_ioerr(struct pnfs_layout_hdr *lo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 		const struct pnfs_layout_range *range,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 		struct list_head *head,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 		unsigned int maxnum);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) struct nfs_fh *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) nfs4_ff_layout_select_ds_fh(struct nfs4_ff_layout_mirror *mirror);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) nfs4_ff_layout_select_ds_stateid(const struct nfs4_ff_layout_mirror *mirror,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 		nfs4_stateid *stateid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) struct nfs4_pnfs_ds *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 			  struct nfs4_ff_layout_mirror *mirror,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 			  bool fail_return);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) struct rpc_clnt *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) nfs4_ff_find_or_create_ds_client(struct nfs4_ff_layout_mirror *mirror,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 				 struct nfs_client *ds_clp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 				 struct inode *inode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) const struct cred *ff_layout_get_ds_cred(struct nfs4_ff_layout_mirror *mirror,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 					 const struct pnfs_layout_range *range,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 					 const struct cred *mdscred);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) bool ff_layout_avoid_mds_available_ds(struct pnfs_layout_segment *lseg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) bool ff_layout_avoid_read_on_rw(struct pnfs_layout_segment *lseg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) #endif /* FS_NFS_NFS4FLEXFILELAYOUT_H */