[PATCH 4/5] f2fs: align f2fs maximum name length to linux based filesystem

From: Namjae Jeon
Date: Fri Mar 01 2013 - 22:41:32 EST


From: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>

Since, maximum filename length supported in linux is 255 characters.
So, there is no need to reserve space for 256 characters in f2fs inode.
This aligns the filename length to NFS requests also which also
has a default limit of '255'.

Signed-off-by: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
Signed-off-by: Amit Sahrawat <a.sahrawat@xxxxxxxxxxx>
---
include/linux/f2fs_fs.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index f9a12f6..f7bd27d 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -139,7 +139,7 @@ struct f2fs_extent {
__le32 len; /* lengh of the extent */
} __packed;

-#define F2FS_MAX_NAME_LEN 256
+#define F2FS_MAX_NAME_LEN 255
#define ADDRS_PER_INODE 923 /* Address Pointers in an Inode */
#define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */
#define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */
@@ -166,6 +166,7 @@ struct f2fs_inode {
__le32 i_pino; /* parent inode number */
__le32 i_namelen; /* file name length */
__u8 i_name[F2FS_MAX_NAME_LEN]; /* file name for SPOR */
+ __u8 i_reserved_2; /* reserved for future use*/

struct f2fs_extent i_ext; /* caching a largest extent */

--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/