Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[cascardo/linux.git] / include / linux / lockd / lockd.h
index 862d973..05707e2 100644 (file)
@@ -88,7 +88,7 @@ struct nlm_wait;
 /*
  * Memory chunk for NLM client RPC request.
  */
-#define NLMCLNT_OHSIZE         (sizeof(utsname()->nodename)+10)
+#define NLMCLNT_OHSIZE         ((__NEW_UTS_LEN) + 10u)
 struct nlm_rqst {
        unsigned int            a_flags;        /* initial RPC task flags */
        struct nlm_host *       a_host;         /* host handle */
@@ -119,6 +119,9 @@ struct nlm_file {
  * couldn't be granted because of a conflicting lock).
  */
 #define NLM_NEVER              (~(unsigned long) 0)
+/* timeout on non-blocking call: */
+#define NLM_TIMEOUT            (7 * HZ)
+
 struct nlm_block {
        struct kref             b_count;        /* Reference count */
        struct list_head        b_list;         /* linked list of all blocks */
@@ -130,6 +133,13 @@ struct nlm_block {
        unsigned int            b_id;           /* block id */
        unsigned char           b_granted;      /* VFS granted lock */
        struct nlm_file *       b_file;         /* file in question */
+       struct cache_req *      b_cache_req;    /* deferred request handling */
+       struct file_lock *      b_fl;           /* set for GETLK */
+       struct cache_deferred_req * b_deferred_req;
+       unsigned int            b_flags;        /* block flags */
+#define B_QUEUED               1       /* lock queued */
+#define B_GOT_CALLBACK         2       /* got lock or conflicting lock */
+#define B_TIMED_OUT            4       /* filesystem too slow to respond */
 };
 
 /*
@@ -164,14 +174,12 @@ void                nlmclnt_next_cookie(struct nlm_cookie *);
  */
 struct nlm_host * nlmclnt_lookup_host(const struct sockaddr_in *, int, int, const char *, int);
 struct nlm_host * nlmsvc_lookup_host(struct svc_rqst *, const char *, int);
-struct nlm_host * nlm_lookup_host(int server, const struct sockaddr_in *, int, int, const char *, 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 *);
 void             nlm_release_host(struct nlm_host *);
 void             nlm_shutdown_hosts(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 *);
 
 
@@ -187,13 +195,13 @@ typedef int         (*nlm_host_match_fn_t)(struct nlm_host *cur, struct nlm_host *ref)
 __be32           nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
                                        struct nlm_lock *, int, struct nlm_cookie *);
 __be32           nlmsvc_unlock(struct nlm_file *, struct nlm_lock *);
-__be32           nlmsvc_testlock(struct nlm_file *, struct nlm_lock *,
-                                       struct nlm_lock *);
+__be32           nlmsvc_testlock(struct svc_rqst *, struct nlm_file *,
+                       struct nlm_lock *, struct nlm_lock *, struct nlm_cookie *);
 __be32           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 *,
                                        nlm_host_match_fn_t match);
-void             nlmsvc_grant_reply(struct nlm_cookie *, u32);
+void             nlmsvc_grant_reply(struct nlm_cookie *, __be32);
 
 /*
  * File handling for the server personality
@@ -208,7 +216,7 @@ void                  nlmsvc_invalidate_all(void);
 static __inline__ struct inode *
 nlmsvc_file_inode(struct nlm_file *file)
 {
-       return file->f_file->f_dentry->d_inode;
+       return file->f_file->f_path.dentry->d_inode;
 }
 
 /*