Home Home > GIT Browse > openSUSE-42.3
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2019-05-17 18:39:32 +0800
committerQu Wenruo <wqu@suse.com>2019-05-17 18:39:32 +0800
commit88a2b69cd32ca358d3826d42a77c5f75bc7a467b (patch)
tree7cafae0a6a8902a5da6490821ab43231700621c3
parent2562f69029dac7496509f3d4b3f1954f4f96ad5e (diff)
- btrfs: Use init_delayed_ref_head in add_delayed_ref_head
(bsc#1134813). - Refresh patches.fixes/0001-btrfs-qgroup-Move-reserved-data-accounting-from-btrf.patch.
-rw-r--r--patches.fixes/0001-btrfs-qgroup-Move-reserved-data-accounting-from-btrf.patch41
-rw-r--r--patches.suse/0007-btrfs-Use-init_delayed_ref_head-in-add_delayed_ref_h.patch100
-rw-r--r--series.conf1
3 files changed, 112 insertions, 30 deletions
diff --git a/patches.fixes/0001-btrfs-qgroup-Move-reserved-data-accounting-from-btrf.patch b/patches.fixes/0001-btrfs-qgroup-Move-reserved-data-accounting-from-btrf.patch
index 1d9805e3ff..268ea2e22a 100644
--- a/patches.fixes/0001-btrfs-qgroup-Move-reserved-data-accounting-from-btrf.patch
+++ b/patches.fixes/0001-btrfs-qgroup-Move-reserved-data-accounting-from-btrf.patch
@@ -102,13 +102,13 @@ Fixes: f64d5ca86821 ("btrfs: delayed_ref: Add new function to record reserved sp
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
---
- fs/btrfs/delayed-ref.c | 46 +++++--------------------------------------
- fs/btrfs/delayed-ref.h | 11 ----------
- fs/btrfs/extent-tree.c | 3 --
- fs/btrfs/qgroup.c | 19 ++++++++++++++---
- fs/btrfs/qgroup.h | 22 ++++++++++----------
- include/trace/events/btrfs.h | 29 ---------------------------
- 6 files changed, 32 insertions(+), 98 deletions(-)
+ fs/btrfs/delayed-ref.c | 40 ++++------------------------------------
+ fs/btrfs/delayed-ref.h | 11 -----------
+ fs/btrfs/extent-tree.c | 3 ---
+ fs/btrfs/qgroup.c | 19 +++++++++++++++----
+ fs/btrfs/qgroup.h | 22 +++++++++++-----------
+ include/trace/events/btrfs.h | 29 -----------------------------
+ 6 files changed, 30 insertions(+), 94 deletions(-)
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -130,26 +130,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
}
qrecord->bytenr = bytenr;
-@@ -669,16 +667,14 @@ add_delayed_ref_head(struct btrfs_fs_inf
- RB_CLEAR_NODE(&head_ref->href_node);
- head_ref->processing = 0;
- head_ref->total_ref_mod = count_mod;
-- head_ref->qgroup_reserved = 0;
-- head_ref->qgroup_ref_root = 0;
- spin_lock_init(&head_ref->lock);
- mutex_init(&head_ref->mutex);
-
- /* Record qgroup extent info if provided */
- if (qrecord) {
- if (ref_root && reserved) {
-- head_ref->qgroup_ref_root = ref_root;
-- head_ref->qgroup_reserved = reserved;
-+ qrecord->data_rsv = reserved;
-+ qrecord->data_rsv_refroot = ref_root;
- }
-
- qrecord->bytenr = bytenr;
-@@ -695,8 +691,6 @@ add_delayed_ref_head(struct btrfs_fs_inf
+@@ -644,8 +642,6 @@ add_delayed_ref_head(struct btrfs_fs_inf
existing = htree_insert(&delayed_refs->href_root,
&head_ref->href_node);
if (existing) {
@@ -158,7 +139,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
update_existing_head_ref(delayed_refs, existing, head_ref,
old_ref_mod);
/*
-@@ -812,7 +806,7 @@ int btrfs_add_delayed_tree_ref(struct bt
+@@ -761,7 +757,7 @@ int btrfs_add_delayed_tree_ref(struct bt
if (test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags) &&
is_fstree(ref_root)) {
@@ -167,7 +148,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
if (!record)
goto free_head_ref;
}
-@@ -891,7 +885,7 @@ int btrfs_add_delayed_data_ref(struct bt
+@@ -840,7 +836,7 @@ int btrfs_add_delayed_data_ref(struct bt
if (test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags) &&
is_fstree(ref_root)) {
@@ -176,7 +157,7 @@ Signed-off-by: David Sterba <dsterba@suse.com>
if (!record) {
kmem_cache_free(btrfs_delayed_data_ref_cachep, ref);
kmem_cache_free(btrfs_delayed_ref_head_cachep,
-@@ -924,34 +918,6 @@ int btrfs_add_delayed_data_ref(struct bt
+@@ -873,34 +869,6 @@ int btrfs_add_delayed_data_ref(struct bt
return 0;
}
diff --git a/patches.suse/0007-btrfs-Use-init_delayed_ref_head-in-add_delayed_ref_h.patch b/patches.suse/0007-btrfs-Use-init_delayed_ref_head-in-add_delayed_ref_h.patch
new file mode 100644
index 0000000000..d02233c4fc
--- /dev/null
+++ b/patches.suse/0007-btrfs-Use-init_delayed_ref_head-in-add_delayed_ref_h.patch
@@ -0,0 +1,100 @@
+From eb86ec73b968b2895ffede893b33bf49bbc9bf5c Mon Sep 17 00:00:00 2001
+From: Nikolay Borisov <nborisov@suse.com>
+Date: Tue, 24 Apr 2018 17:18:23 +0300
+Git-commit: eb86ec73b968b2895ffede893b33bf49bbc9bf5c
+Patch-mainline: v4.18-rc1
+References: bsc#1134813
+Subject: [PATCH 7/8] btrfs: Use init_delayed_ref_head in add_delayed_ref_head
+
+Use the newly introduced function when initialising the head_ref in
+add_delayed_ref_head. No functional changes.
+
+Signed-off-by: Nikolay Borisov <nborisov@suse.com>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+---
+ fs/btrfs/delayed-ref.c | 59 +++----------------------------------------------
+ 1 file changed, 4 insertions(+), 55 deletions(-)
+
+--- a/fs/btrfs/delayed-ref.c
++++ b/fs/btrfs/delayed-ref.c
+@@ -624,67 +624,16 @@ add_delayed_ref_head(struct btrfs_fs_inf
+ {
+ struct btrfs_delayed_ref_head *existing;
+ struct btrfs_delayed_ref_root *delayed_refs;
+- int count_mod = 1;
+- int must_insert_reserved = 0;
+-
+- /* If reserved is provided, it must be a data extent. */
+- BUG_ON(!is_data && reserved);
+-
+- /*
+- * the head node stores the sum of all the mods, so dropping a ref
+- * should drop the sum in the head node by one.
+- */
+- if (action == BTRFS_UPDATE_DELAYED_HEAD)
+- count_mod = 0;
+- else if (action == BTRFS_DROP_DELAYED_REF)
+- count_mod = -1;
+-
+- /*
+- * BTRFS_ADD_DELAYED_EXTENT means that we need to update
+- * the reserved accounting when the extent is finally added, or
+- * if a later modification deletes the delayed ref without ever
+- * inserting the extent into the extent allocation tree.
+- * ref->must_insert_reserved is the flag used to record
+- * that accounting mods are required.
+- *
+- * Once we record must_insert_reserved, switch the action to
+- * BTRFS_ADD_DELAYED_REF because other special casing is not required.
+- */
+- if (action == BTRFS_ADD_DELAYED_EXTENT)
+- must_insert_reserved = 1;
+- else
+- must_insert_reserved = 0;
+
+ delayed_refs = &trans->transaction->delayed_refs;
+
+- atomic_set(&head_ref->refs, 1);
+- head_ref->bytenr = bytenr;
+- head_ref->num_bytes = num_bytes;
+- head_ref->ref_mod = count_mod;
+- head_ref->must_insert_reserved = must_insert_reserved;
+- head_ref->is_data = is_data;
+- head_ref->is_system = is_system;
+- head_ref->ref_tree = RB_ROOT;
+- INIT_LIST_HEAD(&head_ref->ref_add_list);
+- RB_CLEAR_NODE(&head_ref->href_node);
+- head_ref->processing = 0;
+- head_ref->total_ref_mod = count_mod;
+- head_ref->qgroup_reserved = 0;
+- head_ref->qgroup_ref_root = 0;
+- spin_lock_init(&head_ref->lock);
+ mutex_init(&head_ref->mutex);
+
++ init_delayed_ref_head(head_ref, qrecord, bytenr, num_bytes, ref_root,
++ reserved, action, is_data, is_system);
++
+ /* Record qgroup extent info if provided */
+ if (qrecord) {
+- if (ref_root && reserved) {
+- head_ref->qgroup_ref_root = ref_root;
+- head_ref->qgroup_reserved = reserved;
+- }
+-
+- qrecord->bytenr = bytenr;
+- qrecord->num_bytes = num_bytes;
+- qrecord->old_roots = NULL;
+-
+ if(btrfs_qgroup_trace_extent_nolock(fs_info,
+ delayed_refs, qrecord))
+ kfree(qrecord);
+@@ -708,7 +657,7 @@ add_delayed_ref_head(struct btrfs_fs_inf
+ } else {
+ if (old_ref_mod)
+ *old_ref_mod = 0;
+- if (is_data && count_mod < 0)
++ if (is_data && head_ref->ref_mod < 0)
+ delayed_refs->pending_csums += num_bytes;
+ delayed_refs->num_heads++;
+ delayed_refs->num_heads_ready++;
diff --git a/series.conf b/series.conf
index eb778b7136..f8b56f7e5d 100644
--- a/series.conf
+++ b/series.conf
@@ -24464,6 +24464,7 @@
patches.suse/0004-btrfs-Open-code-add_delayed_tree_ref.patch
patches.suse/0005-btrfs-Open-code-add_delayed_data_ref.patch
patches.suse/0006-btrfs-Introduce-init_delayed_ref_head.patch
+ patches.suse/0007-btrfs-Use-init_delayed_ref_head-in-add_delayed_ref_h.patch
patches.fixes/0001-btrfs-qgroup-Search-commit-root-for-rescan-to-avoid-.patch
patches.fixes/0001-dlm-fix-a-clerical-error-when-set-SCTP_NODELAY.patch
patches.fixes/0002-dlm-make-sctp_connect_to_sock-return-in-specified-ti.patch