]> Pileus Git - ~andy/linux/blobdiff - fs/nfs/write.c
NFS: make 2 functions static
[~andy/linux] / fs / nfs / write.c
index f21e268705c0998c48c4ae4adfeae0c0efbf146d..50774991f8d56f845b1a79ced47f6e526557306d 100644 (file)
@@ -46,7 +46,6 @@
  * Copyright (C) 1996, 1997, Olaf Kirch <okir@monad.swb.de>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/slab.h>
 #include <linux/mm.h>
@@ -138,7 +137,7 @@ struct nfs_write_data *nfs_writedata_alloc(unsigned int pagecount)
        return p;
 }
 
-void nfs_writedata_free(struct nfs_write_data *p)
+static void nfs_writedata_free(struct nfs_write_data *p)
 {
        if (p && (p->pagevec != &p->page_array[0]))
                kfree(p->pagevec);
@@ -579,7 +578,7 @@ static int nfs_wait_on_requests(struct inode *inode, unsigned long idx_start, un
        return ret;
 }
 
-static void nfs_cancel_requests(struct list_head *head)
+static void nfs_cancel_dirty_list(struct list_head *head)
 {
        struct nfs_page *req;
        while(!list_empty(head)) {
@@ -590,6 +589,19 @@ static void nfs_cancel_requests(struct list_head *head)
        }
 }
 
+static void nfs_cancel_commit_list(struct list_head *head)
+{
+       struct nfs_page *req;
+
+       while(!list_empty(head)) {
+               req = nfs_list_entry(head->next);
+               nfs_list_remove_request(req);
+               nfs_inode_remove_request(req);
+               nfs_clear_page_writeback(req);
+               dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
+       }
+}
+
 /*
  * nfs_scan_dirty - Scan an inode for dirty requests
  * @inode: NFS inode to scan
@@ -1382,6 +1394,7 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how)
                nfs_list_remove_request(req);
                nfs_mark_request_commit(req);
                nfs_clear_page_writeback(req);
+               dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
        }
        return -ENOMEM;
 }
@@ -1500,7 +1513,7 @@ int nfs_sync_inode_wait(struct inode *inode, unsigned long idx_start,
                if (pages != 0) {
                        spin_unlock(&nfsi->req_lock);
                        if (how & FLUSH_INVALIDATE)
-                               nfs_cancel_requests(&head);
+                               nfs_cancel_dirty_list(&head);
                        else
                                ret = nfs_flush_list(inode, &head, pages, how);
                        spin_lock(&nfsi->req_lock);
@@ -1513,7 +1526,7 @@ int nfs_sync_inode_wait(struct inode *inode, unsigned long idx_start,
                        break;
                if (how & FLUSH_INVALIDATE) {
                        spin_unlock(&nfsi->req_lock);
-                       nfs_cancel_requests(&head);
+                       nfs_cancel_commit_list(&head);
                        spin_lock(&nfsi->req_lock);
                        continue;
                }