summaryrefslogtreecommitdiff
path: root/ctree.h
diff options
context:
space:
mode:
authorMisono, Tomohiro <misono.tomohiro@jp.fujitsu.com>2017-10-31 14:40:24 +0900
committerDavid Sterba <dsterba@suse.com>2018-01-03 17:08:57 +0100
commitf23506c8a43f4c330884bd33bf9f1833368af6a3 (patch)
tree5c0418f7d1c4dd0aabfbc8ff91e4d170c60504e9 /ctree.h
parent89568f1bdfac95a02c0244d06920e485fdedfa0c (diff)
btrfs-progs: dump-tree: print c/o/s/r time of ROOT_ITEM
Currently ctime/otime/stime/rtime of ROOT_ITEM are not printed in print_root_item(). Fix this and print them if the values are not zero. The function print_timespec() is moved forward to reuse. Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'ctree.h')
-rw-r--r--ctree.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/ctree.h b/ctree.h
index b92df1c1..ef422ea6 100644
--- a/ctree.h
+++ b/ctree.h
@@ -2072,6 +2072,38 @@ BTRFS_SETGET_STACK_FUNCS(root_stransid, struct btrfs_root_item,
BTRFS_SETGET_STACK_FUNCS(root_rtransid, struct btrfs_root_item,
rtransid, 64);
+static inline struct btrfs_timespec* btrfs_root_ctime(
+ struct btrfs_root_item *root_item)
+{
+ unsigned long ptr = (unsigned long)root_item;
+ ptr += offsetof(struct btrfs_root_item, ctime);
+ return (struct btrfs_timespec *)ptr;
+}
+
+static inline struct btrfs_timespec* btrfs_root_otime(
+ struct btrfs_root_item *root_item)
+{
+ unsigned long ptr = (unsigned long)root_item;
+ ptr += offsetof(struct btrfs_root_item, otime);
+ return (struct btrfs_timespec *)ptr;
+}
+
+static inline struct btrfs_timespec* btrfs_root_stime(
+ struct btrfs_root_item *root_item)
+{
+ unsigned long ptr = (unsigned long)root_item;
+ ptr += offsetof(struct btrfs_root_item, stime);
+ return (struct btrfs_timespec *)ptr;
+}
+
+static inline struct btrfs_timespec* btrfs_root_rtime(
+ struct btrfs_root_item *root_item)
+{
+ unsigned long ptr = (unsigned long)root_item;
+ ptr += offsetof(struct btrfs_root_item, rtime);
+ return (struct btrfs_timespec *)ptr;
+}
+
/* struct btrfs_root_backup */
BTRFS_SETGET_STACK_FUNCS(backup_tree_root, struct btrfs_root_backup,
tree_root, 64);