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 19:11:09 +0100 Message-ID: <1218046269.5111.120.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> 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]:48107 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754775AbYHFSLS (ORCPT ); Wed, 6 Aug 2008 14:11:18 -0400 In-Reply-To: <873aliqepf.fsf@devron.myhome.or.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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). 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? > blkdev_issue_discard() takes bytes, -EPARSE. It takes sectors at the moment -- do you mean you _want_ it to take bytes? > and instead add some helpers for sb or inode? I suppose we could; I'm not really so sure we need them. inode->i_sb->s_bdev isn't exactly hard... -- dwmw2