Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2019-05-15 14:43:25 +0800
committerQu Wenruo <wqu@suse.com>2019-05-15 14:43:25 +0800
commit595997361a4d349a5c389b6332936d09fd4d8727 (patch)
tree4eb340b9d760644d93b6bcc20448eea1a96c57b1
parenteedfcc910a1fe9b6f950fd92a8ec45c368ce3d57 (diff)
- btrfs: delayed-ref: Use btrfs_ref to refactor
btrfs_add_delayed_data_ref() (bsc#1063638 bsc#1128052 bsc#1108838). - Refresh patches.suse/revert-btrfs-qgroup-move-half-of-the-qgroup-accounting-time-out-of-commit-trans.patch.
-rw-r--r--patches.suse/0004-btrfs-delayed-ref-Use-btrfs_ref-to-refactor-btrfs_ad.patch124
-rw-r--r--patches.suse/revert-btrfs-qgroup-move-half-of-the-qgroup-accounting-time-out-of-commit-trans.patch12
-rw-r--r--series.conf1
3 files changed, 131 insertions, 6 deletions
diff --git a/patches.suse/0004-btrfs-delayed-ref-Use-btrfs_ref-to-refactor-btrfs_ad.patch b/patches.suse/0004-btrfs-delayed-ref-Use-btrfs_ref-to-refactor-btrfs_ad.patch
new file mode 100644
index 0000000000..cefdb23914
--- /dev/null
+++ b/patches.suse/0004-btrfs-delayed-ref-Use-btrfs_ref-to-refactor-btrfs_ad.patch
@@ -0,0 +1,124 @@
+From 76675593b69f2fcd57e24d9dd2a9b278f0130d0b Mon Sep 17 00:00:00 2001
+From: Qu Wenruo <wqu@suse.com>
+Date: Thu, 4 Apr 2019 14:45:32 +0800
+Git-commit: 76675593b69f2fcd57e24d9dd2a9b278f0130d0b
+References: bsc#1063638 bsc#1128052 bsc#1108838
+Patch-mainline: v5.2-rc1
+Subject: [PATCH 4/9] btrfs: delayed-ref: Use btrfs_ref to refactor
+ btrfs_add_delayed_data_ref()
+
+Just like btrfs_add_delayed_tree_ref(), use btrfs_ref to refactor
+btrfs_add_delayed_data_ref().
+
+Signed-off-by: Qu Wenruo <wqu@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+---
+ fs/btrfs/delayed-ref.c | 16 ++++++++++++----
+ fs/btrfs/delayed-ref.h | 4 +---
+ fs/btrfs/extent-tree.c | 22 ++++++++++------------
+ 3 files changed, 23 insertions(+), 19 deletions(-)
+
+--- a/fs/btrfs/delayed-ref.c
++++ b/fs/btrfs/delayed-ref.c
+@@ -815,9 +815,7 @@ free_ref:
+ */
+ int btrfs_add_delayed_data_ref(struct btrfs_fs_info *fs_info,
+ struct btrfs_trans_handle *trans,
+- u64 bytenr, u64 num_bytes,
+- u64 parent, u64 ref_root,
+- u64 owner, u64 offset, u64 reserved, int action,
++ struct btrfs_ref *generic_ref, u64 reserved,
+ int *old_ref_mod, int *new_ref_mod)
+ {
+ struct btrfs_delayed_data_ref *ref;
+@@ -825,9 +823,17 @@ int btrfs_add_delayed_data_ref(struct bt
+ struct btrfs_delayed_ref_root *delayed_refs;
+ struct btrfs_qgroup_extent_record *record = NULL;
+ int qrecord_inserted;
++ int action = generic_ref->action;
+ int ret;
++ u64 bytenr = generic_ref->bytenr;
++ u64 num_bytes = generic_ref->len;
++ u64 parent = generic_ref->parent;
++ u64 ref_root = generic_ref->data_ref.ref_root;
++ u64 owner = generic_ref->data_ref.ino;
++ u64 offset = generic_ref->data_ref.offset;
+ u8 ref_type;
+
++ ASSERT(generic_ref->type == BTRFS_REF_DATA && action);
+ ref = kmem_cache_alloc(btrfs_delayed_data_ref_cachep, GFP_NOFS);
+ if (!ref)
+ return -ENOMEM;
+@@ -851,7 +857,9 @@ int btrfs_add_delayed_data_ref(struct bt
+ }
+
+ if (test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags) &&
+- is_fstree(ref_root)) {
++ is_fstree(ref_root) &&
++ is_fstree(generic_ref->real_root) &&
++ !generic_ref->skip_qgroup) {
+ record = kzalloc(sizeof(*record), GFP_NOFS);
+ if (!record) {
+ kmem_cache_free(btrfs_delayed_data_ref_cachep, ref);
+--- a/fs/btrfs/delayed-ref.h
++++ b/fs/btrfs/delayed-ref.h
+@@ -351,9 +351,7 @@ int btrfs_add_delayed_tree_ref(struct bt
+ int *old_ref_mod, int *new_ref_mod);
+ int btrfs_add_delayed_data_ref(struct btrfs_fs_info *fs_info,
+ struct btrfs_trans_handle *trans,
+- u64 bytenr, u64 num_bytes,
+- u64 parent, u64 ref_root,
+- u64 owner, u64 offset, u64 reserved, int action,
++ struct btrfs_ref *generic_ref, u64 reserved,
+ int *old_ref_mod, int *new_ref_mod);
+ int btrfs_add_delayed_extent_op(struct btrfs_fs_info *fs_info,
+ struct btrfs_trans_handle *trans,
+--- a/fs/btrfs/extent-tree.c
++++ b/fs/btrfs/extent-tree.c
+@@ -2128,10 +2128,8 @@ int btrfs_inc_extent_ref(struct btrfs_tr
+ ret = btrfs_add_delayed_tree_ref(fs_info, trans, &generic_ref,
+ NULL, &old_ref_mod, &new_ref_mod);
+ } else {
+- ret = btrfs_add_delayed_data_ref(fs_info, trans, bytenr,
+- num_bytes, parent,
+- root_objectid, owner, offset,
+- 0, BTRFS_ADD_DELAYED_REF,
++ btrfs_init_data_ref(&generic_ref, root_objectid, owner, offset);
++ ret = btrfs_add_delayed_data_ref(fs_info, trans, &generic_ref, 0,
+ &old_ref_mod, &new_ref_mod);
+ }
+
+@@ -7213,10 +7211,8 @@ int btrfs_free_extent(struct btrfs_trans
+ ret = btrfs_add_delayed_tree_ref(fs_info, trans, &generic_ref,
+ NULL, &old_ref_mod, &new_ref_mod);
+ } else {
+- ret = btrfs_add_delayed_data_ref(fs_info, trans, bytenr,
+- num_bytes, parent,
+- root_objectid, owner, offset,
+- 0, BTRFS_DROP_DELAYED_REF,
++ btrfs_init_data_ref(&generic_ref, root_objectid, owner, offset);
++ ret = btrfs_add_delayed_data_ref(fs_info, trans, &generic_ref, 0,
+ &old_ref_mod, &new_ref_mod);
+ }
+
+@@ -8167,14 +8163,16 @@ int btrfs_alloc_reserved_file_extent(str
+ struct btrfs_key *ins)
+ {
+ struct btrfs_fs_info *fs_info = trans->fs_info;
++ struct btrfs_ref generic_ref = { 0 };
+ int ret;
+
+ BUG_ON(root_objectid == BTRFS_TREE_LOG_OBJECTID);
+
+- ret = btrfs_add_delayed_data_ref(fs_info, trans, ins->objectid,
+- ins->offset, 0, root_objectid, owner,
+- offset, ram_bytes,
+- BTRFS_ADD_DELAYED_EXTENT, NULL, NULL);
++ btrfs_init_generic_ref(&generic_ref, BTRFS_ADD_DELAYED_EXTENT,
++ ins->objectid, ins->offset, 0);
++ btrfs_init_data_ref(&generic_ref, root_objectid, owner, offset);
++ ret = btrfs_add_delayed_data_ref(fs_info, trans, &generic_ref,
++ ram_bytes, NULL, NULL);
+ return ret;
+ }
+
diff --git a/patches.suse/revert-btrfs-qgroup-move-half-of-the-qgroup-accounting-time-out-of-commit-trans.patch b/patches.suse/revert-btrfs-qgroup-move-half-of-the-qgroup-accounting-time-out-of-commit-trans.patch
index a099ef80ca..48b920d0b5 100644
--- a/patches.suse/revert-btrfs-qgroup-move-half-of-the-qgroup-accounting-time-out-of-commit-trans.patch
+++ b/patches.suse/revert-btrfs-qgroup-move-half-of-the-qgroup-accounting-time-out-of-commit-trans.patch
@@ -107,15 +107,15 @@ Acked-by: Jeff Mahoney <jeffm@suse.com>
return 0;
free_head_ref:
-@@ -824,7 +814,6 @@ int btrfs_add_delayed_data_ref(struct bt
+@@ -822,7 +812,6 @@ int btrfs_add_delayed_data_ref(struct bt
struct btrfs_delayed_ref_head *head_ref;
struct btrfs_delayed_ref_root *delayed_refs;
struct btrfs_qgroup_extent_record *record = NULL;
- int qrecord_inserted;
+ int action = generic_ref->action;
int ret;
- u8 ref_type;
-
-@@ -873,8 +862,7 @@ int btrfs_add_delayed_data_ref(struct bt
+ u64 bytenr = generic_ref->bytenr;
+@@ -881,8 +870,7 @@ int btrfs_add_delayed_data_ref(struct bt
* the spin lock
*/
head_ref = add_delayed_ref_head(fs_info, trans, head_ref, record,
@@ -125,7 +125,7 @@ Acked-by: Jeff Mahoney <jeffm@suse.com>
ret = insert_delayed_ref(trans, delayed_refs, head_ref, &ref->node);
spin_unlock(&delayed_refs->lock);
-@@ -885,8 +873,6 @@ int btrfs_add_delayed_data_ref(struct bt
+@@ -893,8 +881,6 @@ int btrfs_add_delayed_data_ref(struct bt
if (ret > 0)
kmem_cache_free(btrfs_delayed_data_ref_cachep, ref);
@@ -134,7 +134,7 @@ Acked-by: Jeff Mahoney <jeffm@suse.com>
return 0;
}
-@@ -912,7 +898,7 @@ int btrfs_add_delayed_extent_op(struct b
+@@ -920,7 +906,7 @@ int btrfs_add_delayed_extent_op(struct b
add_delayed_ref_head(fs_info, trans, head_ref, NULL,
BTRFS_UPDATE_DELAYED_HEAD,
diff --git a/series.conf b/series.conf
index 9c9a4de676..0b8d497c2f 100644
--- a/series.conf
+++ b/series.conf
@@ -21788,6 +21788,7 @@
patches.suse/0001-btrfs-delayed-ref-Introduce-better-documented-delaye.patch
patches.suse/0002-btrfs-extent-tree-Open-code-process_func-in-__btrfs_.patch
patches.suse/0003-btrfs-delayed-ref-Use-btrfs_ref-to-refactor-btrfs_ad.patch
+ patches.suse/0004-btrfs-delayed-ref-Use-btrfs_ref-to-refactor-btrfs_ad.patch
patches.drivers/mmc-core-fix-possible-use-after-free-of-host.patch
patches.drivers/phy-sun4i-usb-Make-sure-to-disable-PHY0-passby-for-p.patch
patches.drivers/stm-class-Fix-channel-free-in-stm-output-free-path.patch