diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-07-02 14:43:47 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-07-09 12:09:38 -0400 |
commit | 259875efed06d6936f54c9a264e868937f1bc217 (patch) | |
tree | c3831c6050582e6ab90ab523131788e2b09df163 /fs/nfs/client.c | |
parent | 40fef8a649e5344bfb6a67a7cc3def3e0dad6448 (diff) |
NFS: set transport defaults after mount option parsing is finished
Move the UDP/TCP default timeo/retrans settings for text mounts to
nfs_init_timeout_values(), which was were they were always being
initialised (and sanity checked) for binary mounts.
Document the default timeout values using appropriate #defines.
Ensure that we initialise and sanity check the transport protocols that
may have been specified by the user.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r-- | fs/nfs/client.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index f2a092ca69b5..5ee23e7058b3 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -431,14 +431,14 @@ static void nfs_init_timeout_values(struct rpc_timeout *to, int proto, | |||
431 | { | 431 | { |
432 | to->to_initval = timeo * HZ / 10; | 432 | to->to_initval = timeo * HZ / 10; |
433 | to->to_retries = retrans; | 433 | to->to_retries = retrans; |
434 | if (!to->to_retries) | ||
435 | to->to_retries = 2; | ||
436 | 434 | ||
437 | switch (proto) { | 435 | switch (proto) { |
438 | case XPRT_TRANSPORT_TCP: | 436 | case XPRT_TRANSPORT_TCP: |
439 | case XPRT_TRANSPORT_RDMA: | 437 | case XPRT_TRANSPORT_RDMA: |
438 | if (to->to_retries == 0) | ||
439 | to->to_retries = NFS_DEF_TCP_RETRANS; | ||
440 | if (to->to_initval == 0) | 440 | if (to->to_initval == 0) |
441 | to->to_initval = 60 * HZ; | 441 | to->to_initval = NFS_DEF_TCP_TIMEO * HZ / 10; |
442 | if (to->to_initval > NFS_MAX_TCP_TIMEOUT) | 442 | if (to->to_initval > NFS_MAX_TCP_TIMEOUT) |
443 | to->to_initval = NFS_MAX_TCP_TIMEOUT; | 443 | to->to_initval = NFS_MAX_TCP_TIMEOUT; |
444 | to->to_increment = to->to_initval; | 444 | to->to_increment = to->to_initval; |
@@ -450,14 +450,17 @@ static void nfs_init_timeout_values(struct rpc_timeout *to, int proto, | |||
450 | to->to_exponential = 0; | 450 | to->to_exponential = 0; |
451 | break; | 451 | break; |
452 | case XPRT_TRANSPORT_UDP: | 452 | case XPRT_TRANSPORT_UDP: |
453 | default: | 453 | if (to->to_retries == 0) |
454 | to->to_retries = NFS_DEF_UDP_RETRANS; | ||
454 | if (!to->to_initval) | 455 | if (!to->to_initval) |
455 | to->to_initval = 11 * HZ / 10; | 456 | to->to_initval = NFS_DEF_UDP_TIMEO * HZ / 10; |
456 | if (to->to_initval > NFS_MAX_UDP_TIMEOUT) | 457 | if (to->to_initval > NFS_MAX_UDP_TIMEOUT) |
457 | to->to_initval = NFS_MAX_UDP_TIMEOUT; | 458 | to->to_initval = NFS_MAX_UDP_TIMEOUT; |
458 | to->to_maxval = NFS_MAX_UDP_TIMEOUT; | 459 | to->to_maxval = NFS_MAX_UDP_TIMEOUT; |
459 | to->to_exponential = 1; | 460 | to->to_exponential = 1; |
460 | break; | 461 | break; |
462 | default: | ||
463 | BUG(); | ||
461 | } | 464 | } |
462 | } | 465 | } |
463 | 466 | ||