Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86
[firefly-linux-kernel-4.4.55.git] / include / linux / f2fs_fs.h
index 1429ece7caab386ffa96e8ad803f56e4be7f4dbf..f9a12f6243a59dd8c8d3ba8467eabdc5bd866f3f 100644 (file)
@@ -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))
@@ -363,6 +363,9 @@ typedef __le32      f2fs_hash_t;
 
 /* One directory entry slot covers 8bytes-long file name */
 #define F2FS_NAME_LEN          8
+#define F2FS_NAME_LEN_BITS     3
+
+#define GET_DENTRY_SLOTS(x)    ((x + F2FS_NAME_LEN - 1) >> F2FS_NAME_LEN_BITS)
 
 /* the number of dentry in a block */
 #define NR_DENTRY_IN_BLOCK     214