summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2001-12-30 18:41:52 +0000
committeriedowse <iedowse@FreeBSD.org>2001-12-30 18:41:52 +0000
commitfb3ea25673979c139c8916a1c0cef243c7a7895d (patch)
tree64a76b077101cc608141b4a1a8bb88e828f1291c /sys
parentd08127993cb3bc97db70fd4ee3b5a7c541bce70f (diff)
downloadFreeBSD-src-fb3ea25673979c139c8916a1c0cef243c7a7895d.zip
FreeBSD-src-fb3ea25673979c139c8916a1c0cef243c7a7895d.tar.gz
Add a #define for the size of the nfs_backoff[] array, and use this
instead of magic constants in the code.
Diffstat (limited to 'sys')
-rw-r--r--sys/nfsclient/nfs_socket.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c
index 6f1f525..62a7b23 100644
--- a/sys/nfsclient/nfs_socket.c
+++ b/sys/nfsclient/nfs_socket.c
@@ -132,7 +132,8 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, bufpackets, CTLFLAG_RW, &nfs_bufpackets, 0, "");
*/
#define NFS_CWNDSCALE 256
#define NFS_MAXCWND (NFS_CWNDSCALE * 32)
-static int nfs_backoff[8] = { 2, 4, 8, 16, 32, 64, 128, 256, };
+#define NFS_NBACKOFF 8
+static int nfs_backoff[NFS_NBACKOFF] = { 2, 4, 8, 16, 32, 64, 128, 256, };
struct callout_handle nfs_timer_handle;
static int nfs_msg(struct thread *, char *, char *);
@@ -1013,7 +1014,7 @@ tryagain:
(void) tsleep((caddr_t)&lbolt,
PSOCK, "nqnfstry", 0);
trylater_delay *= nfs_backoff[trylater_cnt];
- if (trylater_cnt < 7)
+ if (trylater_cnt < NFS_NBACKOFF - 1)
trylater_cnt++;
goto tryagain;
}
@@ -1088,7 +1089,7 @@ nfs_timer(void *arg)
timeo *= nfs_backoff[nmp->nm_timeouts - 1];
if (rep->r_rtt <= timeo)
continue;
- if (nmp->nm_timeouts < 8)
+ if (nmp->nm_timeouts < NFS_NBACKOFF)
nmp->nm_timeouts++;
}
/*
OpenPOWER on IntegriCloud