提交 a9cee176 编写于 作者: K Kyle Spiers 提交者: Jan Kara

reiserfs: Remove VLA from fs/reiserfs/reiserfs.h

Remove Variable Length Array from fs/reiserfs/reiserfs.h. EMPTY_DIR_SIZE
is used as an array size and as it is using strlen() it need not be
evaluated at compile time. Change it's definition to use sizeof() to
force evaluation of array length at compile time.
Signed-off-by: NKyle Spiers <kyle@spiers.me>
Signed-off-by: NJan Kara <jack@suse.cz>
上级 785dffe1
...@@ -1916,7 +1916,7 @@ struct reiserfs_de_head { ...@@ -1916,7 +1916,7 @@ struct reiserfs_de_head {
/* empty directory contains two entries "." and ".." and their headers */ /* empty directory contains two entries "." and ".." and their headers */
#define EMPTY_DIR_SIZE \ #define EMPTY_DIR_SIZE \
(DEH_SIZE * 2 + ROUND_UP (strlen (".")) + ROUND_UP (strlen (".."))) (DEH_SIZE * 2 + ROUND_UP (sizeof(".") - 1) + ROUND_UP (sizeof("..") - 1))
/* old format directories have this size when empty */ /* old format directories have this size when empty */
#define EMPTY_DIR_SIZE_V1 (DEH_SIZE * 2 + 3) #define EMPTY_DIR_SIZE_V1 (DEH_SIZE * 2 + 3)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册