aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pagelist.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-06-17 15:27:42 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-10 23:40:26 -0400
commit5c36968343fcd013a3f7ae93f246c2e75596780b (patch)
tree96a3f2867e4631d84179952b1af170f3e48eae4b /fs/nfs/pagelist.c
parent9fd367f0f376ccfb2592eed9be0eece70429894f (diff)
NFS cleanup: speed up nfs_scan_commit using radix tree tags
Add a tag for requests that are waiting for a COMMIT Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r--fs/nfs/pagelist.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 23e9dea20902..ad90cbe76703 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -381,10 +381,10 @@ void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *desc, pgoff_t index)
381/** 381/**
382 * nfs_scan_list - Scan a list for matching requests 382 * nfs_scan_list - Scan a list for matching requests
383 * @nfsi: NFS inode 383 * @nfsi: NFS inode
384 * @head: One of the NFS inode request lists
385 * @dst: Destination list 384 * @dst: Destination list
386 * @idx_start: lower bound of page->index to scan 385 * @idx_start: lower bound of page->index to scan
387 * @npages: idx_start + npages sets the upper bound to scan. 386 * @npages: idx_start + npages sets the upper bound to scan.
387 * @tag: tag to scan for
388 * 388 *
389 * Moves elements from one of the inode request lists. 389 * Moves elements from one of the inode request lists.
390 * If the number of requests is set to 0, the entire address_space 390 * If the number of requests is set to 0, the entire address_space
@@ -392,9 +392,9 @@ void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *desc, pgoff_t index)
392 * The requests are *not* checked to ensure that they form a contiguous set. 392 * The requests are *not* checked to ensure that they form a contiguous set.
393 * You must be holding the inode's req_lock when calling this function 393 * You must be holding the inode's req_lock when calling this function
394 */ 394 */
395int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, 395int nfs_scan_list(struct nfs_inode *nfsi,
396 struct list_head *dst, pgoff_t idx_start, 396 struct list_head *dst, pgoff_t idx_start,
397 unsigned int npages) 397 unsigned int npages, int tag)
398{ 398{
399 struct nfs_page *pgvec[NFS_SCAN_MAXENTRIES]; 399 struct nfs_page *pgvec[NFS_SCAN_MAXENTRIES];
400 struct nfs_page *req; 400 struct nfs_page *req;
@@ -409,9 +409,9 @@ int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head,
409 idx_end = idx_start + npages - 1; 409 idx_end = idx_start + npages - 1;
410 410
411 for (;;) { 411 for (;;) {
412 found = radix_tree_gang_lookup(&nfsi->nfs_page_tree, 412 found = radix_tree_gang_lookup_tag(&nfsi->nfs_page_tree,
413 (void **)&pgvec[0], idx_start, 413 (void **)&pgvec[0], idx_start,
414 NFS_SCAN_MAXENTRIES); 414 NFS_SCAN_MAXENTRIES, tag);
415 if (found <= 0) 415 if (found <= 0)
416 break; 416 break;
417 for (i = 0; i < found; i++) { 417 for (i = 0; i < found; i++) {
@@ -419,10 +419,10 @@ int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head,
419 if (req->wb_index > idx_end) 419 if (req->wb_index > idx_end)
420 goto out; 420 goto out;
421 idx_start = req->wb_index + 1; 421 idx_start = req->wb_index + 1;
422 if (req->wb_list_head != head)
423 continue;
424 if (nfs_set_page_tag_locked(req)) { 422 if (nfs_set_page_tag_locked(req)) {
425 nfs_list_remove_request(req); 423 nfs_list_remove_request(req);
424 radix_tree_tag_clear(&nfsi->nfs_page_tree,
425 req->wb_index, tag);
426 nfs_list_add_request(req, dst); 426 nfs_list_add_request(req, dst);
427 res++; 427 res++;
428 } 428 }