diff options
author | Peng Tao <tao.peng@primarydata.com> | 2014-05-30 06:15:55 -0400 |
---|---|---|
committer | Tom Haynes <loghyr@primarydata.com> | 2015-02-03 14:06:33 -0500 |
commit | 39280a5ae8443dcc1ab3bb5ebc205aab0855b849 (patch) | |
tree | 7b0061d5fc54ebcee094d4d1d52f3040b029cd29 /fs | |
parent | 064172f3459a914277aa309b2afd3bd5d1c3289a (diff) |
nfs41: move file layout macros to generic pnfs
They can be reused by flexfile layout as well.
Also add a code such that if read fails on one DS and
there are other DSes available to use, don't resend
through MDS but through pNFS so that client can read
from other DSes.
Reviewed-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Tom Haynes <Thomas.Haynes@primarydata.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/filelayout/filelayout.h | 10 | ||||
-rw-r--r-- | fs/nfs/pnfs.h | 11 |
2 files changed, 11 insertions, 10 deletions
diff --git a/fs/nfs/filelayout/filelayout.h b/fs/nfs/filelayout/filelayout.h index f97eea627c4f..2896cb833a11 100644 --- a/fs/nfs/filelayout/filelayout.h +++ b/fs/nfs/filelayout/filelayout.h | |||
@@ -33,13 +33,6 @@ | |||
33 | #include "../pnfs.h" | 33 | #include "../pnfs.h" |
34 | 34 | ||
35 | /* | 35 | /* |
36 | * Default data server connection timeout and retrans vaules. | ||
37 | * Set by module paramters dataserver_timeo and dataserver_retrans. | ||
38 | */ | ||
39 | #define NFS4_DEF_DS_TIMEO 600 /* in tenths of a second */ | ||
40 | #define NFS4_DEF_DS_RETRANS 5 | ||
41 | |||
42 | /* | ||
43 | * Field testing shows we need to support up to 4096 stripe indices. | 36 | * Field testing shows we need to support up to 4096 stripe indices. |
44 | * We store each index as a u8 (u32 on the wire) to keep the memory footprint | 37 | * We store each index as a u8 (u32 on the wire) to keep the memory footprint |
45 | * reasonable. This in turn means we support a maximum of 256 | 38 | * reasonable. This in turn means we support a maximum of 256 |
@@ -48,9 +41,6 @@ | |||
48 | #define NFS4_PNFS_MAX_STRIPE_CNT 4096 | 41 | #define NFS4_PNFS_MAX_STRIPE_CNT 4096 |
49 | #define NFS4_PNFS_MAX_MULTI_CNT 256 /* 256 fit into a u8 stripe_index */ | 42 | #define NFS4_PNFS_MAX_MULTI_CNT 256 /* 256 fit into a u8 stripe_index */ |
50 | 43 | ||
51 | /* error codes for internal use */ | ||
52 | #define NFS4ERR_RESET_TO_MDS 12001 | ||
53 | |||
54 | enum stripetype4 { | 44 | enum stripetype4 { |
55 | STRIPE_SPARSE = 1, | 45 | STRIPE_SPARSE = 1, |
56 | STRIPE_DENSE = 2 | 46 | STRIPE_DENSE = 2 |
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index 2ea9e9a7d85e..aef89b347bdc 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h | |||
@@ -77,6 +77,17 @@ enum pnfs_try_status { | |||
77 | 77 | ||
78 | #define LAYOUT_NFSV4_1_MODULE_PREFIX "nfs-layouttype4" | 78 | #define LAYOUT_NFSV4_1_MODULE_PREFIX "nfs-layouttype4" |
79 | 79 | ||
80 | /* | ||
81 | * Default data server connection timeout and retrans vaules. | ||
82 | * Set by module parameters dataserver_timeo and dataserver_retrans. | ||
83 | */ | ||
84 | #define NFS4_DEF_DS_TIMEO 600 /* in tenths of a second */ | ||
85 | #define NFS4_DEF_DS_RETRANS 5 | ||
86 | |||
87 | /* error codes for internal use */ | ||
88 | #define NFS4ERR_RESET_TO_MDS 12001 | ||
89 | #define NFS4ERR_RESET_TO_PNFS 12002 | ||
90 | |||
80 | enum { | 91 | enum { |
81 | NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */ | 92 | NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */ |
82 | NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */ | 93 | NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */ |