aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/lockd/lockd.h
diff options
context:
space:
mode:
authorOlaf Kirch <okir@suse.de>2006-10-04 05:15:53 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 10:55:16 -0400
commit8dead0dbd478f35fd943f3719591e5af1ac0950d (patch)
tree05ad7dd248263cbeecc4f3d0b4cbb3ec06c65626 /include/linux/lockd/lockd.h
parentdb4e4c9a9e741ee812e1febf5e386d6a24218a71 (diff)
[PATCH] knfsd: lockd: introduce nsm_handle
This patch introduces the nsm_handle, which is shared by all nlm_host objects referring to the same client. With this patch applied, all nlm_hosts from the same address will share the same nsm_handle. A future patch will add sharing by name. Note: this patch changes h_name so that it is no longer guaranteed to be an IP address of the host. When the host represents an NFS server, h_name will be the name passed in the mount call. When the host represents a client, h_name will be the name presented in the lock request received from the client. A h_name is only used for printing informational messages, this change should not be significant. Signed-off-by: Olaf Kirch <okir@suse.de> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/lockd/lockd.h')
-rw-r--r--include/linux/lockd/lockd.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 0f9b236bca7f..ab2ffc8a0b44 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -40,14 +40,13 @@ struct nlm_host {
40 struct nlm_host * h_next; /* linked list (hash table) */ 40 struct nlm_host * h_next; /* linked list (hash table) */
41 struct sockaddr_in h_addr; /* peer address */ 41 struct sockaddr_in h_addr; /* peer address */
42 struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ 42 struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */
43 char h_name[20]; /* remote hostname */ 43 char * h_name; /* remote hostname */
44 u32 h_version; /* interface version */ 44 u32 h_version; /* interface version */
45 unsigned short h_proto; /* transport proto */ 45 unsigned short h_proto; /* transport proto */
46 unsigned short h_reclaiming : 1, 46 unsigned short h_reclaiming : 1,
47 h_server : 1, /* server side, not client side */ 47 h_server : 1, /* server side, not client side */
48 h_inuse : 1, 48 h_inuse : 1,
49 h_killed : 1, 49 h_killed : 1;
50 h_monitored : 1;
51 wait_queue_head_t h_gracewait; /* wait while reclaiming */ 50 wait_queue_head_t h_gracewait; /* wait while reclaiming */
52 struct rw_semaphore h_rwsem; /* Reboot recovery lock */ 51 struct rw_semaphore h_rwsem; /* Reboot recovery lock */
53 u32 h_state; /* pseudo-state counter */ 52 u32 h_state; /* pseudo-state counter */
@@ -61,6 +60,16 @@ struct nlm_host {
61 spinlock_t h_lock; 60 spinlock_t h_lock;
62 struct list_head h_granted; /* Locks in GRANTED state */ 61 struct list_head h_granted; /* Locks in GRANTED state */
63 struct list_head h_reclaim; /* Locks in RECLAIM state */ 62 struct list_head h_reclaim; /* Locks in RECLAIM state */
63 struct nsm_handle * h_nsmhandle; /* NSM status handle */
64};
65
66struct nsm_handle {
67 struct list_head sm_link;
68 atomic_t sm_count;
69 char * sm_name;
70 struct sockaddr_in sm_addr;
71 unsigned int sm_monitored : 1,
72 sm_sticky : 1; /* don't unmonitor */
64}; 73};
65 74
66/* 75/*
@@ -171,6 +180,8 @@ void nlm_release_host(struct nlm_host *);
171void nlm_shutdown_hosts(void); 180void nlm_shutdown_hosts(void);
172extern struct nlm_host *nlm_find_client(void); 181extern struct nlm_host *nlm_find_client(void);
173extern void nlm_host_rebooted(const struct sockaddr_in *, const struct nlm_reboot *); 182extern void nlm_host_rebooted(const struct sockaddr_in *, const struct nlm_reboot *);
183struct nsm_handle *nsm_find(const struct sockaddr_in *, const char *, int);
184void nsm_release(struct nsm_handle *);
174 185
175 186
176/* 187/*