aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-06-17 15:40:59 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-10 23:40:26 -0400
commit2aefa104313996d1a9582476cee53d1296c834bf (patch)
tree858c9af6784949b714e728be52ffde7fba842811
parent5c36968343fcd013a3f7ae93f246c2e75596780b (diff)
NFS: Remove the redundant 'dirty' and 'commit' lists from nfs_inode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/inode.c3
-rw-r--r--fs/nfs/write.c3
-rw-r--r--include/linux/nfs_fs.h5
-rw-r--r--include/linux/nfs_page.h5
4 files changed, 2 insertions, 14 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 7bcb3dfa6179..e7d2bba900b5 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1149,14 +1149,11 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
1149 1149
1150 inode_init_once(&nfsi->vfs_inode); 1150 inode_init_once(&nfsi->vfs_inode);
1151 spin_lock_init(&nfsi->req_lock); 1151 spin_lock_init(&nfsi->req_lock);
1152 INIT_LIST_HEAD(&nfsi->dirty);
1153 INIT_LIST_HEAD(&nfsi->commit);
1154 INIT_LIST_HEAD(&nfsi->open_files); 1152 INIT_LIST_HEAD(&nfsi->open_files);
1155 INIT_LIST_HEAD(&nfsi->access_cache_entry_lru); 1153 INIT_LIST_HEAD(&nfsi->access_cache_entry_lru);
1156 INIT_LIST_HEAD(&nfsi->access_cache_inode_lru); 1154 INIT_LIST_HEAD(&nfsi->access_cache_inode_lru);
1157 INIT_RADIX_TREE(&nfsi->nfs_page_tree, GFP_ATOMIC); 1155 INIT_RADIX_TREE(&nfsi->nfs_page_tree, GFP_ATOMIC);
1158 atomic_set(&nfsi->data_updates, 0); 1156 atomic_set(&nfsi->data_updates, 0);
1159 nfsi->ndirty = 0;
1160 nfsi->ncommit = 0; 1157 nfsi->ncommit = 0;
1161 nfsi->npages = 0; 1158 nfsi->npages = 0;
1162 nfs4_init_once(nfsi); 1159 nfs4_init_once(nfsi);
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 0f779ca12ec3..9ef9ec746bfb 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -459,7 +459,6 @@ nfs_mark_request_commit(struct nfs_page *req)
459 struct nfs_inode *nfsi = NFS_I(inode); 459 struct nfs_inode *nfsi = NFS_I(inode);
460 460
461 spin_lock(&nfsi->req_lock); 461 spin_lock(&nfsi->req_lock);
462 nfs_list_add_request(req, &nfsi->commit);
463 nfsi->ncommit++; 462 nfsi->ncommit++;
464 set_bit(PG_NEED_COMMIT, &(req)->wb_flags); 463 set_bit(PG_NEED_COMMIT, &(req)->wb_flags);
465 radix_tree_tag_set(&nfsi->nfs_page_tree, 464 radix_tree_tag_set(&nfsi->nfs_page_tree,
@@ -581,8 +580,6 @@ nfs_scan_commit(struct inode *inode, struct list_head *dst, pgoff_t idx_start, u
581 res = nfs_scan_list(nfsi, dst, idx_start, npages, 580 res = nfs_scan_list(nfsi, dst, idx_start, npages,
582 NFS_PAGE_TAG_COMMIT); 581 NFS_PAGE_TAG_COMMIT);
583 nfsi->ncommit -= res; 582 nfsi->ncommit -= res;
584 if ((nfsi->ncommit == 0) != list_empty(&nfsi->commit))
585 printk(KERN_ERR "NFS: desynchronized value of nfs_i.ncommit.\n");
586 } 583 }
587 return res; 584 return res;
588} 585}
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 07eea8f64ecf..a94205476736 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -156,12 +156,9 @@ struct nfs_inode {
156 * This is the list of dirty unwritten pages. 156 * This is the list of dirty unwritten pages.
157 */ 157 */
158 spinlock_t req_lock; 158 spinlock_t req_lock;
159 struct list_head dirty;
160 struct list_head commit;
161 struct radix_tree_root nfs_page_tree; 159 struct radix_tree_root nfs_page_tree;
162 160
163 unsigned int ndirty, 161 unsigned int ncommit,
164 ncommit,
165 npages; 162 npages;
166 163
167 /* Open contexts for shared mmap writes */ 164 /* Open contexts for shared mmap writes */
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 481a42105d69..78e60798d10e 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -34,8 +34,7 @@
34 34
35struct nfs_inode; 35struct nfs_inode;
36struct nfs_page { 36struct nfs_page {
37 struct list_head wb_list, /* Defines state of page: */ 37 struct list_head wb_list; /* Defines state of page: */
38 *wb_list_head; /* read/write/commit */
39 struct page *wb_page; /* page to read in/write out */ 38 struct page *wb_page; /* page to read in/write out */
40 struct nfs_open_context *wb_context; /* File state context info */ 39 struct nfs_open_context *wb_context; /* File state context info */
41 atomic_t wb_complete; /* i/os we're waiting for */ 40 atomic_t wb_complete; /* i/os we're waiting for */
@@ -118,7 +117,6 @@ static inline void
118nfs_list_add_request(struct nfs_page *req, struct list_head *head) 117nfs_list_add_request(struct nfs_page *req, struct list_head *head)
119{ 118{
120 list_add_tail(&req->wb_list, head); 119 list_add_tail(&req->wb_list, head);
121 req->wb_list_head = head;
122} 120}
123 121
124 122
@@ -132,7 +130,6 @@ nfs_list_remove_request(struct nfs_page *req)
132 if (list_empty(&req->wb_list)) 130 if (list_empty(&req->wb_list))
133 return; 131 return;
134 list_del_init(&req->wb_list); 132 list_del_init(&req->wb_list);
135 req->wb_list_head = NULL;
136} 133}
137 134
138static inline struct nfs_page * 135static inline struct nfs_page *