From mboxrd@z Thu Jan 1 00:00:00 1970 From: OGAWA Hirofumi Subject: Re: [PATCH 2/5] [FAT] Let the block device know when sectors can be discarded Date: Thu, 07 Aug 2008 04:10:48 +0900 Message-ID: <87promot6v.fsf@devron.myhome.or.jp> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jens Axboe , Andrew Morton , Ric Wheeler , linux-fsdevel@vger.kernel.org, gilad@codefidence.com To: David Woodhouse Return-path: Received: from mail.parknet.ad.jp ([210.171.162.6]:40946 "EHLO mail.officemail.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753626AbYHFTKy (ORCPT ); Wed, 6 Aug 2008 15:10:54 -0400 In-Reply-To: <1218046269.5111.120.camel@pmac.infradead.org> (David Woodhouse's message of "Wed, 06 Aug 2008 19:11:09 +0100") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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. > 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. >> 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... -- OGAWA Hirofumi