All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 0/3] Factor out common ordered extent flushing code
Date: Mon, 22 Apr 2019 10:46:50 +0300	[thread overview]
Message-ID: <20190422074653.13075-1-nborisov@suse.com> (raw)

There are a couple of places in the code which need to ensure that a particular 
range is locked and doesn't have pending ordered extents. Currently this logic is
open-coded in said places. This patchset refactors the code such that we now 
have btrfs_lock_and_flush_ordered_range which encompasses this logic. 

Patch 1 introduces a new function which contains the duplicated logic. 

Patch 2 replaces occurences of given code pattern in callers 

Patch 3 Introduces a micro-op so that unlocks in the function can happen without
looking up in the ordered tree. This change is careful to not leak extra 
extent_state references. 

Patches have undergone multiple successful xfstest runs. 


Nikolay Borisov (3):
  btrfs: Implement btrfs_lock_and_flush_ordered_range
  btrfs: Use newly introduced btrfs_lock_and_flush_ordered_range
  btrfs: Always use a cached extent_state in
    btrfs_lock_and_flush_ordered_range

 fs/btrfs/extent_io.c    | 27 +++----------------------
 fs/btrfs/file.c         | 14 ++-----------
 fs/btrfs/inode.c        | 17 ++--------------
 fs/btrfs/ordered-data.c | 44 +++++++++++++++++++++++++++++++++++++++++
 fs/btrfs/ordered-data.h |  3 +++
 5 files changed, 54 insertions(+), 51 deletions(-)

-- 
2.17.1


             reply	other threads:[~2019-04-22  7:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-22  7:46 Nikolay Borisov [this message]
2019-04-22  7:46 ` [PATCH 1/3] btrfs: Implement btrfs_lock_and_flush_ordered_range Nikolay Borisov
2019-05-02 14:13   ` David Sterba
2019-04-22  7:46 ` [PATCH 2/3] btrfs: Use newly introduced btrfs_lock_and_flush_ordered_range Nikolay Borisov
2019-04-22  7:46 ` [PATCH 3/3] btrfs: Always use a cached extent_state in btrfs_lock_and_flush_ordered_range Nikolay Borisov

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=20190422074653.13075-1-nborisov@suse.com \
    --to=nborisov@suse.com \
    --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.