Re: [PATCH 4/29] let fat handle MS_SYNCHRONOUS flag

From: OGAWA Hirofumi
Date: Mon Mar 07 2005 - 09:58:24 EST


Christoph Hellwig <hch@xxxxxxxxxxxxx> writes:

>> mark_buffer_dirty(bh);
>> + if (sb->s_flags & MS_SYNCHRONOUS)
>> + sync_dirty_buffer(bh);
>
> These three lines are duplicated a lot. I think you want a helper ala:
>
> static inline void fat_buffer_modified(struct super_block *sb,
> struct buffer_head *bh)
> {
> mark_buffer_dirty(bh);
> if (sb->s_flags & MS_SYNCHRONOUS)
> sync_dirty_buffer(bh);
> }

Yes, I may want the following helper. However I'll put it as is for now.

static inline void fat_buffer_modified(struct super_block *sb,
struct buffer_head *bh, int wait)
{
int err = 0;
mark_buffer_dirty(bh);
if (wait)
err = sync_dirty_buffer(bh);
return err;
}
--
OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/