提交 797074e4 编写于 作者: A Akinobu Mita 提交者: Linus Torvalds

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: NAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 e8462caa
...@@ -515,8 +515,7 @@ writeback_inodes(struct writeback_control *wbc) ...@@ -515,8 +515,7 @@ writeback_inodes(struct writeback_control *wbc)
might_sleep(); might_sleep();
spin_lock(&sb_lock); spin_lock(&sb_lock);
restart: restart:
sb = sb_entry(super_blocks.prev); list_for_each_entry_reverse(sb, &super_blocks, s_list) {
for (; sb != sb_entry(&super_blocks); sb = sb_entry(sb->s_list.prev)) {
if (sb_has_dirty_inodes(sb)) { if (sb_has_dirty_inodes(sb)) {
/* we're making our own get_super here */ /* we're making our own get_super here */
sb->s_count++; sb->s_count++;
...@@ -581,10 +580,8 @@ static void set_sb_syncing(int val) ...@@ -581,10 +580,8 @@ static void set_sb_syncing(int val)
{ {
struct super_block *sb; struct super_block *sb;
spin_lock(&sb_lock); spin_lock(&sb_lock);
sb = sb_entry(super_blocks.prev); list_for_each_entry_reverse(sb, &super_blocks, s_list)
for (; sb != sb_entry(&super_blocks); sb = sb_entry(sb->s_list.prev)) {
sb->s_syncing = val; sb->s_syncing = val;
}
spin_unlock(&sb_lock); spin_unlock(&sb_lock);
} }
......
...@@ -977,7 +977,6 @@ extern int send_sigurg(struct fown_struct *fown); ...@@ -977,7 +977,6 @@ extern int send_sigurg(struct fown_struct *fown);
extern struct list_head super_blocks; extern struct list_head super_blocks;
extern spinlock_t sb_lock; extern spinlock_t sb_lock;
#define sb_entry(list) list_entry((list), struct super_block, s_list)
#define S_BIAS (1<<30) #define S_BIAS (1<<30)
struct super_block { struct super_block {
struct list_head s_list; /* Keep this first */ struct list_head s_list; /* Keep this first */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册