aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.h
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-17 11:59:30 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-20 13:08:26 -0400
commit3b3be88d67cc17d0f0ab6edaf131516793fc947e (patch)
tree293bc2bcc7cf7a175786ec33a4e2aff8c5c7ebca /fs/nfs/pnfs.h
parent5ae67c4fee869c9b3c87b727a9ea511b6326b834 (diff)
NFS: Use cond_resched_lock() to reduce latencies in the commit scans
Ensure that we conditionally drop the inode->i_lock when it is safe to do so in the commit loops. We do so after locking the nfs_page, but before removing it from the commit list. We can then use list_safe_reset_next to recover the loop after the lock is retaken. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r--fs/nfs/pnfs.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index e98ff3027d3a..07802652f5a3 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -97,7 +97,7 @@ struct pnfs_layoutdriver_type {
97 void (*mark_request_commit) (struct nfs_page *req, 97 void (*mark_request_commit) (struct nfs_page *req,
98 struct pnfs_layout_segment *lseg); 98 struct pnfs_layout_segment *lseg);
99 void (*clear_request_commit) (struct nfs_page *req); 99 void (*clear_request_commit) (struct nfs_page *req);
100 int (*scan_commit_lists) (struct inode *inode, int max); 100 int (*scan_commit_lists) (struct inode *inode, int max, spinlock_t *lock);
101 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);
102 102
103 /* 103 /*
@@ -294,14 +294,14 @@ pnfs_clear_request_commit(struct nfs_page *req)
294} 294}
295 295
296static inline int 296static inline int
297pnfs_scan_commit_lists(struct inode *inode, int max) 297pnfs_scan_commit_lists(struct inode *inode, int max, spinlock_t *lock)
298{ 298{
299 struct pnfs_layoutdriver_type *ld = NFS_SERVER(inode)->pnfs_curr_ld; 299 struct pnfs_layoutdriver_type *ld = NFS_SERVER(inode)->pnfs_curr_ld;
300 int ret; 300 int ret;
301 301
302 if (ld == NULL || ld->scan_commit_lists == NULL) 302 if (ld == NULL || ld->scan_commit_lists == NULL)
303 return 0; 303 return 0;
304 ret = ld->scan_commit_lists(inode, max); 304 ret = ld->scan_commit_lists(inode, max, lock);
305 if (ret != 0) 305 if (ret != 0)
306 set_bit(NFS_INO_PNFS_COMMIT, &NFS_I(inode)->flags); 306 set_bit(NFS_INO_PNFS_COMMIT, &NFS_I(inode)->flags);
307 return ret; 307 return ret;
@@ -419,7 +419,7 @@ pnfs_clear_request_commit(struct nfs_page *req)
419} 419}
420 420
421static inline int 421static inline int
422pnfs_scan_commit_lists(struct inode *inode, int max) 422pnfs_scan_commit_lists(struct inode *inode, int max, spinlock_t *lock)
423{ 423{
424 return 0; 424 return 0;
425} 425}