Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c031f6a9 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

f2fs: add annotation for space utilization of regular/inline dentry



Add annotation to let us know more clearly about space utilization
information of regular dentry and inline dentry.

Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent f8b703da
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -417,15 +417,25 @@ typedef __le32 f2fs_hash_t;

#define GET_DENTRY_SLOTS(x)	((x + F2FS_SLOT_LEN - 1) >> F2FS_SLOT_LEN_BITS)

/* the number of dentry in a block */
#define NR_DENTRY_IN_BLOCK	214

/* MAX level for dir lookup */
#define MAX_DIR_HASH_DEPTH	63

/* MAX buckets in one level of dir */
#define MAX_DIR_BUCKETS		(1 << ((MAX_DIR_HASH_DEPTH / 2) - 1))

/*
 * space utilization of regular dentry and inline dentry
 *		regular dentry			inline dentry
 * bitmap	1 * 27 = 27			1 * 23 = 23
 * reserved	1 * 3 = 3			1 * 7 = 7
 * dentry	11 * 214 = 2354			11 * 182 = 2002
 * filename	8 * 214 = 1712			8 * 182 = 1456
 * total	4096				3488
 *
 * Note: there are more reserved space in inline dentry than in regular
 * dentry, when converting inline dentry we should handle this carefully.
 */
#define NR_DENTRY_IN_BLOCK	214	/* the number of dentry in a block */
#define SIZE_OF_DIR_ENTRY	11	/* by byte */
#define SIZE_OF_DENTRY_BITMAP	((NR_DENTRY_IN_BLOCK + BITS_PER_BYTE - 1) / \
					BITS_PER_BYTE)