Skip to contentSkip to conversation

On-disk format for large number of subdirectors

PATCH In review Theodore Ts'o 2 participants 2 messages Oct 18, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 On-disk format for large number of subdirectors

Comments?

- Ted

On-disk format for large number of subdirectories

- EXT4_FEATURE_RO_COMPAT_DIR_NLINK (0x0020?) - allow directories to have

Quoted 1 line

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.

lib/ext2fs/ext2_fs.h +2 -1
Index: e2fsprogs/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
@@ -606,6 +606,7 @@
 /* #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 lore raw
Quoted 8 lines · Theodore Ts'o

On-disk format for large number of subdirectories

- EXT4_FEATURE_RO_COMPAT_DIR_NLINK (0x0020?) - allow directories to have

Quoted 1 line

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.

Looks good. Will try to get a new patch out with this support.

Quoted 14 lines

Index: e2fsprogs/lib/ext2fs/ext2_fs.h
===================================================================

lib/ext2fs/ext2_fs.h +1 -1
@@ -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

lib/ext2fs/ext2_fs.h line 612

Quoted 7 lines
lib/ext2fs/ext2_fs.h +1 -0
@@ -606,6 +606,7 @@
 /* #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

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.