All of lore.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 4/5] [PATCH] xfs: simplify buffer to transaction matching
Date: Tue, 20 Apr 2010 16:41:55 +1000	[thread overview]
Message-ID: <20100420064155.GH15130@dastard> (raw)
In-Reply-To: <20100418001058.677429475@bombadil.infradead.org>

On Sat, Apr 17, 2010 at 08:10:45PM -0400, Christoph Hellwig wrote:
> We currenly have a routine xfs_trans_buf_item_match_all which checks if any
> log item in a transaction contains a given buffer, and a second one that
> only does this check for the first, embedded chunk of log items.  We only
> use the second routine if we know we only have that log item chunk, so get
> rid of the limited routine and always use the more complete one.
> 
> Also rename the old xfs_trans_buf_item_match_all to xfs_trans_buf_item_match
> and update various surrounding comments, and move the remaining
> xfs_trans_buf_item_match on top of the file to avoid a forward prototype.

Good start, but I think that it should use xfs_trans_first_item()
and xfs_trans_next_item() rather than walking the descriptor
table directly.

i.e:

	len = BBTOB(len);
	lidp = xfs_trans_first_item(tp);
	while (lidp != NULL) {
		blip = (xfs_buf_log_item_t *)lidp->lid_item;
		lidp = xfs_trans_next_item(tp, lidp);

		if (blip->bli_item.li_type != XFS_LI_BUF)
			continue;

		if (XFS_BUF_TARGET(blip->bli_buf) == target &&
		    XFS_BUF_ADDR(blip->bli_buf) == blkno &&
		    XFS_BUF_COUNT(blip->bli_buf) == len)
			return blip->bli_buf;
	}

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

  reply	other threads:[~2010-04-20  6:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-18  0:10 [PATCH 0/5] various cleanups for 2.6.35 Christoph Hellwig
2010-04-18  0:10 ` [PATCH 1/5] xfs: access quotainfo structure directly Christoph Hellwig
2010-04-20  6:28   ` Dave Chinner
2010-04-18  0:10 ` [PATCH 2/5] xfs: remove a few macro indirections in the quota code Christoph Hellwig
2010-04-20  6:31   ` Dave Chinner
2010-04-18  0:10 ` [PATCH 3/5] xfs: removed unused XFS_QMOPT_ flags Christoph Hellwig
2010-04-20  6:33   ` Dave Chinner
2010-04-22 11:49   ` Christoph Hellwig
2010-04-18  0:10 ` [PATCH 4/5] [PATCH] xfs: simplify buffer to transaction matching Christoph Hellwig
2010-04-20  6:41   ` Dave Chinner [this message]
2010-05-01 12:58     ` Christoph Hellwig
2010-05-03  4:23       ` Dave Chinner
2010-04-27 14:16   ` Christoph Hellwig
2010-04-29 13:35   ` Alex Elder
2010-04-29 13:38     ` Christoph Hellwig
2010-04-18  0:10 ` [PATCH 5/5] xfs: remove dead XFS_LOUD_RECOVERY code Christoph Hellwig
2010-04-20  6:44   ` Dave Chinner

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=20100420064155.GH15130@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.