From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Woodhouse Subject: Re: [PATCH 2/5] [FAT] Let the block device know when sectors can be discarded Date: Wed, 06 Aug 2008 22:37:49 +0100 Message-ID: <1218058669.5111.150.camel@pmac.infradead.org> References: <488B7281.4020007@gmail.com> <20080726130200.f541e604.akpm@linux-foundation.org> <1217900716.3454.667.camel@pmac.infradead.org> <20080805114210.GW20055@kernel.dk> <1217953741.3454.784.camel@pmac.infradead.org> <1217957140.3454.800.camel@pmac.infradead.org> <1218014720.5111.37.camel@pmac.infradead.org> <873aliqepf.fsf@devron.myhome.or.jp> <1218046269.5111.120.camel@pmac.infradead.org> <87promot6v.fsf@devron.myhome.or.jp> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Jens Axboe , Andrew Morton , Ric Wheeler , linux-fsdevel@vger.kernel.org, gilad@codefidence.com To: OGAWA Hirofumi Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:60683 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751282AbYHFViI (ORCPT ); Wed, 6 Aug 2008 17:38:08 -0400 In-Reply-To: <87promot6v.fsf@devron.myhome.or.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, 2008-08-07 at 04:10 +0900, OGAWA Hirofumi wrote: > David Woodhouse writes: > > > On Thu, 2008-08-07 at 01:40 +0900, OGAWA Hirofumi wrote: > >> Perhaps, after checking cluster-chain corruption is better. Thanks. > > > > That can be done, but not like that, I think. At the point you added the > > blkdev_issue_discard() call, the value of 'cluster' has already changed. > > > > So if the chain being freed is clusters 10, 11 and 12, your version of > > the patch will attempt to discard clusters 11, 12 and 0xFFFF (EOF). > > + fat_clus_to_blknr(sbi, fatent.entry), > > No, no. I used fatent.entry, not cluster. Ah, OK. Sorry, I misread it :) > > On Thu, 2008-08-07 at 02:14 +0900, OGAWA Hirofumi wrote: > >> Ah, blkdev_issue_discard() assumes blocksize is 512bytes, um... > > > > Doesn't everything? I did consider using q->hardsect_size, but decided > > that was probably the wrong thing to do. I don't know. Jens? > > My point is fs-blocksize vs hard sector size. > > In FAT patch, it's passing the number of fs-blocks, not number of hard > sectors. > > >> blkdev_issue_discard() takes bytes, > > > > -EPARSE. It takes sectors at the moment -- do you mean you _want_ it to > > take bytes? > > Yes and no. I guess bytes or _fs_-blocksize is good interface for fs. OK. I'll do the latter; thank you. -- dwmw2