f2fs: use block layer helper for show_bio_op macro [Linux 5.3]

This Linux kernel change "f2fs: use block layer helper for show_bio_op macro" is included in the Linux 5.3 release. This change is authored by Chaitanya Kulkarni <chaitanya.kulkarni [at] wdc.com> on Thu Jun 20 10:59:19 2019 -0700. The commit for this change in Linux stable tree is 0ce3537 (patch).

f2fs: use block layer helper for show_bio_op macro

Adjust the f2fs tracing code to use newly introduced block layer
function blk_op_str() which converts the REQ_OP_XXX into the string
XXX.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

There are 11 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 include/trace/events/f2fs.h | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index 53b96f1..e3dc031 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -76,16 +76,7 @@
 #define show_bio_type(op,op_flags) show_bio_op(op),        \
                        show_bio_op_flags(op_flags)

-#define show_bio_op(op)                            \
-   __print_symbolic(op,                        \
-       { REQ_OP_READ,          "READ" },       \
-       { REQ_OP_WRITE,         "WRITE" },      \
-       { REQ_OP_FLUSH,         "FLUSH" },      \
-       { REQ_OP_DISCARD,       "DISCARD" },        \
-       { REQ_OP_SECURE_ERASE,      "SECURE_ERASE" },   \
-       { REQ_OP_ZONE_RESET,        "ZONE_RESET" },     \
-       { REQ_OP_WRITE_SAME,        "WRITE_SAME" },     \
-       { REQ_OP_WRITE_ZEROES,      "WRITE_ZEROES" })
+#define show_bio_op(op)        blk_op_str(op)

 #define show_bio_op_flags(flags)                   \
    __print_flags(F2FS_BIO_FLAG_MASK(flags), "|",           \

Leave a Reply

Your email address will not be published. Required fields are marked *