* [PATCH] fs: use list_for_each_entry_reverse and kill sb_entry
@ 2007-11-17 14:33 Akinobu Mita
0 siblings, 0 replies; only message in thread
From: Akinobu Mita @ 2007-11-17 14:33 UTC (permalink / raw)
To: linux-fsdevel; +Cc: linux-kernel
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>
---
fs/fs-writeback.c | 7 ++-----
include/linux/fs.h | 1 -
2 files changed, 2 insertions(+), 6 deletions(-)
Index: 2.6-mm/fs/fs-writeback.c
===================================================================
--- 2.6-mm.orig/fs/fs-writeback.c
+++ 2.6-mm/fs/fs-writeback.c
@@ -528,8 +528,7 @@ int writeback_inodes(struct writeback_co
might_sleep();
spin_lock(&sb_lock);
restart:
- sb = sb_entry(super_blocks.prev);
- for (; sb != sb_entry(&super_blocks); sb = sb_entry(sb->s_list.prev)) {
+ list_for_each_entry_reverse(sb, &super_blocks, s_list) {
if (sb_has_dirty_inodes(sb)) {
/* we're making our own get_super here */
sb->s_count++;
@@ -593,10 +592,8 @@ static void set_sb_syncing(int val)
{
struct super_block *sb;
spin_lock(&sb_lock);
- sb = sb_entry(super_blocks.prev);
- for (; sb != sb_entry(&super_blocks); sb = sb_entry(sb->s_list.prev)) {
+ list_for_each_entry_reverse(sb, &super_blocks, s_list)
sb->s_syncing = val;
- }
spin_unlock(&sb_lock);
}
Index: 2.6-mm/include/linux/fs.h
===================================================================
--- 2.6-mm.orig/include/linux/fs.h
+++ 2.6-mm/include/linux/fs.h
@@ -984,7 +984,6 @@ extern int send_sigurg(struct fown_struc
extern struct list_head super_blocks;
extern spinlock_t sb_lock;
-#define sb_entry(list) list_entry((list), struct super_block, s_list)
#define S_BIAS (1<<30)
struct super_block {
struct list_head s_list; /* Keep this first */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-11-17 14:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-17 14:33 [PATCH] fs: use list_for_each_entry_reverse and kill sb_entry Akinobu Mita
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).