lkml.org 
[lkml]   [2001]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [Final call for testers][PATCH] superblock handling changes (2.4.6-pre3)


On Fri, 15 Jun 2001, Matthew Wilcox wrote:

> > + while (sb != sb_entry(&super_blocks))
> > + if (sb->s_dirt) {
> > + sb->s_count++;
^^^^^^^^^^^^^^
> > + spin_unlock(&sb_lock);
> > + down_read(&sb->s_umount);
> > + write_super(sb);
> > + drop_super(sb);
> > + goto restart;
> > + } else
> > + sb = sb_entry(sb->s_list.next);
> > + spin_unlock(&sb_lock);
>
> 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);

Aside of the missing ->s_count++ - no arguments.

> > @@ -773,16 +810,16 @@
> > void *data, int silent)
> > {
> > struct super_block * s;
> > - s = get_empty_super();
> > + s = alloc_super();
> > if (!s)
> > goto out;
> > s->s_dev = dev;
> > s->s_bdev = bdev;
> > s->s_flags = flags;
> > - s->s_dirt = 0;
> > s->s_type = type;
> > - s->s_dquot.flags = 0;
> > - s->s_maxbytes = MAX_NON_LFS;
> > + spin_lock(&sb_lock);
> > + list_add (&s->s_list, super_blocks.prev);
>
> I'd use list_add_tail(&s->s_list, super_blocks);

Umm... Why? I've no problems with either variant, but I really see no
clear win (or loss) in list_add_tail here. If there is some code that
relies on the order in that list it's badly broken - remember, we used
to reuse unmounted superblocks, so order might be almost arbitrary.
Not even "root is first", whatever value that might have - FS_SINGLE
filesystems ended up before the root.

-
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 12:55    [W:0.084 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site