aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.h
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2012-03-08 17:29:35 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-10 17:14:10 -0500
commitd6d6dc7cdfda7c8f49a89a7b7261846f319da6d1 (patch)
treefd26cf912b676f2752c16ccce1f410872a2a485c /fs/nfs/pnfs.h
parent9994b62b5621f88828d442fcd03fe3ce4c43344b (diff)
NFS: remove nfs_inode radix tree
The radix tree is only being used to compile lists of reqs needing commit. It is simpler to just put the reqs directly into a list. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r--fs/nfs/pnfs.h82
1 files changed, 42 insertions, 40 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 8088d51f495e..ef92f676cf1e 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -94,11 +94,10 @@ struct pnfs_layoutdriver_type {
94 const struct nfs_pageio_ops *pg_read_ops; 94 const struct nfs_pageio_ops *pg_read_ops;
95 const struct nfs_pageio_ops *pg_write_ops; 95 const struct nfs_pageio_ops *pg_write_ops;
96 96
97 /* Returns true if layoutdriver wants to divert this request to 97 struct list_head * (*choose_commit_list) (struct nfs_page *req,
98 * driver's commit routine. 98 struct pnfs_layout_segment *lseg);
99 */ 99 struct pnfs_layout_segment *(*remove_commit_req) (struct nfs_page *req);
100 bool (*mark_pnfs_commit)(struct pnfs_layout_segment *lseg); 100 int (*scan_commit_lists) (struct inode *inode, int max);
101 struct list_head * (*choose_commit_list) (struct nfs_page *req);
102 int (*commit_pagelist)(struct inode *inode, struct list_head *mds_pages, int how); 101 int (*commit_pagelist)(struct inode *inode, struct list_head *mds_pages, int how);
103 102
104 /* 103 /*
@@ -262,20 +261,6 @@ static inline int pnfs_enabled_sb(struct nfs_server *nfss)
262 return nfss->pnfs_curr_ld != NULL; 261 return nfss->pnfs_curr_ld != NULL;
263} 262}
264 263
265static inline void
266pnfs_mark_request_commit(struct nfs_page *req, struct pnfs_layout_segment *lseg)
267{
268 if (lseg) {
269 struct pnfs_layoutdriver_type *ld;
270
271 ld = NFS_SERVER(req->wb_page->mapping->host)->pnfs_curr_ld;
272 if (ld->mark_pnfs_commit && ld->mark_pnfs_commit(lseg)) {
273 set_bit(PG_PNFS_COMMIT, &req->wb_flags);
274 req->wb_commit_lseg = get_lseg(lseg);
275 }
276 }
277}
278
279static inline int 264static inline int
280pnfs_commit_list(struct inode *inode, struct list_head *mds_pages, int how) 265pnfs_commit_list(struct inode *inode, struct list_head *mds_pages, int how)
281{ 266{
@@ -285,26 +270,38 @@ pnfs_commit_list(struct inode *inode, struct list_head *mds_pages, int how)
285} 270}
286 271
287static inline struct list_head * 272static inline struct list_head *
288pnfs_choose_commit_list(struct nfs_page *req, struct list_head *mds) 273pnfs_choose_commit_list(struct nfs_page *req, struct pnfs_layout_segment *lseg)
289{ 274{
275 struct inode *inode = req->wb_context->dentry->d_inode;
290 struct list_head *rv; 276 struct list_head *rv;
291 277
292 if (test_and_clear_bit(PG_PNFS_COMMIT, &req->wb_flags)) { 278 if (lseg && NFS_SERVER(inode)->pnfs_curr_ld->choose_commit_list)
293 struct inode *inode = req->wb_commit_lseg->pls_layout->plh_inode; 279 rv = NFS_SERVER(inode)->pnfs_curr_ld->choose_commit_list(req, lseg);
294 280 else
295 set_bit(NFS_INO_PNFS_COMMIT, &NFS_I(inode)->flags); 281 rv = &NFS_I(inode)->commit_list;
296 rv = NFS_SERVER(inode)->pnfs_curr_ld->choose_commit_list(req);
297 /* matched by ref taken when PG_PNFS_COMMIT is set */
298 put_lseg(req->wb_commit_lseg);
299 } else
300 rv = mds;
301 return rv; 282 return rv;
302} 283}
303 284
304static inline void pnfs_clear_request_commit(struct nfs_page *req) 285static inline struct pnfs_layout_segment *
286pnfs_clear_request_commit(struct nfs_page *req)
305{ 287{
306 if (test_and_clear_bit(PG_PNFS_COMMIT, &req->wb_flags)) 288 struct inode *inode = req->wb_context->dentry->d_inode;
307 put_lseg(req->wb_commit_lseg); 289
290 if (NFS_SERVER(inode)->pnfs_curr_ld &&
291 NFS_SERVER(inode)->pnfs_curr_ld->remove_commit_req)
292 return NFS_SERVER(inode)->pnfs_curr_ld->remove_commit_req(req);
293 else
294 return NULL;
295}
296
297static inline int
298pnfs_scan_commit_lists(struct inode *inode, int max)
299{
300 if (NFS_SERVER(inode)->pnfs_curr_ld &&
301 NFS_SERVER(inode)->pnfs_curr_ld->scan_commit_lists)
302 return NFS_SERVER(inode)->pnfs_curr_ld->scan_commit_lists(inode, max);
303 else
304 return 0;
308} 305}
309 306
310/* Should the pNFS client commit and return the layout upon a setattr */ 307/* Should the pNFS client commit and return the layout upon a setattr */
@@ -400,11 +397,6 @@ static inline bool pnfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, st
400 return false; 397 return false;
401} 398}
402 399
403static inline void
404pnfs_mark_request_commit(struct nfs_page *req, struct pnfs_layout_segment *lseg)
405{
406}
407
408static inline int 400static inline int
409pnfs_commit_list(struct inode *inode, struct list_head *mds_pages, int how) 401pnfs_commit_list(struct inode *inode, struct list_head *mds_pages, int how)
410{ 402{
@@ -412,13 +404,23 @@ pnfs_commit_list(struct inode *inode, struct list_head *mds_pages, int how)
412} 404}
413 405
414static inline struct list_head * 406static inline struct list_head *
415pnfs_choose_commit_list(struct nfs_page *req, struct list_head *mds) 407pnfs_choose_commit_list(struct nfs_page *req, struct pnfs_layout_segment *lseg)
416{ 408{
417 return mds; 409 struct inode *inode = req->wb_context->dentry->d_inode;
410
411 return &NFS_I(inode)->commit_list;
418} 412}
419 413
420static inline void pnfs_clear_request_commit(struct nfs_page *req) 414static inline struct pnfs_layout_segment *
415pnfs_clear_request_commit(struct nfs_page *req)
421{ 416{
417 return NULL;
418}
419
420static inline int
421pnfs_scan_commit_lists(struct inode *inode, int max)
422{
423 return 0;
422} 424}
423 425
424static inline int pnfs_layoutcommit_inode(struct inode *inode, bool sync) 426static inline int pnfs_layoutcommit_inode(struct inode *inode, bool sync)