summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2012-12-08 06:54:50 +0100
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2012-12-11 05:43:45 +0100
commit457d08ee4fd91c8df17917ff2d32565e6adacbfc (patch)
treed97e620d4617642414cdec0ecc9bae9081e156b6 /include
parentf2fs: remove redundant call to f2fs_put_page in delete entry (diff)
downloadlinux-457d08ee4fd91c8df17917ff2d32565e6adacbfc.tar.xz
linux-457d08ee4fd91c8df17917ff2d32565e6adacbfc.zip
f2fs: introduce accessor to retrieve number of dentry slots
Simplify code by providing the accessor macro to retrieve the number of dentry slots for a given filename length. Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/f2fs_fs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index c2fbbc35c1e6..f9a12f6243a5 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -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