From bec6f49a46ec78a4c5928a22214848a7ea654704 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 11 Nov 2006 09:43:42 -0500 Subject: [PATCH] On-disk format for large number of subdirectories - EXT4_FEATURE_RO_COMPAT_DIR_NLINK (0x0020?) - allow directories to have > 65000 subdirectories (i_nlinks) by setting i_nlinks = 1 for such directories. RO_COMPAT protects old filesystems from unlinking such directories incorrectly and losing all files therein. Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/ChangeLog | 6 ++++++ lib/ext2fs/ext2_fs.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 4112e34..58d54bc 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,5 +1,11 @@ 2006-11-11 Theodore Tso + * ext2_fs.h: Add definition of EXT4_FEATURE_RO_COMPAT_DIR_NLINK, + which allow directories to have > 65000 subdirectories + (i_nlinks) by setting i_nlinks = 1 for such directories. + RO_COMPAT protects old filesystems from unlinking such + directories incorrectly and losing all files therein. + * swapfs.c (ext2fs_swap_group_desc): ext2_fs.h: Add definition of EXT4_FEATURE_RO_COMPAT_GDT_CSUM, which adds a crc16 checksum in the group descriptor, diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h index d0b57f4..f9c0199 100644 --- a/lib/ext2fs/ext2_fs.h +++ b/lib/ext2fs/ext2_fs.h @@ -71,7 +71,7 @@ /* * Maximal count of links to a file */ -#define EXT2_LINK_MAX 32000 +#define EXT2_LINK_MAX 65000 /* * Macro-instructions used to manage several block sizes @@ -578,6 +578,7 @@ struct ext2_super_block { /* #define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 not used */ #define EXT4_FEATURE_RO_COMPAT_HUGE_FILE 0x0008 #define EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010 +#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020 #define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 #define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 -- 1.8.3.1