[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ocs5h238.fsf@devron.myhome.or.jp>
Date: Wed, 01 Jul 2009 05:57:15 +0900
From: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To: steve@...idescorp.com
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] FAT: optimize FSINFO writeback
steve@...idescorp.com writes:
> Only write the FSINFO block back to disk when its contents change.
> This optimization can be important when the underlying physical media
> can wear out, i.e. Flash.
I have no objection to this though. Was this tested on recent version?
Well, now, we are using sb->s_dirty for fsinfo, so I'm wondering why
this happen frequently.
Thanks.
> Signed-off-by: Steven J. Magnani <steve@...idescorp.com>
> ---
> diff -uprN a/fs/fat/misc.c b/fs/fat/misc.c
> --- a/fs/fat/misc.c 2009-06-29 11:12:40.000000000 -0500
> +++ b/fs/fat/misc.c 2009-06-29 11:46:45.000000000 -0500
> @@ -61,11 +61,25 @@ void fat_clusters_flush(struct super_blo
> le32_to_cpu(fsinfo->signature2),
> sbi->fsinfo_sector);
> } else {
> - if (sbi->free_clusters != -1)
> - fsinfo->free_clusters = cpu_to_le32(sbi->free_clusters);
> - if (sbi->prev_free != -1)
> - fsinfo->next_cluster = cpu_to_le32(sbi->prev_free);
> - mark_buffer_dirty(bh);
> + char write_needed = 0;
> + __le32 le_value;
> +
> + if (sbi->free_clusters != -1) {
> + le_value = cpu_to_le32(sbi->free_clusters);
> + if (fsinfo->free_clusters != le_value) {
> + fsinfo->free_clusters = le_value;
> + write_needed = 1;
> + }
> + }
> + if (sbi->prev_free != -1) {
> + le_value = cpu_to_le32(sbi->prev_free);
> + if (fsinfo->next_cluster != le_value) {
> + fsinfo->next_cluster = le_value;
> + write_needed = 1;
> + }
> + }
> + if (write_needed)
> + mark_buffer_dirty(bh);
> }
> brelse(bh);
> }
>
--
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists