NLM: Remove address eye-catcher buffers from nlm_host

The h_name field in struct nlm_host is a just copy of
h_nsmhandle->sm_name.  Likewise, the contents of the h_addrbuf field
should be identical to the sm_addrbuf field.

The h_srcaddrbuf field is used only in one place for debugging.  We can
live without this until we get %pI formatting for printk().

Currently these buffers are 48 bytes, but we need to support scope IDs
in IPv6 presentation addresses, which means making the buffers even
larger.  Instead, let's find ways to eliminate them to save space.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
This commit is contained in:
Chuck Lever 2008-12-04 14:19:53 -05:00 committed by J. Bruce Fields
parent 7538ce1eb6
commit 1df40b609a
2 changed files with 4 additions and 10 deletions

View file

@ -206,6 +206,7 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni)
goto out; goto out;
} }
host->h_name = nsm->sm_name; host->h_name = nsm->sm_name;
host->h_addrbuf = nsm->sm_addrbuf;
memcpy(nlm_addr(host), ni->sap, ni->salen); memcpy(nlm_addr(host), ni->sap, ni->salen);
host->h_addrlen = ni->salen; host->h_addrlen = ni->salen;
nlm_clear_port(nlm_addr(host)); nlm_clear_port(nlm_addr(host));
@ -232,11 +233,6 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni)
nrhosts++; nrhosts++;
nlm_display_address((struct sockaddr *)&host->h_addr,
host->h_addrbuf, sizeof(host->h_addrbuf));
nlm_display_address((struct sockaddr *)&host->h_srcaddr,
host->h_srcaddrbuf, sizeof(host->h_srcaddrbuf));
dprintk("lockd: nlm_lookup_host created host %s\n", dprintk("lockd: nlm_lookup_host created host %s\n",
host->h_name); host->h_name);
@ -378,8 +374,8 @@ nlm_bind_host(struct nlm_host *host)
{ {
struct rpc_clnt *clnt; struct rpc_clnt *clnt;
dprintk("lockd: nlm_bind_host %s (%s), my addr=%s\n", dprintk("lockd: nlm_bind_host %s (%s)\n",
host->h_name, host->h_addrbuf, host->h_srcaddrbuf); host->h_name, host->h_addrbuf);
/* Lock host handle */ /* Lock host handle */
mutex_lock(&host->h_mutex); mutex_lock(&host->h_mutex);

View file

@ -65,9 +65,7 @@ struct nlm_host {
struct list_head h_granted; /* Locks in GRANTED state */ struct list_head h_granted; /* Locks in GRANTED state */
struct list_head h_reclaim; /* Locks in RECLAIM state */ struct list_head h_reclaim; /* Locks in RECLAIM state */
struct nsm_handle *h_nsmhandle; /* NSM status handle */ struct nsm_handle *h_nsmhandle; /* NSM status handle */
char *h_addrbuf; /* address eyecatcher */
char h_addrbuf[48], /* address eyecatchers */
h_srcaddrbuf[48];
}; };
struct nsm_handle { struct nsm_handle {