All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Tinguely <tinguely@sgi.com>
To: jeff.liu@oracle.com
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH v5 3/4]xfs: xfs_seek_data() refinements with lookup data buffer offset from page cache.
Date: Fri, 27 Jul 2012 16:32:22 -0500	[thread overview]
Message-ID: <501308E6.3030207@sgi.com> (raw)
In-Reply-To: <50116322.2020005@oracle.com>

On 07/26/12 10:32, Jeff Liu wrote:
> Search data buffer offset for given range from page cache.
>
> Signed-off-by: Jie Liu<jeff.liu@oracle.com>


...

This is the same as version 4.

It looks good.

There are a couple places the comment precedes the test and is not yet 
valid:


>   		offset = max_t(loff_t, start,
> -			       XFS_FSB_TO_B(mp, map[1].br_startoff));
> +			       XFS_FSB_TO_B(mp, map[0].br_startoff));
> +		if (map[0].br_state == XFS_EXT_NORM&&
> +		    !isnullstartblock(map[0].br_startblock))
> +			break;
> +		else {
> +			/*
> +			 * Landed in an unwritten extent, try to lookup data
> +			 * buffer from the page cache before proceeding to
> +			 * check the next extent map.  It's a hole if nothing
> +			 * was found.
> +			 */

or it could be a hole
> +			if (map[0].br_startblock == DELAYSTARTBLOCK ||
> +			    map[0].br_state == XFS_EXT_UNWRITTEN) {

here is where it is unwritten extent
> +				/* Probing page cache start from offset */
> +				if (xfs_find_get_desired_pgoff(inode,&map[0],
> +							DATA_OFF,&offset))
> +					break;
> +			}
> +
> +			/*
> +			 * Found a hole in map[0] and nothing in map[1].
> +			 * Probably means that we are reading after EOF.
> +			 */

here we did find a hole
> +			if (nmap == 1) {
here is where there is nothing in map[1] and ...
> +				error = ENXIO;
> +				goto out_unlock;
> +			}
> +
> +			/*
> +			 * We have two mappings, proceed to check map[1].
> +			 */
> +			offset = max_t(loff_t, start,
> +				       XFS_FSB_TO_B(mp, map[1].br_startoff));
> +			if (map[1].br_state == XFS_EXT_NORM&&
> +			    !isnullstartblock(map[1].br_startblock))
> +				break;
> +			else {
> +				/*
> +				 * map[1] is also an unwritten extent, lookup
> +				 * data buffer from page cache now.
> +				 */

it could be unwritten or a hole
> +				if (map[1].br_startblock == DELAYSTARTBLOCK ||
> +				    map[1].br_state == XFS_EXT_UNWRITTEN) {

here is where we know it is unwritten.
> +					if (xfs_find_get_desired_pgoff(inode,
> +						&map[1], DATA_OFF,&offset))
> +						break;
> +				}
> +			}
> +		}

I am being really picky, but comments really help a quick read of the code.

Reviewed-by: Mark Tinguely <tinguely@sgi.com>

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

  reply	other threads:[~2012-07-27 21:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-26  8:56 [PATCH v5 3/4]xfs: xfs_seek_data() refinements with lookup data buffer offset from page cache Jeff Liu
2012-07-26 15:32 ` Jeff Liu
2012-07-27 21:32   ` Mark Tinguely [this message]
2012-07-28  4:09     ` Jeff liu
2012-07-31  0:06   ` Dave Chinner
2012-07-31  8:03     ` Jie Liu

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=501308E6.3030207@sgi.com \
    --to=tinguely@sgi.com \
    --cc=jeff.liu@oracle.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 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.