File fix-btrfs-make-btrfs_ordered_extent-naming-consistent-v5.6.patch of Package lttng-modules.20220
From: Michael Jeanson <mjeanson@efficios.com>
Subject: fix: btrfs: make btrfs_ordered_extent naming consistent (v5.6)
Date: Tue Feb 11 14:47:23 2020 -0500
Git-commit: b5b20310a14b880ab14a515f10bfbb330f9a301b
References: bsc#1176126
Signed-off-by: Tony Jones <tonyj@suse.de>
X-Info: adjust patch for SLE (CONFIG_SUSE_KERNEL)
fix: btrfs: make btrfs_ordered_extent naming consistent (v5.6)
See upstream commit :
commit bffe633e00fb6b904817137fc17a44b42efcd985
Author: Omar Sandoval <osandov@fb.com>
Date: Mon Dec 2 17:34:19 2019 -0800
btrfs: make btrfs_ordered_extent naming consistent with btrfs_file_extent_item
ordered->start, ordered->len, and ordered->disk_len correspond to
fi->disk_bytenr, fi->num_bytes, and fi->disk_num_bytes, respectively.
It's confusing to translate between the two naming schemes. Since a
btrfs_ordered_extent is basically a pending btrfs_file_extent_item,
let's make the former use the naming from the latter.
Note that I didn't touch the names in tracepoints just in case there are
scripts depending on the current naming.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
diff --git a/instrumentation/events/lttng-module/btrfs.h b/instrumentation/events/lttng-module/btrfs.h
index c8c494a..0755c38 100644
--- a/instrumentation/events/lttng-module/btrfs.h
+++ b/instrumentation/events/lttng-module/btrfs.h
@@ -345,7 +345,29 @@ LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist,
)
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) || defined (CONFIG_SUSE_KERNEL))
+LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
+
+ TP_PROTO(const struct inode *inode,
+ const struct btrfs_ordered_extent *ordered),
+
+ TP_ARGS(inode, ordered),
+
+ TP_FIELDS(
+ ctf_integer(ino_t, ino, inode->i_ino)
+ ctf_integer(u64, file_offset, ordered->file_offset)
+ ctf_integer(u64, start, ordered->disk_bytenr)
+ ctf_integer(u64, len, ordered->num_bytes)
+ ctf_integer(u64, disk_len, ordered->disk_num_bytes)
+ ctf_integer(u64, bytes_left, ordered->bytes_left)
+ ctf_integer(unsigned long, flags, ordered->flags)
+ ctf_integer(int, compress_type, ordered->compress_type)
+ ctf_integer(int, refs, refcount_read(&ordered->refs))
+ ctf_integer(u64, root_objectid,
+ BTRFS_I(inode)->root->root_key.objectid)
+ )
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
TP_PROTO(const struct inode *inode,