diff options
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r-- | fs/fs-writeback.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index b27406d51bc7..225c7316344e 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -336,17 +336,27 @@ static void move_expired_inodes(struct list_head *delaying_queue, | |||
336 | { | 336 | { |
337 | LIST_HEAD(tmp); | 337 | LIST_HEAD(tmp); |
338 | struct list_head *pos, *node; | 338 | struct list_head *pos, *node; |
339 | struct super_block *sb; | 339 | struct super_block *sb = NULL; |
340 | struct inode *inode; | 340 | struct inode *inode; |
341 | int do_sb_sort = 0; | ||
341 | 342 | ||
342 | while (!list_empty(delaying_queue)) { | 343 | while (!list_empty(delaying_queue)) { |
343 | inode = list_entry(delaying_queue->prev, struct inode, i_list); | 344 | inode = list_entry(delaying_queue->prev, struct inode, i_list); |
344 | if (older_than_this && | 345 | if (older_than_this && |
345 | inode_dirtied_after(inode, *older_than_this)) | 346 | inode_dirtied_after(inode, *older_than_this)) |
346 | break; | 347 | break; |
348 | if (sb && sb != inode->i_sb) | ||
349 | do_sb_sort = 1; | ||
350 | sb = inode->i_sb; | ||
347 | list_move(&inode->i_list, &tmp); | 351 | list_move(&inode->i_list, &tmp); |
348 | } | 352 | } |
349 | 353 | ||
354 | /* just one sb in list, splice to dispatch_queue and we're done */ | ||
355 | if (!do_sb_sort) { | ||
356 | list_splice(&tmp, dispatch_queue); | ||
357 | return; | ||
358 | } | ||
359 | |||
350 | /* Move inodes from one superblock together */ | 360 | /* Move inodes from one superblock together */ |
351 | while (!list_empty(&tmp)) { | 361 | while (!list_empty(&tmp)) { |
352 | inode = list_entry(tmp.prev, struct inode, i_list); | 362 | inode = list_entry(tmp.prev, struct inode, i_list); |