ext4: translate fallocate mode bits to strings
authorLukas Czerner <lczerner@redhat.com>
Sat, 22 Feb 2014 11:18:17 +0000 (06:18 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 22 Feb 2014 11:18:17 +0000 (06:18 -0500)
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/extents.c
include/trace/events/ext4.h

index d3a534f..b7207db 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/percpu_counter.h>
 #include <linux/ratelimit.h>
 #include <crypto/hash.h>
+#include <linux/falloc.h>
 #ifdef __KERNEL__
 #include <linux/compat.h>
 #endif
index ef4b535..2e0608e 100644 (file)
@@ -37,7 +37,6 @@
 #include <linux/quotaops.h>
 #include <linux/string.h>
 #include <linux/slab.h>
-#include <linux/falloc.h>
 #include <asm/uaccess.h>
 #include <linux/fiemap.h>
 #include "ext4_jbd2.h"
index 197d312..451e020 100644 (file)
@@ -68,6 +68,11 @@ struct extent_status;
        { EXTENT_STATUS_DELAYED,        "D" },                  \
        { EXTENT_STATUS_HOLE,           "H" })
 
+#define show_falloc_mode(mode) __print_flags(mode, "|",                \
+       { FALLOC_FL_KEEP_SIZE,          "KEEP_SIZE"},           \
+       { FALLOC_FL_PUNCH_HOLE,         "PUNCH_HOLE"},          \
+       { FALLOC_FL_NO_HIDE_STALE,      "NO_HIDE_STALE"})
+
 
 TRACE_EVENT(ext4_free_inode,
        TP_PROTO(struct inode *inode),
@@ -1349,10 +1354,10 @@ TRACE_EVENT(ext4_fallocate_enter,
                __entry->mode   = mode;
        ),
 
-       TP_printk("dev %d,%d ino %lu pos %lld len %lld mode %d",
+       TP_printk("dev %d,%d ino %lu pos %lld len %lld mode %s",
                  MAJOR(__entry->dev), MINOR(__entry->dev),
                  (unsigned long) __entry->ino, __entry->pos,
-                 __entry->len, __entry->mode)
+                 __entry->len, show_falloc_mode(__entry->mode))
 );
 
 TRACE_EVENT(ext4_fallocate_exit,