diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2008-02-06 04:37:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-06 13:41:05 -0500 |
commit | 797074e44d78835adbde2ca527718b0e50226b95 (patch) | |
tree | 7a54757b7201f4e0085ad1a654fa319eb7e07816 | |
parent | e8462caa915d4d12846db7aae2557b6db7c054d5 (diff) |
fs: use list_for_each_entry_reverse and kill sb_entry
Use list_for_each_entry_reverse for super_blocks list and remove
unused sb_entry macro.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/fs-writeback.c | 7 | ||||
-rw-r--r-- | include/linux/fs.h | 1 |
2 files changed, 2 insertions, 6 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 0b3064079fa5..db80ce9eb1d0 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -515,8 +515,7 @@ writeback_inodes(struct writeback_control *wbc) | |||
515 | might_sleep(); | 515 | might_sleep(); |
516 | spin_lock(&sb_lock); | 516 | spin_lock(&sb_lock); |
517 | restart: | 517 | restart: |
518 | sb = sb_entry(super_blocks.prev); | 518 | list_for_each_entry_reverse(sb, &super_blocks, s_list) { |
519 | for (; sb != sb_entry(&super_blocks); sb = sb_entry(sb->s_list.prev)) { | ||
520 | if (sb_has_dirty_inodes(sb)) { | 519 | if (sb_has_dirty_inodes(sb)) { |
521 | /* we're making our own get_super here */ | 520 | /* we're making our own get_super here */ |
522 | sb->s_count++; | 521 | sb->s_count++; |
@@ -581,10 +580,8 @@ static void set_sb_syncing(int val) | |||
581 | { | 580 | { |
582 | struct super_block *sb; | 581 | struct super_block *sb; |
583 | spin_lock(&sb_lock); | 582 | spin_lock(&sb_lock); |
584 | sb = sb_entry(super_blocks.prev); | 583 | list_for_each_entry_reverse(sb, &super_blocks, s_list) |
585 | for (; sb != sb_entry(&super_blocks); sb = sb_entry(sb->s_list.prev)) { | ||
586 | sb->s_syncing = val; | 584 | sb->s_syncing = val; |
587 | } | ||
588 | spin_unlock(&sb_lock); | 585 | spin_unlock(&sb_lock); |
589 | } | 586 | } |
590 | 587 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index e260d9a32c21..19aab50c3b8e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -977,7 +977,6 @@ extern int send_sigurg(struct fown_struct *fown); | |||
977 | extern struct list_head super_blocks; | 977 | extern struct list_head super_blocks; |
978 | extern spinlock_t sb_lock; | 978 | extern spinlock_t sb_lock; |
979 | 979 | ||
980 | #define sb_entry(list) list_entry((list), struct super_block, s_list) | ||
981 | #define S_BIAS (1<<30) | 980 | #define S_BIAS (1<<30) |
982 | struct super_block { | 981 | struct super_block { |
983 | struct list_head s_list; /* Keep this first */ | 982 | struct list_head s_list; /* Keep this first */ |