All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/3] btrfs: add a flag to iterate_inodes_from_logical to find all extent refs for uncompressed extents
Date: Thu, 19 Oct 2017 19:03:14 +0200	[thread overview]
Message-ID: <20171019170314.GN3521@twin.jikos.cz> (raw)
In-Reply-To: <20170922175847.6071-2-ce3g8jdj@umail.furryterror.org>

On Fri, Sep 22, 2017 at 01:58:45PM -0400, Zygo Blaxell wrote:
> The LOGICAL_INO ioctl provides a backward mapping from extent bytenr and
> offset (encoded as a single logical address) to a list of extent refs.
> LOGICAL_INO complements TREE_SEARCH, which provides the forward mapping
> (extent ref -> extent bytenr and offset, or logical address).  These are
> useful capabilities for programs that manipulate extents and extent
> references from userspace (e.g. dedup and defrag utilities).
> 
> When the extents are uncompressed (and not encrypted and not other),
> check_extent_in_eb performs filtering of the extent refs to remove any
> extent refs which do not contain the same extent offset as the 'logical'
> parameter's extent offset.  This prevents LOGICAL_INO from returning
> references to more than a single block.
> 
> To find the set of extent references to an uncompressed extent from [a,
> b), userspace has to run a loop like this pseudocode:
> 
> 	for (i = a; i < b; ++i)
> 		extent_ref_set += LOGICAL_INO(i);
> 
> At each iteration of the loop (up to 32768 iterations for a 128M extent),
> data we are interested in is collected in the kernel, then deleted by
> the filter in check_extent_in_eb.
> 
> When the extents are compressed (or encrypted or other), the 'logical'
> parameter must be an extent bytenr (the 'a' parameter in the loop).
> No filtering by extent offset is done (or possible?) so the result is
> the complete set of extent refs for the entire extent.  This removes
> the need for the loop, since we get all the extent refs in one call.
> 
> Add an 'ignore_offset' argument to iterate_inodes_from_logical,
> [...several levels of function call graph...], and check_extent_in_eb, so
> that we can disable the extent offset filtering for uncompressed extents.
> This flag can be set by an improved version of the LOGICAL_INO ioctl to
> get either behavior as desired.
> 
> There is no functional change in this patch.  The new flag is always
> false.
> 
> Signed-off-by: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>

Reviewed-by: David Sterba <dsterba@suse.com>

  reply	other threads:[~2017-10-19 17:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22 17:58 [PATCH v3] btrfs: LOGICAL_INO enhancements Zygo Blaxell
2017-09-22 17:58 ` [PATCH 1/3] btrfs: add a flag to iterate_inodes_from_logical to find all extent refs for uncompressed extents Zygo Blaxell
2017-10-19 17:03   ` David Sterba [this message]
2017-09-22 17:58 ` [PATCH 2/3] btrfs: add a flags argument to LOGICAL_INO and call it LOGICAL_INO_V2 Zygo Blaxell
2017-09-23 20:38   ` Hans van Kranenburg
2017-09-22 17:58 ` [PATCH 3/3] btrfs: increase output size for LOGICAL_INO_V2 ioctl Zygo Blaxell
2017-09-23 21:06   ` Hans van Kranenburg
2017-10-19 17:07     ` David Sterba
2019-08-30  7:55 ` Fwd: [PATCH v3] btrfs: LOGICAL_INO enhancements Anand Jain
  -- strict thread matches above, loose matches on Subject: below --
2017-09-21  4:10 [PATCH v2] btrfs: LOGICAL_INO enhancements (this time based on 4.14-rc1) Zygo Blaxell
2017-09-21  4:10 ` [PATCH 1/3] btrfs: add a flag to iterate_inodes_from_logical to find all extent refs for uncompressed extents Zygo Blaxell
2017-09-21  0:33 Zygo Blaxell

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=20171019170314.GN3521@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=ce3g8jdj@umail.furryterror.org \
    --cc=linux-btrfs@vger.kernel.org \
    /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.