Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755628Ab1EXLc6 (ORCPT ); Tue, 24 May 2011 07:32:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54005 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755084Ab1EXLc4 (ORCPT ); Tue, 24 May 2011 07:32:56 -0400 Date: Tue, 24 May 2011 13:32:43 +0200 (CEST) From: Lukas Czerner X-X-Sender: lukas@dhcp-27-109.brq.redhat.com To: OGAWA Hirofumi cc: Lukas Czerner , Kyungmin Park , Arnd Bergmann , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v6] fat: Batched discard support for fat In-Reply-To: <87y61wic4h.fsf@devron.myhome.or.jp> Message-ID: References: <20110328103431.GA22323@july> <201103301620.50263.arnd@arndb.de> <201103301706.36214.arnd@arndb.de> <87wrhgk8lp.fsf@devron.myhome.or.jp> <87r57ok3fp.fsf@devron.myhome.or.jp> <87mxick0zj.fsf@devron.myhome.or.jp> <874o4kjtsy.fsf@devron.myhome.or.jp> <87y61wic4h.fsf@devron.myhome.or.jp> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1797 Lines: 45 On Tue, 24 May 2011, OGAWA Hirofumi wrote: > Lukas Czerner writes: > > >> No. If you want to trim whole with some chunk like 1GB and periodically > >> (IIRC in xfstest), what do? We have to trim until ULLONG_MAX for each > >> 1GB? > >> > >> Thanks. > >> > > > > What ? No, of course not. As I said, just go through 1G worth of filesystem > > blocks skipping metadata. However we do have a special case when we > > adjust start and len according to the first data block (which is only > > the case of 1024B blocksize). > > > > if (start < first_data_blk) { > > len -= first_data_blk - start; > > start = first_data_blk; > > } > > > > Which means that we just skip the first block (or whatever first data > > block is). And this is the same as skipping metadata. > > Are you read my email? So, FAT adjust 2 blocks, ext* 1 block, and what > is other? The middle was guaranteed as continued? So, which is end of > blocks? I am sorry but I am not sure what you are asking for. Just grab the size of the file system or even better the size of underlying device (since the filesyste would not be bigger than that) and use that. Of course if you grab the count of filesystem blocks (and the file system does not account for the first data block) you'll end up with len smaller than first data block. So it might make sense to not to decrement the len and just start from first data block since it is not accounted for anyway. However it is not a big deal, is it ? Are you expecting any problems with this behaviour ? -Lukas -- 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/