[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1012131756310.3054@dhcp-lab-213.englab.brq.redhat.com>
Date: Mon, 13 Dec 2010 17:56:59 +0100 (CET)
From: Lukas Czerner <lczerner@...hat.com>
To: Tao Ma <tm@....ma>
cc: Lukas Czerner <lczerner@...hat.com>, linux-ext4@...r.kernel.org,
tytso@....edu
Subject: Re: [PATCH] mke2fs: Inform user of ongoing discard
On Mon, 13 Dec 2010, Tao Ma wrote:
> Hi Lukas,
> On 12/13/2010 05:45 PM, Lukas Czerner wrote:
> <snip>
> > @@ -1922,6 +1925,44 @@ static int mke2fs_setup_tdb(const char *name,
> > io_manager *io_ptr)
> > return retval;
> > }
> >
> > +static int mke2fs_discard_device(ext2_filsys fs)
> > +{
> > + struct ext2fs_numeric_progress_struct progress;
> > + blk64_t blocks = ext2fs_blocks_count(fs->super);
> > + blk64_t count = DISCARD_STEP_MB;
> > + blk64_t cur = 0;
> > + int retval = 0;
> > +
> > + count *= MB;
> > + count /= fs->blocksize;
> > +
> > + ext2fs_numeric_progress_init(fs,&progress,
> > + _("Discarding device blocks: "),
> > + blocks);
> > + while (cur< blocks) {
> > + ext2fs_numeric_progress_update(fs,&progress, cur);
> > +
> > + retval = io_channel_discard(fs->io, cur, count,
> > fs->blocksize);
> Here we need to limit 'count' within ext4's block range for the 1st round,
> otherwise it will discard the blocks outside our ext4 volume in case the size
> is less than 2GB.
>
> Regards,
> Tao
>
Oh, of course. Thanks, I'll fix that.
-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