All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Liu <jeff.liu@oracle.com>
To: xfs@oss.sgi.com
Subject: [PATCH v5 0/4] xfs: seek_data/seek_hole refinements
Date: Thu, 26 Jul 2012 16:55:08 +0800	[thread overview]
Message-ID: <501105EC.5050903@oracle.com> (raw)

Hello,

This is the v5 patch set for xfs_seek_data/xfs_seek_hole refinements with lookup
the offset from page cache for desired type.

I split those changes to 4 patches this time, maybe it could facilitate the review process.

v4->v5:
* Introduce a new routine xfs_find_get_desired_pgoff() to search the desired offset from page cache
  for unwritten and delayed-allocation extents.  This function is mainly based on the original xfs_has_unwritten_buffer() but
  revised to be able to fetch a hole offset directly for the refinement of xfs_seek_hole().
* Remove type argument from xfs_seek_data()/xfs_seek_hole() as it is already indicated by those function naming explicitly.

v3->v4:
xfs_seek_hole() refinement, suggested by Mark and Christoph.
* refine xfs_seek_hole() with unwritten extents search, treat it as a hole if no data buffer was found from page cache.
* s/goto out/break/g, break out of the extent maps reading loop rather than 'go to', I must have got my head up in the clouds when writing v3.
* xfs_has_unwritten_buffer(), remove 'offset <= XFS_FSB_TO_B(mp, last))' from BH state checking branch.
  The page index offset might less than '*start', so we will miss a data extent if so.
* xfs_has_unwritten_buffer(), don't reset '*offset' to ZERO if no data buffer was found because of xfs_seek_hole() will call this function to
   examine an unwritten extent has data or not. If not, it will use the returned '*offset' as a hole offset.  So set '*offset' to zero in
   xfs_has_unwritten_buffer() will lead to wrong result.
* avoid re-starting the next round search in both xfs_seek_data() and xfs_seek_hole() if the end offset of the 2nd extent map is hit the EOF.
  So for SEEK_DATA, it means there is no data extent beyond the current offset and return ENXIO, for SEEK_HOLE, return the file size to
  indicate hitting EOF.   The comments were also changed(s/reading offset not beyond/reading offset not beyond or hit EOF/)accordingly.

v2->v3:
Tested by Mark, hit BUG() for continuous unwritten extents without data wrote.
* xfs_seek_data(), remove BUG() and having extents map search in loop.

v1->v2:
suggested by Mark.
* xfs_has_unwritten_buffer(), use the input offset instead of bmap->br_startoff to calculate page index for data buffer probing.

Thanks,
-Jeff

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

             reply	other threads:[~2012-07-26  8:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-26  8:55 Jeff Liu [this message]
2012-07-26 15:31 ` [PATCH v5 0/4] xfs: seek_data/seek_hole refinements Jeff 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=501105EC.5050903@oracle.com \
    --to=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.