diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 13:16:31 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 16:07:39 -0400 |
commit | 3da28eb1c6545fe73263a24eba0996217490e1eb (patch) | |
tree | 944ccf9418c75a5c0b121f2c554c92dc93de1efa /include | |
parent | c6a556b88adfacd2af90be84357c8165d716c27d (diff) |
[PATCH] NFS: Replace nfs_page insertion sort with a radix sort
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nfs_fs.h | 4 | ||||
-rw-r--r-- | include/linux/nfs_page.h | 18 |
2 files changed, 18 insertions, 4 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 2954e44ed498..8ea249110fb0 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -395,10 +395,10 @@ extern void nfs_commit_done(struct rpc_task *); | |||
395 | */ | 395 | */ |
396 | extern int nfs_sync_inode(struct inode *, unsigned long, unsigned int, int); | 396 | extern int nfs_sync_inode(struct inode *, unsigned long, unsigned int, int); |
397 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 397 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
398 | extern int nfs_commit_inode(struct inode *, unsigned long, unsigned int, int); | 398 | extern int nfs_commit_inode(struct inode *, int); |
399 | #else | 399 | #else |
400 | static inline int | 400 | static inline int |
401 | nfs_commit_inode(struct inode *inode, unsigned long idx_start, unsigned int npages, int how) | 401 | nfs_commit_inode(struct inode *inode, int how) |
402 | { | 402 | { |
403 | return 0; | 403 | return 0; |
404 | } | 404 | } |
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index db40e4590ba2..da2e077b65e2 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
@@ -22,6 +22,7 @@ | |||
22 | /* | 22 | /* |
23 | * Valid flags for the radix tree | 23 | * Valid flags for the radix tree |
24 | */ | 24 | */ |
25 | #define NFS_PAGE_TAG_DIRTY 0 | ||
25 | #define NFS_PAGE_TAG_WRITEBACK 1 | 26 | #define NFS_PAGE_TAG_WRITEBACK 1 |
26 | 27 | ||
27 | /* | 28 | /* |
@@ -31,6 +32,7 @@ | |||
31 | #define PG_NEED_COMMIT 1 | 32 | #define PG_NEED_COMMIT 1 |
32 | #define PG_NEED_RESCHED 2 | 33 | #define PG_NEED_RESCHED 2 |
33 | 34 | ||
35 | struct nfs_inode; | ||
34 | struct nfs_page { | 36 | struct nfs_page { |
35 | struct list_head wb_list, /* Defines state of page: */ | 37 | struct list_head wb_list, /* Defines state of page: */ |
36 | *wb_list_head; /* read/write/commit */ | 38 | *wb_list_head; /* read/write/commit */ |
@@ -59,8 +61,8 @@ extern void nfs_clear_request(struct nfs_page *req); | |||
59 | extern void nfs_release_request(struct nfs_page *req); | 61 | extern void nfs_release_request(struct nfs_page *req); |
60 | 62 | ||
61 | 63 | ||
62 | extern void nfs_list_add_request(struct nfs_page *, struct list_head *); | 64 | extern int nfs_scan_lock_dirty(struct nfs_inode *nfsi, struct list_head *dst, |
63 | 65 | unsigned long idx_start, unsigned int npages); | |
64 | extern int nfs_scan_list(struct list_head *, struct list_head *, | 66 | extern int nfs_scan_list(struct list_head *, struct list_head *, |
65 | unsigned long, unsigned int); | 67 | unsigned long, unsigned int); |
66 | extern int nfs_coalesce_requests(struct list_head *, struct list_head *, | 68 | extern int nfs_coalesce_requests(struct list_head *, struct list_head *, |
@@ -94,6 +96,18 @@ nfs_lock_request(struct nfs_page *req) | |||
94 | return 1; | 96 | return 1; |
95 | } | 97 | } |
96 | 98 | ||
99 | /** | ||
100 | * nfs_list_add_request - Insert a request into a list | ||
101 | * @req: request | ||
102 | * @head: head of list into which to insert the request. | ||
103 | */ | ||
104 | static inline void | ||
105 | nfs_list_add_request(struct nfs_page *req, struct list_head *head) | ||
106 | { | ||
107 | list_add_tail(&req->wb_list, head); | ||
108 | req->wb_list_head = head; | ||
109 | } | ||
110 | |||
97 | 111 | ||
98 | /** | 112 | /** |
99 | * nfs_list_remove_request - Remove a request from its wb_list | 113 | * nfs_list_remove_request - Remove a request from its wb_list |