1 ext4: translate fallocate mode bits to strings
3 From: Lukas Czerner <lczerner@redhat.com>
5 Signed-off-by: Lukas Czerner <lczerner@redhat.com>
6 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
9 fs/ext4/extents.c | 1 -
10 include/trace/events/ext4.h | 9 +++++++--
11 3 files changed, 8 insertions(+), 3 deletions(-)
13 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
14 index ece5556..3b9601c 100644
18 #include <linux/percpu_counter.h>
19 #include <linux/ratelimit.h>
20 #include <crypto/hash.h>
21 +#include <linux/falloc.h>
23 #include <linux/compat.h>
25 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
26 index 0e675bc..e5485eb 100644
27 --- a/fs/ext4/extents.c
28 +++ b/fs/ext4/extents.c
30 #include <linux/quotaops.h>
31 #include <linux/string.h>
32 #include <linux/slab.h>
33 -#include <linux/falloc.h>
34 #include <asm/uaccess.h>
35 #include <linux/fiemap.h>
36 #include "ext4_jbd2.h"
37 diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
38 index 197d312..451e020 100644
39 --- a/include/trace/events/ext4.h
40 +++ b/include/trace/events/ext4.h
41 @@ -68,6 +68,11 @@ struct extent_status;
42 { EXTENT_STATUS_DELAYED, "D" }, \
43 { EXTENT_STATUS_HOLE, "H" })
45 +#define show_falloc_mode(mode) __print_flags(mode, "|", \
46 + { FALLOC_FL_KEEP_SIZE, "KEEP_SIZE"}, \
47 + { FALLOC_FL_PUNCH_HOLE, "PUNCH_HOLE"}, \
48 + { FALLOC_FL_NO_HIDE_STALE, "NO_HIDE_STALE"})
51 TRACE_EVENT(ext4_free_inode,
52 TP_PROTO(struct inode *inode),
53 @@ -1349,10 +1354,10 @@ TRACE_EVENT(ext4_fallocate_enter,
57 - TP_printk("dev %d,%d ino %lu pos %lld len %lld mode %d",
58 + TP_printk("dev %d,%d ino %lu pos %lld len %lld mode %s",
59 MAJOR(__entry->dev), MINOR(__entry->dev),
60 (unsigned long) __entry->ino, __entry->pos,
61 - __entry->len, __entry->mode)
62 + __entry->len, show_falloc_mode(__entry->mode))
65 TRACE_EVENT(ext4_fallocate_exit,