From: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 2/2] btrfs: increase tickets_id even for failed metadata request
Date: Mon, 7 Nov 2016 15:59:17 +0800 [thread overview]
Message-ID: <1478505557-1406-2-git-send-email-wangxg.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <1478505557-1406-1-git-send-email-wangxg.fnst@cn.fujitsu.com>
Not functional change, it just makes codes logic more reasonable, then
at least tickets_id can reflect the number of metadata requests we already
handled.
Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
---
fs/btrfs/extent-tree.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 4607af3..d63bf40 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4949,14 +4949,16 @@ static inline int need_do_async_reclaim(struct btrfs_space_info *space_info,
&root->fs_info->fs_state));
}
-static void wake_all_tickets(struct list_head *head)
+static void wake_all_tickets(struct btrfs_space_info *space_info)
{
struct reserve_ticket *ticket;
+ struct list_head *head = &space_info->tickets;
while (!list_empty(head)) {
ticket = list_first_entry(head, struct reserve_ticket, list);
list_del_init(&ticket->list);
ticket->error = -ENOSPC;
+ space_info->tickets_id++;
wake_up(&ticket->wait);
}
}
@@ -5018,7 +5020,7 @@ static void btrfs_async_reclaim_metadata_space(struct work_struct *work)
if (flush_state > COMMIT_TRANS) {
commit_cycles++;
if (commit_cycles > 2) {
- wake_all_tickets(&space_info->tickets);
+ wake_all_tickets(space_info);
space_info->flush = 0;
} else {
flush_state = FLUSH_DELAYED_ITEMS_NR;
--
2.5.0
prev parent reply other threads:[~2016-11-07 8:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-07 7:59 [PATCH 1/2] btrfs: add necessary comments about tickets_id Wang Xiaoguang
2016-11-07 7:59 ` Wang Xiaoguang [this message]
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=1478505557-1406-2-git-send-email-wangxg.fnst@cn.fujitsu.com \
--to=wangxg.fnst@cn.fujitsu.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).