aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-04-02 18:48:28 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-05-01 01:17:04 -0400
commitd8a5ad75cc4d577987964e37a4c43b1c648c201e (patch)
tree91604bf17f7a81cc60a214426c7ddca89bf4faee /fs/nfs/write.c
parent91e59c368c6ba5eed0369a085c42c9f270b97aa8 (diff)
NFS: Cleanup the coalescing code
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index dbad89c8e427..b03ec1ba4d75 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -945,9 +945,8 @@ static int nfs_flush_one(struct inode *inode, struct list_head *head, int how)
945 945
946static int nfs_flush_list(struct inode *inode, struct list_head *head, int npages, int how) 946static int nfs_flush_list(struct inode *inode, struct list_head *head, int npages, int how)
947{ 947{
948 LIST_HEAD(one_request); 948 struct nfs_pageio_descriptor desc;
949 int (*flush_one)(struct inode *, struct list_head *, int); 949 int (*flush_one)(struct inode *, struct list_head *, int);
950 struct nfs_page *req;
951 int wpages = NFS_SERVER(inode)->wpages; 950 int wpages = NFS_SERVER(inode)->wpages;
952 int wsize = NFS_SERVER(inode)->wsize; 951 int wsize = NFS_SERVER(inode)->wsize;
953 int error; 952 int error;
@@ -961,16 +960,16 @@ static int nfs_flush_list(struct inode *inode, struct list_head *head, int npage
961 how |= FLUSH_STABLE; 960 how |= FLUSH_STABLE;
962 961
963 do { 962 do {
964 nfs_coalesce_requests(head, &one_request, wpages); 963 nfs_pageio_init(&desc, wsize);
965 req = nfs_list_entry(one_request.next); 964 nfs_pageio_add_list(&desc, head);
966 error = flush_one(inode, &one_request, how); 965 error = flush_one(inode, &desc.pg_list, how);
967 if (error < 0) 966 if (error < 0)
968 goto out_err; 967 goto out_err;
969 } while (!list_empty(head)); 968 } while (!list_empty(head));
970 return 0; 969 return 0;
971out_err: 970out_err:
972 while (!list_empty(head)) { 971 while (!list_empty(head)) {
973 req = nfs_list_entry(head->next); 972 struct nfs_page *req = nfs_list_entry(head->next);
974 nfs_list_remove_request(req); 973 nfs_list_remove_request(req);
975 nfs_redirty_request(req); 974 nfs_redirty_request(req);
976 nfs_end_page_writeback(req->wb_page); 975 nfs_end_page_writeback(req->wb_page);