[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1008051559140.3063@localhost>
Date: Thu, 5 Aug 2010 16:00:20 +0200 (CEST)
From: Lukas Czerner <lczerner@...hat.com>
To: Andreas Dilger <adilger@...ger.ca>
cc: Lukas Czerner <lczerner@...hat.com>, linux-ext4@...r.kernel.org,
jmoyer@...hat.com, rwheeler@...hat.com, eshishki@...hat.com,
sandeen@...hat.com, jack@...e.cz, tytso@....edu
Subject: Re: [PATCH 2/3] Add batched discard support for ext3
On Wed, 4 Aug 2010, Andreas Dilger wrote:
> On 2010-08-04, at 07:44, Lukas Czerner wrote:
> > + /*
> > + * Clear bits in the bitmap
> > + */
> > + for (bit = start; bit < next; bit++) {
> > + BUFFER_TRACE(bitmap_bh, "clear bit");
> > + if (!ext3_clear_bit_atomic(sb_bgl_lock(sbi, group),
> > + bit, bitmap_bh->b_data)) {
> > + ext3_error(sb, __func__,
> > + "bit already cleared for block "E3FSBLK,
> > + (unsigned long)bit);
> > + BUFFER_TRACE(bitmap_bh, "bit already cleared");
> > + } else {
> > + freed++;
> > + }
> > + }
> > +
> > + /* Update couters */
> > + spin_lock(sb_bgl_lock(sbi, group));
> > + le16_add_cpu(&gdp->bg_free_blocks_count, freed);
> > + spin_unlock(sb_bgl_lock(sbi, group));
> > + percpu_counter_add(&sbi->s_freeblocks_counter, next - start);
>
> It wouldn't be a terrible idea to put this code into a helper function that is shared with ext3_free_blocks_sb() so that it is kept in sync. There are a lot of places that need to be kept coordinated (disk bitmap, memory bitmap, group descriptor, percpu counter) so I'd like that to be localized to one part of the code.
>
>
> Cheers, Andreas
>
Ok, I will see what I can do with that.
Thanks.
-Lukas
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists