nilfs2: implement hexdump of internal structures option
Subsystems (2)
PATCH 21/24 nilfs2: implement hexdump of internal structures option
From: Vyacheslav Dubeyko <[email protected]>
Subject: [PATCH 21/24] nilfs2: implement hexdump of internal structures option
This patch implements DBG_HEX_DUMP flag using. This flag requests writing in system log hexdumps of internal structures.
Signed-off-by Vyacheslav Dubeyko <[email protected]>
CC Ryusuke Konishi <[email protected]>
--- fs/nilfs2/btree.c | 126 +++++++++++++++++++++++++++++++++++++++++++++++++ fs/nilfs2/cpfile.c | 10 ++++ fs/nilfs2/dat.c | 5 ++ fs/nilfs2/direct.c | 28 +++++++++++ fs/nilfs2/ifile.c | 2 + fs/nilfs2/inode.c | 5 ++ fs/nilfs2/recovery.c | 20 ++++++++ fs/nilfs2/segment.c | 84 +++++++++++++++++++++++++++++++++ fs/nilfs2/sufile.c | 6 +++ fs/nilfs2/the_nilfs.c | 2 + 10 files changed, 288 insertions(+)
fs/nilfs2/btree.c +126 -0
@@ -75,6 +75,8 @@ static int nilfs_btree_get_new_block(const struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK |DBG_SPAM ),"i_ino %lu, ptr %llu\n" , btnc->host->i_ino, ptr); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP |DBG_SPAM ), +"btree: " , btree,sizeof (struct nilfs_bmap )); bh =nilfs_btnode_create_block (btnc, ptr);if (!bh)
@@ -184,6 +186,10 @@ static void nilfs_btree_node_init(struct nilfs_btree_node *node, int flags,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"node %p, flags %d, level %d, nchildren %d, ncmax %d\n" , node, flags, level, nchildren, ncmax); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"keys: " , keys, nchildren *sizeof (__u64)); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"ptrs: " , ptrs, nchildren *sizeof (__u64));nilfs_btree_node_set_flags (node, flags);nilfs_btree_node_set_level (node, level);
@@ -195,6 +201,9 @@ static void nilfs_btree_node_init(struct nilfs_btree_node *node, int flags, dkeys[i] =cpu_to_le64 (keys[i]); dptrs[i] =cpu_to_le64 (ptrs[i]); } + +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"node: " , node,sizeof (struct nilfs_btree_node )); }/* Assume the buffer heads corresponding to left and right are locked. */
@@ -209,6 +218,10 @@ static void nilfs_btree_node_move_left(struct nilfs_btree_node *left,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"left %p, right %p, n %d, lncmax %d, rncmax %d\n" , left, right, n, lncmax, rncmax); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"left node: " , left,sizeof (struct nilfs_btree_node )); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"right node: " , right,sizeof (struct nilfs_btree_node )); ldkeys =nilfs_btree_node_dkeys (left); ldptrs =nilfs_btree_node_dptrs (left, lncmax);
@@ -241,6 +254,10 @@ static void nilfs_btree_node_move_right(struct nilfs_btree_node *left,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"left %p, right %p, n %d, lncmax %d, rncmax %d\n" , left, right, n, lncmax, rncmax); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"left node: " , left,sizeof (struct nilfs_btree_node )); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"right node: " , right,sizeof (struct nilfs_btree_node )); ldkeys =nilfs_btree_node_dkeys (left); ldptrs =nilfs_btree_node_dptrs (left, lncmax);
@@ -286,6 +303,9 @@ static void nilfs_btree_node_insert(struct nilfs_btree_node *node, int index, dptrs[index] =cpu_to_le64 (ptr); nchildren++;nilfs_btree_node_set_nchildren (node, nchildren); + +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"node: " , node,sizeof (struct nilfs_btree_node )); }/* Assume that the buffer head corresponding to node is locked. */
@@ -322,6 +342,8 @@ static void nilfs_btree_node_delete(struct nilfs_btree_node *node, int index,nilfs_btree_node_set_nchildren (node, nchildren);nilfs2_debug (DBG_BTREE ,"key %llu, ptr %llu\n" , key, ptr); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"node: " , node,sizeof (struct nilfs_btree_node )); } static int nilfs_btree_node_lookup(const struct nilfs_btree_node *node,
@@ -333,6 +355,8 @@ static int nilfs_btree_node_lookup(const struct nilfs_btree_node *node,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"node %p, key %llu, indexp %p\n" , node, key, indexp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"node: " , node,sizeof (struct nilfs_btree_node ));/* binary search */ low =0 ;
@@ -484,6 +508,8 @@ static int __nilfs_btree_get_block(const struct nilfs_bmap *btree, __u64 ptr,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK |DBG_SPAM ),"btree ino %lu, ptr %llu, bhp %p, ra %p\n" , btree->b_inode->i_ino, ptr, bhp, ra); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP |DBG_SPAM ), +"btree: " , btree,sizeof (struct nilfs_bmap )); ret =nilfs_btnode_submit_block (btnc, ptr,0 ,READ , &bh, &submit_ptr);if (ret) {
@@ -550,6 +576,8 @@ static int nilfs_btree_do_lookup(const struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, path %p, key %llu, ptrp %p, minlevel %d, ra %d\n" , btree->b_inode->i_ino, path, key, ptrp, minlevel, readahead); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); node =nilfs_btree_get_root (btree); level =nilfs_btree_node_get_level (node);
@@ -616,6 +644,8 @@ static int nilfs_btree_do_lookup_last(const struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, path %p, keyp %p, ptrp %p\n" , btree->b_inode->i_ino, path, keyp, ptrp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); node =nilfs_btree_get_root (btree); index =nilfs_btree_node_get_nchildren (node) -1 ;
@@ -661,6 +691,8 @@ static int nilfs_btree_lookup(const struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, key %llu, level %d, ptrp %p\n" , btree->b_inode->i_ino, key, level, ptrp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); path =nilfs_btree_alloc_path ();if (path ==NULL )
@@ -688,6 +720,8 @@ static int nilfs_btree_lookup_contig(const struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, key %llu, ptrp %p, maxblocks %u\n" , btree->b_inode->i_ino, key, ptrp, maxblocks); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); path =nilfs_btree_alloc_path ();if (path ==NULL )
@@ -769,6 +803,8 @@ static void nilfs_btree_promote_key(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK |DBG_SPAM ),"btree ino %lu, level %d, key %llu\n" , btree->b_inode->i_ino, level, key); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP |DBG_SPAM ), +"btree: " , btree,sizeof (struct nilfs_bmap ));if (level <nilfs_btree_height (btree) -1 ) { do {
@@ -798,6 +834,8 @@ static void nilfs_btree_do_insert(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, keyp %p, ptrp %p\n" , btree->b_inode->i_ino, level, keyp, ptrp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));if (level <nilfs_btree_height (btree) -1 ) { node =nilfs_btree_get_nonroot_node (path, level);
@@ -829,6 +867,8 @@ static void nilfs_btree_carry_left(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, keyp %p, ptrp %p\n" , btree->b_inode->i_ino, level, keyp, ptrp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); node =nilfs_btree_get_nonroot_node (path, level); left =nilfs_btree_get_sib_node (path, level);
@@ -879,6 +919,8 @@ static void nilfs_btree_carry_right(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, keyp %p, ptrp %p\n" , btree->b_inode->i_ino, level, keyp, ptrp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); node =nilfs_btree_get_nonroot_node (path, level); right =nilfs_btree_get_sib_node (path, level);
@@ -932,6 +974,8 @@ static void nilfs_btree_split(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, keyp %p, ptrp %p\n" , btree->b_inode->i_ino, level, keyp, ptrp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); node =nilfs_btree_get_nonroot_node (path, level); right =nilfs_btree_get_sib_node (path, level);
@@ -989,6 +1033,8 @@ static void nilfs_btree_grow(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, keyp %p, ptrp %p\n" , btree->b_inode->i_ino, level, keyp, ptrp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); root =nilfs_btree_get_root (btree); child =nilfs_btree_get_sib_node (path, level);
@@ -1020,6 +1066,8 @@ static __u64 nilfs_btree_find_near(const struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK |DBG_SPAM ),"btree ino %lu\n" , btree->b_inode->i_ino); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP |DBG_SPAM ), +"btree: " , btree,sizeof (struct nilfs_bmap ));if (path ==NULL )return NILFS_BMAP_INVALID_PTR ;
@@ -1053,6 +1101,8 @@ static __u64 nilfs_btree_find_target_v(const struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK |DBG_SPAM ),"btree ino %lu, key %llu\n" , btree->b_inode->i_ino, key); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP |DBG_SPAM ), +"btree: " , btree,sizeof (struct nilfs_bmap )); ptr =nilfs_bmap_find_target_seq (btree, key);if (ptr !=NILFS_BMAP_INVALID_PTR )
@@ -1082,6 +1132,10 @@ static int nilfs_btree_prepare_insert(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, levelp %p, key %llu, ptr %llu, stats %p\n" , btree->b_inode->i_ino, levelp, key, ptr, stats); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"stats: " , stats,sizeof (struct nilfs_bmap_stats )); stats->bs_nblocks =0 ; level =NILFS_BTREE_LEVEL_DATA ;
@@ -1231,6 +1285,8 @@ static void nilfs_btree_commit_insert(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, maxlevel %d, key %llu, ptr %llu\n" , btree->b_inode->i_ino, maxlevel, key, ptr); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));set_buffer_nilfs_volatile ((struct buffer_head *)((unsigned long )ptr)); ptr = path[NILFS_BTREE_LEVEL_DATA ].bp_newreq.bpr_ptr;
@@ -1258,6 +1314,8 @@ static int nilfs_btree_insert(struct nilfs_bmap *btree, __u64 key, __u64 ptr)nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, key %llu, ptr %llu\n" , btree->b_inode->i_ino, key, ptr); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); path =nilfs_btree_alloc_path ();if (path ==NULL )
@@ -1292,6 +1350,8 @@ static void nilfs_btree_do_delete(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, keyp %p, ptrp %p\n" , btree->b_inode->i_ino, level, keyp, ptrp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));if (level <nilfs_btree_height (btree) -1 ) { node =nilfs_btree_get_nonroot_node (path, level);
@@ -1321,6 +1381,8 @@ static void nilfs_btree_borrow_left(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, keyp %p, ptrp %p\n" , btree->b_inode->i_ino, level, keyp, ptrp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));nilfs_btree_do_delete (btree, path, level, keyp, ptrp);
@@ -1357,6 +1419,8 @@ static void nilfs_btree_borrow_right(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, keyp %p, ptrp %p\n" , btree->b_inode->i_ino, level, keyp, ptrp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));nilfs_btree_do_delete (btree, path, level, keyp, ptrp);
@@ -1394,6 +1458,8 @@ static void nilfs_btree_concat_left(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, keyp %p, ptrp %p\n" , btree->b_inode->i_ino, level, keyp, ptrp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));nilfs_btree_do_delete (btree, path, level, keyp, ptrp);
@@ -1424,6 +1490,8 @@ static void nilfs_btree_concat_right(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, keyp %p, ptrp %p\n" , btree->b_inode->i_ino, level, keyp, ptrp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));nilfs_btree_do_delete (btree, path, level, keyp, ptrp);
@@ -1453,6 +1521,8 @@ static void nilfs_btree_shrink(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, keyp %p, ptrp %p\n" , btree->b_inode->i_ino, level, keyp, ptrp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));nilfs_btree_do_delete (btree, path, level, keyp, ptrp);
@@ -1491,6 +1561,10 @@ static int nilfs_btree_prepare_delete(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, levelp %p, stats %p, dat %p\n" , btree->b_inode->i_ino, levelp, stats, dat); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"stats: " , stats,sizeof (struct nilfs_bmap_stats )); ret =0 ; stats->bs_nblocks =0 ;
@@ -1646,6 +1720,8 @@ static int nilfs_btree_delete(struct nilfs_bmap *btree, __u64 key)nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, key %llu\n" , btree->b_inode->i_ino, key); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); path =nilfs_btree_alloc_path ();if (path ==NULL )
@@ -1678,6 +1754,8 @@ static int nilfs_btree_last_key(const struct nilfs_bmap *btree, __u64 *keyp)nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, keyp %p\n" , btree->b_inode->i_ino, keyp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); path =nilfs_btree_alloc_path ();if (path ==NULL )
@@ -1701,6 +1779,8 @@ static int nilfs_btree_check_delete(struct nilfs_bmap *btree, __u64 key)nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, key %llu\n" , btree->b_inode->i_ino, key); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); root =nilfs_btree_get_root (btree);switch (nilfs_btree_height (btree)) {
@@ -1746,6 +1826,8 @@ static int nilfs_btree_gather_data(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, keys %p, ptrs %p, nitems %d\n" , btree->b_inode->i_ino, keys, ptrs, nitems); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); root =nilfs_btree_get_root (btree);switch (nilfs_btree_height (btree)) {
@@ -1800,6 +1882,10 @@ nilfs_btree_prepare_convert_and_insert(struct nilfs_bmap *btree, __u64 key,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, key %llu, dreq %p, nreq %p, bhp %p, stats %p\n" , btree->b_inode->i_ino, key, dreq, nreq, bhp, stats); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"stats: " , stats,sizeof (struct nilfs_bmap_stats )); stats->bs_nblocks =0 ;
@@ -1861,6 +1947,8 @@ nilfs_btree_commit_convert_and_insert(struct nilfs_bmap *btree,"btree ino %lu, key %llu, ptr %llu, keys %p," " ptrs %p, n %d, dreq %p, nreq %p, bh %p\n" , btree->b_inode->i_ino, key, ptr, keys, ptrs, n, dreq, nreq, bh); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));/* free resources */ if (btree->b_ops->bop_clear !=NULL )
@@ -1933,6 +2021,8 @@ int nilfs_btree_convert_and_insert(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, key %llu, ptr %llu, keys %p, ptrs %p, n %d\n" , btree->b_inode->i_ino, key, ptr, keys, ptrs, n); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));if (n +1 <=NILFS_BTREE_ROOT_NCHILDREN_MAX ) { di = &dreq;
@@ -1979,6 +2069,8 @@ static int nilfs_btree_prepare_update_v(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, dat %p\n" , btree->b_inode->i_ino, level, dat); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); parent =nilfs_btree_get_node (btree, path, level +1 , &ncmax); path[level].bp_oldreq.bpr_ptr =
@@ -2018,6 +2110,8 @@ static void nilfs_btree_commit_update_v(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, dat %p\n" , btree->b_inode->i_ino, level, dat); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); nilfs_dat_commit_update(dat, &path[level].bp_oldreq.bpr_req, &path[level].bp_newreq.bpr_req,
@@ -2043,6 +2137,8 @@ static void nilfs_btree_abort_update_v(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, dat %p\n" , btree->b_inode->i_ino, level, dat); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));nilfs_dat_abort_update (dat, &path[level].bp_oldreq.bpr_req, &path[level].bp_newreq.bpr_req);
@@ -2062,6 +2158,8 @@ static int nilfs_btree_prepare_propagate_v(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, minlevel %d, maxlevelp %p, dat %p\n" , btree->b_inode->i_ino, minlevel, maxlevelp, dat); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); level = minlevel;if (!buffer_nilfs_volatile (path[level].bp_bh)) {
@@ -2102,6 +2200,8 @@ static void nilfs_btree_commit_propagate_v(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, minlevel %d, maxlevel %d, bh %p, dat %p\n" , btree->b_inode->i_ino, minlevel, maxlevel, bh, dat); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));if (!buffer_nilfs_volatile (path[minlevel].bp_bh))nilfs_btree_commit_update_v (btree, path, minlevel, dat);
@@ -2123,6 +2223,8 @@ static int nilfs_btree_propagate_v(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, bh %p\n" , btree->b_inode->i_ino, level, bh); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));get_bh (bh); path[level].bp_bh = bh;
@@ -2160,6 +2262,8 @@ static int nilfs_btree_propagate(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, bh %p\n" , btree->b_inode->i_ino, bh); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));WARN_ON (!buffer_dirty (bh));
@@ -2213,6 +2317,8 @@ static void nilfs_btree_add_dirty_buffer(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, lists %p, bh %p\n" , btree->b_inode->i_ino, lists, bh); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap ));get_bh (bh); node = (struct nilfs_btree_node *)bh->b_data;
@@ -2253,6 +2359,8 @@ static void nilfs_btree_lookup_dirty_buffers(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, listp %p\n" , btree->b_inode->i_ino, listp); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); for (level = NILFS_BTREE_LEVEL_NODE_MIN; level < NILFS_BTREE_LEVEL_MAX;
@@ -2296,6 +2404,10 @@ static int nilfs_btree_assign_p(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, bh %p, blocknr %lu, binfo %p\n" , btree->b_inode->i_ino, level, bh, blocknr, binfo); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"binfo: " , binfo,sizeof (union nilfs_binfo )); parent =nilfs_btree_get_node (btree, path, level +1 , &ncmax); ptr = nilfs_btree_node_get_ptr(parent, path[level + 1].bp_index,
@@ -2343,6 +2455,10 @@ static int nilfs_btree_assign_v(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, level %d, bh %p, blocknr %lu, binfo %p\n" , btree->b_inode->i_ino, level, bh, blocknr, binfo); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"binfo: " , binfo,sizeof (union nilfs_binfo )); parent =nilfs_btree_get_node (btree, path, level +1 , &ncmax); ptr = nilfs_btree_node_get_ptr(parent, path[level + 1].bp_index,
@@ -2374,6 +2490,10 @@ static int nilfs_btree_assign(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, bh %p, blocknr %lu, binfo %p\n" , btree->b_inode->i_ino, bh, blocknr, binfo); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"binfo: " , binfo,sizeof (union nilfs_binfo )); path =nilfs_btree_alloc_path ();if (path ==NULL )
@@ -2416,6 +2536,10 @@ static int nilfs_btree_assign_gc(struct nilfs_bmap *btree,nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, bh %p, blocknr %lu, binfo %p\n" , btree->b_inode->i_ino, bh, blocknr, binfo); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"binfo: " , binfo,sizeof (union nilfs_binfo )); ret =nilfs_dat_move (nilfs_bmap_get_dat (btree), (*bh)->b_blocknr, blocknr);
@@ -2445,6 +2569,8 @@ static int nilfs_btree_mark(struct nilfs_bmap *btree, __u64 key, int level)nilfs2_debug ((DBG_BTREE |DBG_DUMP_STACK ),"btree ino %lu, key %llu, level %d\n" , btree->b_inode->i_ino, key, level); +nilfs2_hexdump ((DBG_BTREE |DBG_HEX_DUMP ), +"btree: " , btree,sizeof (struct nilfs_bmap )); path =nilfs_btree_alloc_path ();if (path ==NULL )
fs/nilfs2/cpfile.c +10 -0
@@ -404,6 +404,10 @@ static void nilfs_cpfile_checkpoint_to_cpinfo(struct inode *cpfile,nilfs2_debug ((DBG_CPFILE |DBG_DUMP_STACK ),"i_ino %lu, cp %p, ci %p\n" , cpfile->i_ino, cp, ci); +nilfs2_hexdump ((DBG_CPFILE |DBG_HEX_DUMP ), +"checkpoint: " , cp,sizeof (struct nilfs_checkpoint )); +nilfs2_hexdump ((DBG_CPFILE |DBG_HEX_DUMP ), +"cpinfo: " , ci,sizeof (struct nilfs_cpinfo )); ci->ci_flags =le32_to_cpu (cp->cp_flags); ci->ci_cno =le64_to_cpu (cp->cp_cno);
@@ -989,6 +993,10 @@ int nilfs_cpfile_get_stat(struct inode *cpfile, struct nilfs_cpstat *cpstat) out_sem:up_read (&NILFS_MDT (cpfile)->mi_sem); + +nilfs2_hexdump ((DBG_CPFILE |DBG_HEX_DUMP ), +"cpstat: " , cpstat,sizeof (struct nilfs_cpstat )); +return ret; }
@@ -1008,6 +1016,8 @@ int nilfs_cpfile_read(struct super_block *sb, size_t cpsize,nilfs2_debug ((DBG_CPFILE |DBG_DUMP_STACK ),"sb %p, cpsize %zu, raw_inode %p, inodep %p\n" , sb, cpsize, raw_inode, inodep); +nilfs2_hexdump ((DBG_CPFILE |DBG_HEX_DUMP ), +"raw_inode: " , raw_inode,sizeof (struct nilfs_inode )); cpfile =nilfs_iget_locked (sb,NULL ,NILFS_CPFILE_INO );if (unlikely (!cpfile))
fs/nilfs2/dat.c +5 -0
@@ -547,6 +547,9 @@ ssize_t nilfs_dat_get_vinfo(struct inode *dat, void *buf, unsigned visz,brelse (entry_bh); } +nilfs2_hexdump ((DBG_DAT |DBG_HEX_DUMP |DBG_SPAM ), +"vinfo: " , buf, nvi *sizeof (struct nilfs_vinfo )); +return nvi; }
@@ -568,6 +571,8 @@ int nilfs_dat_read(struct super_block *sb, size_t entry_size,nilfs2_debug ((DBG_DAT |DBG_DUMP_STACK ),"sb %p, entry_size %zu, raw_inode %p, inodep %p\n" , sb, entry_size, raw_inode, inodep); +nilfs2_hexdump ((DBG_DAT |DBG_HEX_DUMP ), +"raw_inode: " , raw_inode,sizeof (struct nilfs_inode )); dat =nilfs_iget_locked (sb,NULL ,NILFS_DAT_INO );if (unlikely (!dat))
fs/nilfs2/direct.c +28 -0
@@ -53,6 +53,8 @@ static int nilfs_direct_lookup(const struct nilfs_bmap *direct,nilfs2_debug ((DBG_DIRECT |DBG_DUMP_STACK ),"i_ino %lu, key %llu, level %d, ptrp %p\n" , direct->b_inode->i_ino, key, level, ptrp); +nilfs2_hexdump ((DBG_DIRECT |DBG_HEX_DUMP ), +"bmap: " , direct,sizeof (struct nilfs_bmap ));if (key >NILFS_DIRECT_KEY_MAX || level !=1 )return -ENOENT ;
@@ -78,6 +80,8 @@ static int nilfs_direct_lookup_contig(const struct nilfs_bmap *direct,nilfs2_debug ((DBG_DIRECT |DBG_DUMP_STACK ),"i_ino %lu, key %llu, ptrp %p, maxblocks %u\n" , direct->b_inode->i_ino, key, ptrp, maxblocks); +nilfs2_hexdump ((DBG_DIRECT |DBG_HEX_DUMP ), +"bmap: " , direct,sizeof (struct nilfs_bmap ));if (key >NILFS_DIRECT_KEY_MAX )return -ENOENT ;
@@ -122,6 +126,8 @@ nilfs_direct_find_target_v(const struct nilfs_bmap *direct, __u64 key)nilfs2_debug ((DBG_DIRECT |DBG_DUMP_STACK ),"i_ino %lu, key %llu\n" , direct->b_inode->i_ino, key); +nilfs2_hexdump ((DBG_DIRECT |DBG_HEX_DUMP ), +"bmap: " , direct,sizeof (struct nilfs_bmap )); ptr =nilfs_bmap_find_target_seq (direct, key);if (ptr !=NILFS_BMAP_INVALID_PTR )
@@ -142,6 +148,8 @@ static int nilfs_direct_insert(struct nilfs_bmap *bmap, __u64 key, __u64 ptr)nilfs2_debug ((DBG_DIRECT |DBG_DUMP_STACK ),"i_ino %lu, key %llu, ptr %llu\n" , bmap->b_inode->i_ino, key, ptr); +nilfs2_hexdump ((DBG_DIRECT |DBG_HEX_DUMP ), +"bmap: " , bmap,sizeof (struct nilfs_bmap ));if (key >NILFS_DIRECT_KEY_MAX )return -ENOENT ;
@@ -181,6 +189,8 @@ static int nilfs_direct_delete(struct nilfs_bmap *bmap, __u64 key)nilfs2_debug ((DBG_DIRECT |DBG_DUMP_STACK ),"i_ino %lu, key %llu\n" , bmap->b_inode->i_ino, key); +nilfs2_hexdump ((DBG_DIRECT |DBG_HEX_DUMP ), +"bmap: " , bmap,sizeof (struct nilfs_bmap ));if (key >NILFS_DIRECT_KEY_MAX ||nilfs_direct_get_ptr (bmap, key) ==NILFS_BMAP_INVALID_PTR )
@@ -231,6 +241,8 @@ static int nilfs_direct_gather_data(struct nilfs_bmap *direct,nilfs2_debug ((DBG_DIRECT |DBG_DUMP_STACK ),"i_ino %lu, keys %p, ptrs %p, nitems %d\n" , direct->b_inode->i_ino, keys, ptrs, nitems); +nilfs2_hexdump ((DBG_DIRECT |DBG_HEX_DUMP ), +"bmap: " , direct,sizeof (struct nilfs_bmap ));if (nitems >NILFS_DIRECT_NBLOCKS ) nitems =NILFS_DIRECT_NBLOCKS ;
@@ -255,6 +267,8 @@ int nilfs_direct_delete_and_convert(struct nilfs_bmap *bmap,nilfs2_debug ((DBG_DIRECT |DBG_DUMP_STACK ),"i_ino %lu, keys %p, ptrs %p, n %d\n" , bmap->b_inode->i_ino, keys, ptrs, n); +nilfs2_hexdump ((DBG_DIRECT |DBG_HEX_DUMP ), +"bmap: " , bmap,sizeof (struct nilfs_bmap ));/* no need to allocate any resource for conversion */
@@ -295,6 +309,8 @@ static int nilfs_direct_propagate(struct nilfs_bmap *bmap,nilfs2_debug ((DBG_DIRECT |DBG_DUMP_STACK ),"i_ino %lu, bh %p\n" , bmap->b_inode->i_ino, bh); +nilfs2_hexdump ((DBG_DIRECT |DBG_HEX_DUMP ), +"bmap: " , bmap,sizeof (struct nilfs_bmap ));if (!NILFS_BMAP_USE_VBN (bmap))return 0 ;
@@ -332,6 +348,10 @@ static int nilfs_direct_assign_v(struct nilfs_bmap *direct,"i_ino %lu, key %llu, ptr %llu, " "bh %p, blocknr %lu, binfo %p\n" , direct->b_inode->i_ino, key, ptr, bh, blocknr, binfo); +nilfs2_hexdump ((DBG_DIRECT |DBG_HEX_DUMP ), +"bmap: " , direct,sizeof (struct nilfs_bmap )); +nilfs2_hexdump ((DBG_DIRECT |DBG_HEX_DUMP ), +"binfo: " , binfo,sizeof (union nilfs_binfo )); req.bpr_ptr = ptr; ret =nilfs_dat_prepare_start (dat, &req.bpr_req);
@@ -353,6 +373,10 @@ static int nilfs_direct_assign_p(struct nilfs_bmap *direct,"i_ino %lu, key %llu, ptr %llu, " "bh %p, blocknr %lu, binfo %p\n" , direct->b_inode->i_ino, key, ptr, bh, blocknr, binfo); +nilfs2_hexdump ((DBG_DIRECT |DBG_HEX_DUMP ), +"bmap: " , direct,sizeof (struct nilfs_bmap )); +nilfs2_hexdump ((DBG_DIRECT |DBG_HEX_DUMP ), +"binfo: " , binfo,sizeof (union nilfs_binfo ));nilfs_direct_set_ptr (direct, key, blocknr);
@@ -373,6 +397,10 @@ static int nilfs_direct_assign(struct nilfs_bmap *bmap,nilfs2_debug ((DBG_DIRECT |DBG_DUMP_STACK ),"i_ino %lu, bh %p, blocknr %lu, binfo %p\n" , bmap->b_inode->i_ino, bh, blocknr, binfo); +nilfs2_hexdump ((DBG_DIRECT |DBG_HEX_DUMP ), +"bmap: " , bmap,sizeof (struct nilfs_bmap )); +nilfs2_hexdump ((DBG_DIRECT |DBG_HEX_DUMP ), +"binfo: " , binfo,sizeof (union nilfs_binfo )); key =nilfs_bmap_data_get_key (bmap, *bh);if (unlikely (key >NILFS_DIRECT_KEY_MAX )) {
fs/nilfs2/ifile.c +2 -0
@@ -190,6 +190,8 @@ int nilfs_ifile_read(struct super_block *sb, struct nilfs_root *root,nilfs2_debug ((DBG_IFILE |DBG_DUMP_STACK ),"sb %p, root %p, inode_size %zu, raw_inode %p, inodep %p\n" , sb, root, inode_size, raw_inode, inodep); +nilfs2_hexdump ((DBG_IFILE |DBG_HEX_DUMP ), +"raw_inode: " , raw_inode,sizeof (struct nilfs_inode )); ifile =nilfs_iget_locked (sb, root,NILFS_IFILE_INO );if (unlikely (!ifile))
fs/nilfs2/inode.c +5 -0
@@ -511,6 +511,8 @@ int nilfs_read_inode_common(struct inode *inode,nilfs2_debug ((DBG_INODE |DBG_DUMP_STACK ),"i_ino %lu\n" , inode->i_ino); +nilfs2_hexdump ((DBG_INODE |DBG_HEX_DUMP ), +"raw_inode: " , raw_inode,sizeof (struct nilfs_inode )); inode->i_mode =le16_to_cpu (raw_inode->i_mode);i_uid_write (inode,le32_to_cpu (raw_inode->i_uid));
@@ -760,6 +762,9 @@ void nilfs_write_inode_common(struct inode *inode,cpu_to_le64 (huge_encode_dev (inode->i_rdev));/* When extending inode, nilfs->ns_inode_size should be checked for substitutions of appended fields */ + +nilfs2_hexdump ((DBG_INODE |DBG_HEX_DUMP ), +"raw_inode: " , raw_inode,sizeof (struct nilfs_inode )); }void nilfs_update_inode (struct inode *inode,struct buffer_head *ibh)
fs/nilfs2/recovery.c +20 -0
@@ -474,6 +474,9 @@ static int nilfs_prepare_segment_for_recovery(struct the_nilfs *nilfs,nilfs2_debug ((DBG_RECOVERY |DBG_DUMP_STACK ),"nilfs %p, sb %p, ri %p\n" , nilfs, sb, ri); +nilfs2_hexdump ((DBG_RECOVERY |DBG_HEX_DUMP ), +"recovery info: " , + ri,sizeof (struct nilfs_recovery_info )); segnum[0 ] = nilfs->ns_segnum; segnum[1 ] = nilfs->ns_nextnum;
@@ -532,6 +535,9 @@ static int nilfs_recovery_copy_block(struct the_nilfs *nilfs,nilfs2_debug ((DBG_RECOVERY |DBG_DUMP_STACK ),"nilfs %p, rb %p, i_ino %lu\n" , nilfs, rb, page->mapping->host->i_ino); +nilfs2_hexdump ((DBG_RECOVERY |DBG_HEX_DUMP ), +"recovery block: " , + rb,sizeof (struct nilfs_recovery_block )); bh_org =__bread (nilfs->ns_bdev, rb->blocknr, nilfs->ns_blocksize);if (unlikely (!bh_org))
@@ -650,6 +656,9 @@ static int nilfs_do_roll_forward(struct the_nilfs *nilfs,nilfs2_debug ((DBG_RECOVERY |DBG_DUMP_STACK ),"nilfs %p, sb %p, root %p, ri %p\n" , nilfs, sb, root, ri); +nilfs2_hexdump ((DBG_RECOVERY |DBG_HEX_DUMP ), +"recovery info: " , + ri,sizeof (struct nilfs_recovery_info )); pseg_start = ri->ri_lsegs_start; seg_seq = ri->ri_lsegs_start_seq;
@@ -761,6 +770,9 @@ static void nilfs_finish_roll_forward(struct the_nilfs *nilfs,nilfs2_debug ((DBG_RECOVERY |DBG_DUMP_STACK ),"nilfs %p, ri %p\n" , nilfs, ri); +nilfs2_hexdump ((DBG_RECOVERY |DBG_HEX_DUMP ), +"recovery info: " , + ri,sizeof (struct nilfs_recovery_info ));if (nilfs_get_segnum_of_block (nilfs, ri->ri_lsegs_start) !=nilfs_get_segnum_of_block (nilfs, ri->ri_super_root))
@@ -807,6 +819,9 @@ int nilfs_salvage_orphan_logs(struct the_nilfs *nilfs,nilfs2_debug ((DBG_RECOVERY |DBG_DUMP_STACK ),"nilfs %p, sb %p, ri %p\n" , nilfs, sb, ri); +nilfs2_hexdump ((DBG_RECOVERY |DBG_HEX_DUMP ), +"recovery info: " , + ri,sizeof (struct nilfs_recovery_info ));if (ri->ri_lsegs_start ==0 || ri->ri_lsegs_end ==0 )return 0 ;
@@ -1018,6 +1033,11 @@ int nilfs_search_super_root(struct the_nilfs *nilfs, nilfs->ns_last_pseg = sr_pseg_start; nilfs->ns_last_seq = nilfs->ns_seg_seq; nilfs->ns_last_cno = ri->ri_cno; + +nilfs2_hexdump ((DBG_RECOVERY |DBG_HEX_DUMP ), +"recovery info: " , + ri,sizeof (struct nilfs_recovery_info )); +return 0 ; failed:
fs/nilfs2/segment.c +84 -0
336 lines not on this page · raw message
fs/nilfs2/sufile.c +6 -0
@@ -194,6 +194,8 @@ int nilfs_sufile_updatev(struct inode *sufile, __u64 *segnumv, size_t nsegs,"sufile ino %lu, segnumv %p, nsegs %zu, " "create %d, ndone %p, dofunc %p\n" , sufile->i_ino, segnumv, nsegs, create, ndone, dofunc); +nilfs2_hexdump ((DBG_SUFILE |DBG_HEX_DUMP ), +"segnumv: " , segnumv, nsegs *sizeof (__u64));if (unlikely (nsegs ==0 )) goto out;
@@ -628,6 +630,8 @@ int nilfs_sufile_get_stat(struct inode *sufile, struct nilfs_sustat *sustat)nilfs2_debug ((DBG_SUFILE |DBG_DUMP_STACK ),"sufile ino %lu, sustat %p\n" , sufile->i_ino, sustat); +nilfs2_hexdump ((DBG_SUFILE |DBG_HEX_DUMP ), +"sustat: " , sustat,sizeof (struct nilfs_sustat ));down_read (&NILFS_MDT (sufile)->mi_sem);
@@ -963,6 +967,8 @@ int nilfs_sufile_read(struct super_block *sb, size_t susize,nilfs2_debug ((DBG_SUFILE |DBG_DUMP_STACK ),"sb %p, susize %zu, raw_inode %p, inodep %p\n" , sb, susize, raw_inode, inodep); +nilfs2_hexdump ((DBG_SUFILE |DBG_HEX_DUMP ), +"raw_inode: " , raw_inode,sizeof (struct nilfs_inode )); sufile =nilfs_iget_locked (sb,NULL ,NILFS_SUFILE_INO );if (unlikely (!sufile))
fs/nilfs2/the_nilfs.c +2 -0
@@ -682,6 +682,8 @@ int nilfs_discard_segments(struct the_nilfs *nilfs, __u64 *segnump,nilfs2_debug ((DBG_THE_NILFS |DBG_DUMP_STACK ),"nilfs %p, segnump %p, nsegs %zu\n" , nilfs, segnump, nsegs); +nilfs2_hexdump ((DBG_THE_NILFS |DBG_HEX_DUMP ), +"segnums: " , segnump, nsegs *sizeof (__u64)); sects_per_block = (1 << nilfs->ns_blocksize_bits) /bdev_logical_block_size (nilfs->ns_bdev);
Signature · 8 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html