Commit d42f5634 authored by Neil Brown's avatar Neil Brown Committed by David S. Miller

[PATCH] kNFSd 9: Discard cl_addr

We currently store the address list with each
client and use it only to print out comments
on /proc/fs/nfs/exports
While these can be helpful, they are not critical and
could be added back later after we restructure the exports
table.
parent 5488bb08
...@@ -640,7 +640,6 @@ static int e_show(struct seq_file *m, void *p) ...@@ -640,7 +640,6 @@ static int e_show(struct seq_file *m, void *p)
struct svc_export *exp = p; struct svc_export *exp = p;
struct svc_client *clp; struct svc_client *clp;
char *pbuf; char *pbuf;
int j, first = 0;
if (p == (void *)1) { if (p == (void *)1) {
seq_puts(m, "# Version 1.1\n"); seq_puts(m, "# Version 1.1\n");
...@@ -659,31 +658,7 @@ static int e_show(struct seq_file *m, void *p) ...@@ -659,31 +658,7 @@ static int e_show(struct seq_file *m, void *p)
seq_putc(m, '('); seq_putc(m, '(');
exp_flags(m, exp->ex_flags, exp->ex_fsid, exp_flags(m, exp->ex_flags, exp->ex_fsid,
exp->ex_anon_uid, exp->ex_anon_gid); exp->ex_anon_uid, exp->ex_anon_gid);
seq_puts(m, ") # "); seq_puts(m, ")\n");
for (j = 0; j < clp->cl_naddr; j++) {
struct svc_clnthash **hp, **head, *tmp;
struct in_addr addr = clp->cl_addr[j];
head = &clnt_hash[CLIENT_HASH(addr.s_addr)];
for (hp = head; (tmp = *hp) != NULL; hp = &(tmp->h_next)) {
if (tmp->h_addr.s_addr == addr.s_addr)
break;
}
if (tmp) {
if (first++)
seq_putc(m, ' ');
if (tmp->h_client != clp)
seq_putc(m, '(');
seq_printf(m, "%d.%d.%d.%d",
htonl(addr.s_addr) >> 24 & 0xff,
htonl(addr.s_addr) >> 16 & 0xff,
htonl(addr.s_addr) >> 8 & 0xff,
htonl(addr.s_addr) >> 0 & 0xff);
if (tmp->h_client != clp)
seq_putc(m, ')');
}
}
seq_putc(m, '\n');
return 0; return 0;
} }
...@@ -751,19 +726,13 @@ exp_addclient(struct nfsctl_client *ncp) ...@@ -751,19 +726,13 @@ exp_addclient(struct nfsctl_client *ncp)
} }
} }
/* Copy addresses. */
for (i = 0; i < ncp->cl_naddr; i++) {
clp->cl_addr[i] = ncp->cl_addrlist[i];
}
clp->cl_naddr = ncp->cl_naddr;
/* Remove old client hash entries. */ /* Remove old client hash entries. */
if (change) if (change)
exp_unhashclient(clp); exp_unhashclient(clp);
/* Insert client into hashtable. */ /* Insert client into hashtable. */
for (i = 0; i < ncp->cl_naddr; i++) { for (i = 0; i < ncp->cl_naddr; i++) {
struct in_addr addr = clp->cl_addr[i]; struct in_addr addr = ncp->cl_addrlist[i];
int hash; int hash;
hash = CLIENT_HASH(addr.s_addr); hash = CLIENT_HASH(addr.s_addr);
...@@ -853,8 +822,6 @@ exp_unhashclient(svc_client *clp) ...@@ -853,8 +822,6 @@ exp_unhashclient(svc_client *clp)
} }
} }
} }
if (count != clp->cl_naddr)
printk(KERN_WARNING "nfsd: bad address count in freeclient!\n");
if (err) if (err)
goto again; goto again;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
......
...@@ -51,8 +51,6 @@ ...@@ -51,8 +51,6 @@
struct svc_client { struct svc_client {
struct svc_client * cl_next; struct svc_client * cl_next;
char cl_ident[NFSCLNT_IDMAX]; char cl_ident[NFSCLNT_IDMAX];
int cl_naddr;
struct in_addr cl_addr[NFSCLNT_ADDRMAX];
struct list_head cl_export[NFSCLNT_EXPMAX]; struct list_head cl_export[NFSCLNT_EXPMAX];
struct list_head cl_expfsid[NFSCLNT_EXPMAX]; struct list_head cl_expfsid[NFSCLNT_EXPMAX];
struct list_head cl_list; struct list_head cl_list;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment