aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2012-11-28 16:12:41 +0900
committerZiyan <jaraidaniel@gmail.com>2015-05-02 14:33:15 +0200
commit163e0886e17b1997d28b3c309d8618cb5a76424d (patch)
treec3194a330ca126c6c718f2e19e095d81ab78d233 /include
parent0c5eb82e3b03e7c27077ba35ae1b4419ec386bd2 (diff)
downloadkernel_samsung_tuna-163e0886e17b1997d28b3c309d8618cb5a76424d.zip
kernel_samsung_tuna-163e0886e17b1997d28b3c309d8618cb5a76424d.tar.gz
kernel_samsung_tuna-163e0886e17b1997d28b3c309d8618cb5a76424d.tar.bz2
f2fs: fix endian conversion bugs reported by sparse
This patch should resolve the bugs reported by the sparse tool. Initial reports were written by "kbuild test robot" managed by fengguang.wu. In my local machines, I've tested also by running: > make C=2 CF="-D__CHECK_ENDIAN__" Accordingly, I've found lots of warnings and bugs related to the endian conversion. And I've fixed all at this moment. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/f2fs_fs.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index 1429ece..c2fbbc3 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -272,8 +272,8 @@ struct f2fs_sit_block {
* ex) data_blkaddr = (block_t)(nodepage_start_address + ofs_in_node)
*/
#define ENTRIES_IN_SUM 512
-#define SUMMARY_SIZE (sizeof(struct f2fs_summary))
-#define SUM_FOOTER_SIZE (sizeof(struct summary_footer))
+#define SUMMARY_SIZE (7) /* sizeof(struct summary) */
+#define SUM_FOOTER_SIZE (5) /* sizeof(struct summary_footer) */
#define SUM_ENTRY_SIZE (SUMMARY_SIZE * ENTRIES_IN_SUM)
/* a summary entry for a 4KB-sized block in a segment */
@@ -297,7 +297,7 @@ struct summary_footer {
__u32 check_sum; /* summary checksum */
} __packed;
-#define SUM_JOURNAL_SIZE (PAGE_CACHE_SIZE - SUM_FOOTER_SIZE -\
+#define SUM_JOURNAL_SIZE (F2FS_BLKSIZE - SUM_FOOTER_SIZE -\
SUM_ENTRY_SIZE)
#define NAT_JOURNAL_ENTRIES ((SUM_JOURNAL_SIZE - 2) /\
sizeof(struct nat_journal_entry))