diff options
| author | Neil Brown <neilb@cse.unsw.edu.au> | 2002-09-12 01:39:57 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2002-09-12 01:39:57 -0700 |
| commit | 151ddf2e384fa2d19d72ecf2f18c74d9ceb07fa2 (patch) | |
| tree | 95593a6b4b013bcca847f685247570d13e50ae62 /include/linux/lockd/lockd.h | |
| parent | f96e7cb1d1e2b1e40dc38d71cfcdf1a7ac606944 (diff) | |
[PATCH] kNFSd 3: Increase separation between lockd and nfsd.
lockd currently asks nfsd for a 'client handle' for each
request.
This is used as a key for finding (or creating) a 'nlm_host'
structure, so that there is only one of these per client...almost.
There can currently be up to 4 nlm_hosts for a given client,
depending on protocol (udp/tcp) or version (v1 or v4).
But this isn't handled very well.
So the question is: is there any advantage in having only on
nlm_host per real host, or have we simply have one for each IP
address that makes requests, whether they are separate hosts or not.
The nlm_host structure is used:
1/ to hold a lockd rpc client for talking to the
remote lockd. Having multiple lockd clients cannot hurt
except possibly to waste a little space.
2/ to identify resources to free when we receive notification
from statd that a client has restarted.
As statd gets a hostname and looks up all IP addresses,
and then sends a notification for each IP for which it has
a registration, there is no need to minimise the number
of nlm_host structures (each of which register for monitoring).
3/ to identify resources to free when a client sends a
"free_all" request. If a client uses multiple IP addresses to
create locks, and then sends free_all from just one IP address
we will loose here.
However it is not clear that a client would ever want to send
a free_all request, and the linux client doesn't seem to, so
there is unlikely to be any loss here.
This patch does not ask nfsd for a client identifier, but rather
finds an nlm_host based on IP, version, protocol (udp/tcp) and
whether we are acting as NFS server or client.
All of this information is then placed in the cookie that is
passed to statd and returned by statd when the client restarts.
Previously only the IP address was passing the cookie, so possibly
not all nlm_host structures would have been found.
Because of these changes, lockd does not need to know
anything about the nfsd export table, so the interface to
nfsd is much more narrow.
Another consequence is that when nfsd is told to delete a client,
it cannot tell lockd to forget all the locks for that client.
However it is not clear that lockd should ever forget any locks
unless it is told to shutdown (or simulate a shutdown), and in
anycase, the current nfsd admin tools never tell nfsd to delete
a client anyway.
Diffstat (limited to 'include/linux/lockd/lockd.h')
| -rw-r--r-- | include/linux/lockd/lockd.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index dbf013c3d890..556153082cd0 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h @@ -39,13 +39,13 @@ struct nlm_host { struct nlm_host * h_next; /* linked list (hash table) */ struct sockaddr_in h_addr; /* peer address */ - struct svc_client * h_exportent; /* NFS client */ struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ char h_name[20]; /* remote hostname */ u32 h_version; /* interface version */ unsigned short h_proto; /* transport proto */ unsigned short h_authflavor; /* RPC authentication type */ unsigned short h_reclaiming : 1, + h_server : 1, /* server side, not client side */ h_inuse : 1, h_killed : 1, h_monitored : 1; @@ -143,8 +143,7 @@ void nlmclnt_freegrantargs(struct nlm_rqst *); */ struct nlm_host * nlmclnt_lookup_host(struct sockaddr_in *, int, int); struct nlm_host * nlmsvc_lookup_host(struct svc_rqst *); -struct nlm_host * nlm_lookup_host(struct svc_client *, - struct sockaddr_in *, int, int); +struct nlm_host * nlm_lookup_host(int server, struct sockaddr_in *, int, int); struct rpc_clnt * nlm_bind_host(struct nlm_host *); void nlm_rebind_host(struct nlm_host *); struct nlm_host * nlm_get_host(struct nlm_host *); |
