V4L/DVB (5272): Add V4L2_CAP_VIDEO_OUTPUT_POS capability
[safe/jmp/linux-2.6] / include / linux / nfs_page.h
index db40e45..16b0266 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/list.h>
 #include <linux/pagemap.h>
 #include <linux/wait.h>
-#include <linux/nfs_fs_sb.h>
 #include <linux/sunrpc/auth.h>
 #include <linux/nfs_xdr.h>
 
@@ -22,6 +21,7 @@
 /*
  * Valid flags for the radix tree
  */
+#define NFS_PAGE_TAG_DIRTY     0
 #define NFS_PAGE_TAG_WRITEBACK 1
 
 /*
@@ -30,7 +30,9 @@
 #define PG_BUSY                        0
 #define PG_NEED_COMMIT         1
 #define PG_NEED_RESCHED                2
+#define PG_NEED_FLUSH          3
 
+struct nfs_inode;
 struct nfs_page {
        struct list_head        wb_list,        /* Defines state of page: */
                                *wb_list_head;  /*      read/write/commit */
@@ -47,8 +49,6 @@ struct nfs_page {
 };
 
 #define NFS_WBACK_BUSY(req)    (test_bit(PG_BUSY,&(req)->wb_flags))
-#define NFS_NEED_COMMIT(req)   (test_bit(PG_NEED_COMMIT,&(req)->wb_flags))
-#define NFS_NEED_RESCHED(req)  (test_bit(PG_NEED_RESCHED,&(req)->wb_flags))
 
 extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx,
                                            struct inode *inode,
@@ -59,10 +59,11 @@ 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_list(struct list_head *, struct list_head *,
-                         unsigned long, unsigned int);
+extern long nfs_scan_dirty(struct address_space *mapping,
+                               struct writeback_control *wbc,
+                               struct list_head *dst);
+extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, struct list_head *dst,
+                         unsigned long idx_start, unsigned int npages);
 extern int nfs_coalesce_requests(struct list_head *, struct list_head *,
                                  unsigned int);
 extern  int nfs_wait_on_request(struct nfs_page *);
@@ -77,9 +78,7 @@ extern  void nfs_clear_page_writeback(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);
 }
 
 /*
@@ -94,6 +93,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
@@ -108,38 +119,6 @@ nfs_list_remove_request(struct nfs_page *req)
        req->wb_list_head = NULL;
 }
 
-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;
-}
-
-static inline void
-nfs_clear_commit(struct nfs_page *req)
-{
-       smp_mb__before_clear_bit();
-       clear_bit(PG_NEED_COMMIT, &req->wb_flags);
-       smp_mb__after_clear_bit();
-}
-
-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;
-}
-
-static inline void
-nfs_clear_reschedule(struct nfs_page *req)
-{
-       smp_mb__before_clear_bit();
-       clear_bit(PG_NEED_RESCHED, &req->wb_flags);
-       smp_mb__after_clear_bit();
-}
-
 static inline struct nfs_page *
 nfs_list_entry(struct list_head *head)
 {