[PATCH] knfsd: lockd: optionally use hostnames for identifying peers
[safe/jmp/linux-2.6] / include / linux / lockd / lockd.h
index 777a91e..7be7aea 100644 (file)
@@ -45,8 +45,7 @@ struct nlm_host {
        unsigned short          h_proto;        /* transport proto */
        unsigned short          h_reclaiming : 1,
                                h_server     : 1, /* server side, not client side */
-                               h_inuse      : 1,
-                               h_killed     : 1;
+                               h_inuse      : 1;
        wait_queue_head_t       h_gracewait;    /* wait while reclaiming */
        struct rw_semaphore     h_rwsem;        /* Reboot recovery lock */
        u32                     h_state;        /* pseudo-state counter */
@@ -134,13 +133,6 @@ struct nlm_block {
 };
 
 /*
- * Valid actions for nlmsvc_traverse_files
- */
-#define NLM_ACT_CHECK          0               /* check for locks */
-#define NLM_ACT_MARK           1               /* mark & sweep */
-#define NLM_ACT_UNLOCK         2               /* release all locks */
-
-/*
  * Global variables
  */
 extern struct rpc_program      nlm_program;
@@ -150,6 +142,7 @@ extern struct svc_procedure nlmsvc_procedures4[];
 #endif
 extern int                     nlmsvc_grace_period;
 extern unsigned long           nlmsvc_timeout;
+extern int                     nsm_use_hostnames;
 
 /*
  * Lockd client functions
@@ -176,13 +169,18 @@ void                nlm_rebind_host(struct nlm_host *);
 struct nlm_host * nlm_get_host(struct nlm_host *);
 void             nlm_release_host(struct nlm_host *);
 void             nlm_shutdown_hosts(void);
-extern struct nlm_host *nlm_find_client(void);
 extern void      nlm_host_rebooted(const struct sockaddr_in *, const char *, int, u32);
 struct nsm_handle *nsm_find(const struct sockaddr_in *, const char *, int);
 void             nsm_release(struct nsm_handle *);
 
 
 /*
+ * This is used in garbage collection and resource reclaim
+ * A return value != 0 means destroy the lock/block/share
+ */
+typedef int      (*nlm_host_match_fn_t)(struct nlm_host *cur, struct nlm_host *ref);
+
+/*
  * Server-side lock handling
  */
 u32              nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
@@ -193,7 +191,7 @@ u32           nlmsvc_testlock(struct nlm_file *, struct nlm_lock *,
 u32              nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
 unsigned long    nlmsvc_retry_blocked(void);
 void             nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
-                                       int action);
+                                       nlm_host_match_fn_t match);
 void     nlmsvc_grant_reply(struct svc_rqst *, struct nlm_cookie *, u32);
 
 /*