public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/4] xfs: kill b_file_offset
Date: Wed, 28 Mar 2012 11:20:28 -0400	[thread overview]
Message-ID: <20120328152028.GA12205@infradead.org> (raw)
In-Reply-To: <1332911958-5613-3-git-send-email-david@fromorbit.com>

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..

>  	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.

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

  reply	other threads:[~2012-03-28 15:20 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 [this message]
2012-03-29  0:30     ` Dave Chinner
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=20120328152028.GA12205@infradead.org \
    --to=hch@infradead.org \
    --cc=david@fromorbit.com \
    --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