Whamcloud - gitweb
On-disk format for large number of subdirectories
authorTheodore Ts'o <tytso@mit.edu>
Sat, 11 Nov 2006 14:43:42 +0000 (09:43 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 11 Nov 2006 14:43:42 +0000 (09:43 -0500)
- 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" <tytso@mit.edu>
lib/ext2fs/ChangeLog
lib/ext2fs/ext2_fs.h

index 4112e34..58d54bc 100644 (file)
@@ -1,5 +1,11 @@
 2006-11-11  Theodore Tso  <tytso@mit.edu>
 
+       * 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,
index d0b57f4..f9c0199 100644 (file)
@@ -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