aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-05 00:36:56 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-06 10:46:41 -0500
commit9cf85e0a243b56f4ef8439a1e6430307fd9dcda6 (patch)
treec07fa0bb952827d76e556ac60a9310638e7a5d4a /fs/nfs
parent3925675cb37cc9c3fd1d3f56ce0fa729f995f863 (diff)
NFS: Fix up writeback_control->nr_to_write accounting
We're really accounting for the same page twice now: once in generic_writepages(), and once in nfs_scan_dirty(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/pagelist.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 47ae2b4dd1d4..bc9fab68b29c 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -288,11 +288,10 @@ long nfs_scan_dirty(struct address_space *mapping,
288 struct nfs_page *pgvec[NFS_SCAN_MAXENTRIES]; 288 struct nfs_page *pgvec[NFS_SCAN_MAXENTRIES];
289 struct nfs_page *req; 289 struct nfs_page *req;
290 pgoff_t idx_start, idx_end; 290 pgoff_t idx_start, idx_end;
291 long count = wbc->nr_to_write;
292 long res = 0; 291 long res = 0;
293 int found, i; 292 int found, i;
294 293
295 if (nfsi->ndirty == 0 || count <= 0) 294 if (nfsi->ndirty == 0)
296 return 0; 295 return 0;
297 if (wbc->range_cyclic) { 296 if (wbc->range_cyclic) {
298 idx_start = 0; 297 idx_start = 0;
@@ -308,8 +307,6 @@ long nfs_scan_dirty(struct address_space *mapping,
308 for (;;) { 307 for (;;) {
309 unsigned int toscan = NFS_SCAN_MAXENTRIES; 308 unsigned int toscan = NFS_SCAN_MAXENTRIES;
310 309
311 if (toscan > count)
312 toscan = count;
313 found = radix_tree_gang_lookup_tag(&nfsi->nfs_page_tree, 310 found = radix_tree_gang_lookup_tag(&nfsi->nfs_page_tree,
314 (void **)&pgvec[0], idx_start, toscan, 311 (void **)&pgvec[0], idx_start, toscan,
315 NFS_PAGE_TAG_DIRTY); 312 NFS_PAGE_TAG_DIRTY);
@@ -334,16 +331,11 @@ long nfs_scan_dirty(struct address_space *mapping,
334 res++; 331 res++;
335 if (res == LONG_MAX) 332 if (res == LONG_MAX)
336 goto out; 333 goto out;
337 count--;
338 if (count == 0)
339 goto out;
340
341next: 334next:
342 idx_start = req->wb_index + 1; 335 idx_start = req->wb_index + 1;
343 } 336 }
344 } 337 }
345out: 338out:
346 wbc->nr_to_write = count;
347 WARN_ON ((nfsi->ndirty == 0) != list_empty(&nfsi->dirty)); 339 WARN_ON ((nfsi->ndirty == 0) != list_empty(&nfsi->dirty));
348 return res; 340 return res;
349} 341}