From 180c0236ae6ba60b7df611283e8b2263258771b4 Mon Sep 17 00:00:00 2001 From: Eric Rowe Date: Thu, 24 Jul 2014 12:48:38 -0700 Subject: Rename micro bench 32 bit Rename micro_bench32 to micro_bench for backwards compatibility. Change-Id: I130f281967cffc3e337d27e84c4caa66d39d1385 --- micro_bench/Android.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/micro_bench/Android.mk b/micro_bench/Android.mk index df540702..0655536e 100644 --- a/micro_bench/Android.mk +++ b/micro_bench/Android.mk @@ -8,7 +8,7 @@ LOCAL_MODULE_TAGS := debug LOCAL_MODULE := micro_bench LOCAL_MULTILIB := both -LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 +LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE) LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 include $(BUILD_EXECUTABLE) @@ -23,6 +23,6 @@ LOCAL_STATIC_LIBRARIES = libc libm LOCAL_FORCE_STATIC_EXECUTABLE := true LOCAL_MULTILIB := both -LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 +LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE) LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 include $(BUILD_EXECUTABLE) -- cgit v1.2.3 From d604af2e37e3941d9497ecb7e9ed9b55eb06a7c2 Mon Sep 17 00:00:00 2001 From: Daniel Rosenberg Date: Tue, 19 Aug 2014 00:13:10 -0700 Subject: f2fs_sparseblock: Fixed handling of journaled sit entries Bug: 15749466 Change-Id: I3f7f13698e88efd7ffeb00c1ba3a070527a3f6a0 Signed-off-by: Daniel Rosenberg --- f2fs_utils/f2fs_sparseblock.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/f2fs_utils/f2fs_sparseblock.c b/f2fs_utils/f2fs_sparseblock.c index 46d1f72a..2bcd4476 100644 --- a/f2fs_utils/f2fs_sparseblock.c +++ b/f2fs_utils/f2fs_sparseblock.c @@ -23,6 +23,10 @@ #member, le64_to_cpu((ptr)->member), le64_to_cpu((ptr)->member) ); \ } while (0); +#define segno_in_journal(sum, i) (sum->sit_j.entries[i].segno) + +#define sit_in_journal(sum, i) (sum->sit_j.entries[i].se) + static void dbg_print_raw_sb_info(struct f2fs_super_block *sb) { SLOGD("\n"); @@ -130,6 +134,12 @@ static void dbg_print_info_struct(struct f2fs_info *info) SLOGD("blocks_per_sit: %"PRIu64, info->blocks_per_sit); SLOGD("sit_blocks loc: %p", info->sit_blocks); SLOGD("sit_sums loc: %p", info->sit_sums); + SLOGD("sit_sums num: %d", le16_to_cpu(info->sit_sums->n_sits)); + unsigned int i; + for(i = 0; i < (le16_to_cpu(info->sit_sums->n_sits)); i++) { + SLOGD("entry %d in journal entries is for segment %d",i, le32_to_cpu(segno_in_journal(info->sit_sums, i))); + } + SLOGD("cp_blkaddr: %"PRIu64, info->cp_blkaddr); SLOGD("cp_valid_cp_blkaddr: %"PRIu64, info->cp_valid_cp_blkaddr); SLOGD("sit_blkaddr: %"PRIu64, info->sit_blkaddr); @@ -358,7 +368,7 @@ static int get_sit_summary(int fd, struct f2fs_info *info, struct f2fs_checkpoin if (read_structure_blk(fd, blk_addr, buffer, 1)) return -1; - memcpy(info->sit_sums, buffer, sizeof(struct f2fs_summary_block)); + memcpy(info->sit_sums, buffer, sizeof(struct f2fs_summary_block)); } return 0; } @@ -469,14 +479,10 @@ int f2fs_test_bit(unsigned int nr, const char *p) return (mask & *addr) != 0; } -#define segno_in_journal(sum, i) (sum->sit_j.entries[i].segno) - -#define sit_in_journal(sum, i) (sum->sit_j.entries[i].se) - int run_on_used_blocks(u64 startblock, struct f2fs_info *info, int (*func)(u64 pos, void *data), void *data) { struct f2fs_sit_block sit_block_cache; - struct f2fs_sit_entry * sit_entry, *sit_entry1, *sit_entry2; - u64 sit_block_num_cur = 0, segnum=0, block_offset; + struct f2fs_sit_entry * sit_entry; + u64 sit_block_num_cur = 0, segnum = 0, block_offset; u64 block; unsigned int used, found, started = 0, i; @@ -492,8 +498,8 @@ int run_on_used_blocks(u64 startblock, struct f2fs_info *info, int (*func)(u64 p segnum = (block - info->main_blkaddr)/info->blocks_per_segment; /* check the SIT entries in the journal */ - found=0; - for(i = 0; isit_sums->n_sits); i++) { if (le32_to_cpu(segno_in_journal(info->sit_sums, i)) == segnum) { sit_entry = &sit_in_journal(info->sit_sums, i); found = 1; @@ -509,11 +515,6 @@ int run_on_used_blocks(u64 startblock, struct f2fs_info *info, int (*func)(u64 p block_offset = (block - info->main_blkaddr) % info->blocks_per_segment; - if (block_offset == 0 && GET_SIT_VBLOCKS(sit_entry) == 0) { - block += info->blocks_per_segment; - continue; - } - used = f2fs_test_bit(block_offset, (char *)sit_entry->valid_map); if(used) if (func(block, data)) -- cgit v1.2.3