Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / include / linux / nfs_page.h
index 39e4895..66e2ed6 100644 (file)
 
 #include <asm/atomic.h>
 
+/*
+ * Valid flags for the radix tree
+ */
+#define NFS_PAGE_TAG_DIRTY     0
+#define NFS_PAGE_TAG_WRITEBACK 1
+
 /*
  * Valid flags for a dirty buffer
  */
@@ -26,6 +32,7 @@
 #define PG_NEED_COMMIT         1
 #define PG_NEED_RESCHED                2
 
+struct nfs_inode;
 struct nfs_page {
        struct list_head        wb_list,        /* Defines state of page: */
                                *wb_list_head;  /*      read/write/commit */
@@ -54,14 +61,17 @@ extern      void nfs_clear_request(struct nfs_page *req);
 extern void nfs_release_request(struct nfs_page *req);
 
 
-extern void nfs_list_add_request(struct nfs_page *, struct list_head *);
-
+extern  int nfs_scan_lock_dirty(struct nfs_inode *nfsi, struct list_head *dst,
+                               unsigned long idx_start, unsigned int npages);
 extern int nfs_scan_list(struct list_head *, struct list_head *,
                          unsigned long, unsigned int);
 extern int nfs_coalesce_requests(struct list_head *, struct list_head *,
                                  unsigned int);
 extern  int nfs_wait_on_request(struct nfs_page *);
 extern void nfs_unlock_request(struct nfs_page *req);
+extern  int nfs_set_page_writeback_locked(struct nfs_page *req);
+extern  void nfs_clear_page_writeback(struct nfs_page *req);
+
 
 /*
  * Lock the page of an asynchronous request without incrementing the wb_count
@@ -69,9 +79,7 @@ extern        void nfs_unlock_request(struct nfs_page *req);
 static inline int
 nfs_lock_request_dontget(struct nfs_page *req)
 {
-       if (test_and_set_bit(PG_BUSY, &req->wb_flags))
-               return 0;
-       return 1;
+       return !test_and_set_bit(PG_BUSY, &req->wb_flags);
 }
 
 /*
@@ -86,6 +94,18 @@ nfs_lock_request(struct nfs_page *req)
        return 1;
 }
 
+/**
+ * nfs_list_add_request - Insert a request into a list
+ * @req: request
+ * @head: head of list into which to insert the request.
+ */
+static inline void
+nfs_list_add_request(struct nfs_page *req, struct list_head *head)
+{
+       list_add_tail(&req->wb_list, head);
+       req->wb_list_head = head;
+}
+
 
 /**
  * nfs_list_remove_request - Remove a request from its wb_list
@@ -96,10 +116,6 @@ nfs_list_remove_request(struct nfs_page *req)
 {
        if (list_empty(&req->wb_list))
                return;
-       if (!NFS_WBACK_BUSY(req)) {
-               printk(KERN_ERR "NFS: unlocked request attempted removed from list!\n");
-               BUG();
-       }
        list_del_init(&req->wb_list);
        req->wb_list_head = NULL;
 }
@@ -107,9 +123,7 @@ nfs_list_remove_request(struct nfs_page *req)
 static inline int
 nfs_defer_commit(struct nfs_page *req)
 {
-       if (test_and_set_bit(PG_NEED_COMMIT, &req->wb_flags))
-               return 0;
-       return 1;
+       return !test_and_set_bit(PG_NEED_COMMIT, &req->wb_flags);
 }
 
 static inline void
@@ -123,9 +137,7 @@ nfs_clear_commit(struct nfs_page *req)
 static inline int
 nfs_defer_reschedule(struct nfs_page *req)
 {
-       if (test_and_set_bit(PG_NEED_RESCHED, &req->wb_flags))
-               return 0;
-       return 1;
+       return !test_and_set_bit(PG_NEED_RESCHED, &req->wb_flags);
 }
 
 static inline void