aboutsummaryrefslogtreecommitdiffstats
path: root/fsck/f2fs.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-12-13 13:55:59 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2014-12-17 18:39:34 -0800
commit9c6617d06dbdf8266838569b8169b0f9471704f4 (patch)
tree2b12622151978c2f29fc174345e1a805a28071c6 /fsck/f2fs.h
parentb76cced47e65e78e6da808b841b507ef82e90777 (diff)
downloadandroid_external_f2fs-tools-9c6617d06dbdf8266838569b8169b0f9471704f4.tar.gz
android_external_f2fs-tools-9c6617d06dbdf8266838569b8169b0f9471704f4.tar.bz2
android_external_f2fs-tools-9c6617d06dbdf8266838569b8169b0f9471704f4.zip
dump.f2fs: dump owner of data given block address
This patch introduces a feature to dump owner information of given block address. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fsck/f2fs.h')
-rw-r--r--fsck/f2fs.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/fsck/f2fs.h b/fsck/f2fs.h
index 57bad9b..c268f15 100644
--- a/fsck/f2fs.h
+++ b/fsck/f2fs.h
@@ -197,6 +197,12 @@ static inline void *inline_data_addr(struct f2fs_node *node_blk)
return (void *)&(node_blk->i.i_addr[1]);
}
+static inline unsigned int ofs_of_node(struct f2fs_node *node_blk)
+{
+ unsigned flag = le32_to_cpu(node_blk->footer.flag);
+ return flag >> OFFSET_BIT_SHIFT;
+}
+
static inline unsigned long __bitmap_size(struct f2fs_sb_info *sbi, int flag)
{
struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
@@ -255,6 +261,12 @@ static inline block_t __start_sum_addr(struct f2fs_sb_info *sbi)
return le32_to_cpu(F2FS_CKPT(sbi)->cp_pack_start_sum);
}
+static inline block_t __end_block_addr(struct f2fs_sb_info *sbi)
+{
+ block_t end = SM_I(sbi)->main_blkaddr;
+ return end + le64_to_cpu(F2FS_RAW_SUPER(sbi)->block_count);
+}
+
#define GET_ZONENO_FROM_SEGNO(sbi, segno) \
((segno / sbi->segs_per_sec) / sbi->secs_per_zone)