lkml.org 
[lkml]   [2001]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Final call for testers][PATCH] superblock handling changes (2.4.6-pre3)
At 5:16 PM +0100 2001-06-15, Matthew Wilcox wrote:
>I think this could be clearer.
>
> struct list_head *tmp;
>restart:
> spin_lock(&sb_lock);
> list_for_each(tmp, super_blocks) {
> struct super_block *sb = sb_entry(tmp);
> if (!sb->s_dirt)
> continue;
> spin_unlock(&sb_lock);
> down_read(&sb->s_umount);
> write_super(sb);
> drop_super(sb);
> goto restart;
> }
> spin_unlock(&sb_lock);

A minor improvement, IMO, is:

struct list_head *tmp;
restart:
spin_lock(&sb_lock);
list_for_each(tmp, super_blocks) {
struct super_block *sb = sb_entry(tmp);
if (sb->s_dirt) {
sb->s_count++;
spin_unlock(&sb_lock);
down_read(&sb->s_umount);
write_super(sb);
drop_super(sb);
goto restart;
}
}
spin_unlock(&sb_lock);

--
/Jonathan Lundell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:17    [W:0.245 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site