linux-btrfs.vger.kernel.org archive mirror
 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] Refactor delayed refs processing loop
Date: Wed, 15 Aug 2018 10:39:53 +0300	[thread overview]
Message-ID: <1534318796-23111-1-git-send-email-nborisov@suse.com> (raw)

Here is a small series which aims to rectify the eye sore that delayed refs 
processing loop currently is. In fact, it's actually 2 loops in the guise of a 
single 'while' construct. All in all this should bring no functional changes 
and I've verified this with multiple xfstest runs with no problems. 

Patch 1 factors out the code which deals with selecting a ref head which has 
delayed refs pending and locking it. 

Patch 2 introduces a new function which comprises the internal loop aka 
processing delayed refs of a delayed head, which is more or less most of the 
code in __btrfs_run_delayed_refs copied. The only difference is that the 
function can return EAGAIN if we detect a delayed ref which has sequence number
higher than what is currently in the tree mod list. 

Patch 3 Finaly makes the loop in __btrfs_run_delayed_refs use the function 
introduced in the previous patch, meaning deleting most of the code and 
changing the loop to a 'do {} while' construct. I strived to retain all the 
semantics of the old code so there should be no surprises. 

Nikolay Borisov (3):
  btrfs: Factor out ref head locking code in __btrfs_run_delayed_refs
  btrfs: Factor out loop processing all refs of a head
  btrfs: refactor __btrfs_run_delayed_refs loop

 fs/btrfs/extent-tree.c | 210 ++++++++++++++++++++++++++++++-------------------
 1 file changed, 128 insertions(+), 82 deletions(-)

-- 
2.7.4

             reply	other threads:[~2018-08-15 10:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-15  7:39 Nikolay Borisov [this message]
2018-08-15  7:39 ` [PATCH 1/3] btrfs: Factor out ref head locking code in __btrfs_run_delayed_refs Nikolay Borisov
2018-09-21 14:30   ` David Sterba
2018-08-15  7:39 ` [PATCH 2/3] btrfs: Factor out loop processing all refs of a head Nikolay Borisov
2018-09-21 14:39   ` David Sterba
2018-08-15  7:39 ` [PATCH 3/3] btrfs: refactor __btrfs_run_delayed_refs loop Nikolay Borisov
2018-09-21 14:39   ` David Sterba
2018-09-21 14:43 ` [PATCH 0/3] Refactor delayed refs processing loop David Sterba

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=1534318796-23111-1-git-send-email-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).