public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/4] xfs: kill b_file_offset
Date: Thu, 29 Mar 2012 11:30:29 +1100	[thread overview]
Message-ID: <20120329003029.GH5091@dastard> (raw)
In-Reply-To: <20120328152028.GA12205@infradead.org>

On Wed, Mar 28, 2012 at 11:20:28AM -0400, Christoph Hellwig wrote:
> Looks good.
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> 
> 
> Minor comments below:
> 
> On Wed, Mar 28, 2012 at 04:19:16PM +1100, Dave Chinner wrote:
> > -	end = bp->b_file_offset + bp->b_buffer_length;
> > -	page_count = xfs_buf_btoc(end) - xfs_buf_btoct(bp->b_file_offset);
> > +	end = BBTOB(bp->b_bn) + bp->b_buffer_length;
> > +	page_count = xfs_buf_btoc(end) - xfs_buf_btoct(BBTOB(bp->b_bn));
> 
> Btw, xfs_buf_btoc and xfs_buf_btoct are more remoal candidates,
> they actually make the code harder to read compared to using the
> opencoded arithmetics..

Ok, I'll consider doing that in the next set of patches.

> >  	numbytes = numblks << BBSHIFT;
> >  
> >  	/* Check for IOs smaller than the sector size / not sector aligned */
> >  	ASSERT(!(numbytes < (1 << btp->bt_sshift)));
> > -	ASSERT(!(offset & (xfs_off_t)btp->bt_smask));
> > +	ASSERT(!(BBTOB(blkno) & (xfs_off_t)btp->bt_smask));
> 
> I don't think it makes sense to keep this assert, given that the
> return value from BBTOB is aligned by defintion.

I kept them there for the 4k sector case. Basic Blocks are always
512 bytes, so for filesystems with sector sizes greater than 512
bytes we still need a sector alignment and size check.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2012-03-29  0:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-28  5:19 [PATCH 0/4] xfs: clean up unit usage in xfs_buf Dave Chinner
2012-03-28  5:19 ` [PATCH 1/4] xfs: clean up buffer get/read call API Dave Chinner
2012-03-28  5:19 ` [PATCH 2/4] xfs: kill b_file_offset Dave Chinner
2012-03-28 15:20   ` Christoph Hellwig
2012-03-29  0:30     ` Dave Chinner [this message]
2012-03-28  5:19 ` [PATCH 3/4] xfs: use blocks for counting length of buffers Dave Chinner
2012-03-28 15:26   ` Christoph Hellwig
2012-03-29  0:31     ` Dave Chinner
2012-03-28  5:19 ` [PATCH 4/4] xfs: use blocks for storing the desired IO size Dave Chinner
2012-03-28 15:28   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120329003029.GH5091@dastard \
    --to=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox