diff options
author | Eric Sandeen <sandeen@redhat.com> | 2010-10-27 21:30:03 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-10-27 21:30:03 -0400 |
commit | 659c6009ca2e3a01acc9881bafe5f55ef09c965b (patch) | |
tree | c7d6b0a8cfb8f5979f3f8d0e0e5122ffd9c688be /fs/ext4/inode.c | |
parent | fb1813f4a8a27bbd4735967e46931e61fc837a3e (diff) |
ext4: stop looping in ext4_num_dirty_pages when max_pages reached
Today we simply break out of the inner loop when we have accumulated
max_pages; this keeps scanning forwad and doing pagevec_lookup_tag()
in the while (!done) loop, this does potentially a lot of work
with no net effect.
When we have accumulated max_pages, just clean up and return.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 4b8debeb3965..d88ba4a9effa 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -1207,8 +1207,10 @@ static pgoff_t ext4_num_dirty_pages(struct inode *inode, pgoff_t idx, | |||
1207 | break; | 1207 | break; |
1208 | idx++; | 1208 | idx++; |
1209 | num++; | 1209 | num++; |
1210 | if (num >= max_pages) | 1210 | if (num >= max_pages) { |
1211 | done = 1; | ||
1211 | break; | 1212 | break; |
1213 | } | ||
1212 | } | 1214 | } |
1213 | pagevec_release(&pvec); | 1215 | pagevec_release(&pvec); |
1214 | } | 1216 | } |