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 3/4] xfs: use blocks for counting length of buffers
Date: Thu, 29 Mar 2012 11:31:36 +1100	[thread overview]
Message-ID: <20120329003136.GI5091@dastard> (raw)
In-Reply-To: <20120328152639.GB12205@infradead.org>

On Wed, Mar 28, 2012 at 11:26:39AM -0400, Christoph Hellwig wrote:
> > +			tmp = (valuelen < BBTOB(bp->b_length))
> > +				? valuelen : BBTOB(bp->b_length);
> 
> maybe use min or min_t here while you're at it?
> 
> > -		tmp = (valuelen < XFS_BUF_SIZE(bp)) ? valuelen :
> > -							XFS_BUF_SIZE(bp);
> > +		tmp = valuelen < BBTOB(bp->b_length) ? valuelen :
> > +						       BBTOB(bp->b_length);
> 
> Same here.
> 
> >  		xfs_buf_iomove(bp, 0, tmp, src, XBRW_WRITE);
> > -		if (tmp < XFS_BUF_SIZE(bp))
> > -			xfs_buf_zero(bp, tmp, XFS_BUF_SIZE(bp) - tmp);
> > +		if (tmp < BBTOB(bp->b_length))
> > +			xfs_buf_zero(bp, tmp, BBTOB(bp->b_length) - tmp);
> 
> Also a local buf_len variable in this function would probably be useful.
> 
> > -	size_t			b_buffer_length;/* size of buffer in bytes */
> > +	size_t			b_length;	/* size of buffer in BBs */
> 
> A count of blocks probably shold not be a size_t, but a uint.
> 
> >  	TP_fast_assign(
> >  		__entry->dev = bp->b_target->bt_dev;
> >  		__entry->bno = bp->b_bn;
> > -		__entry->buffer_length = bp->b_buffer_length;
> > +		__entry->buffer_length = BBTOB(bp->b_length);
> 
> Given that we print the bno in blocks it might make sense to print
> this as number of blocks, too?  Change the description string to nblks
> in that case as well.

All makes sense. Will do.

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:31 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
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 [this message]
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=20120329003136.GI5091@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