Whamcloud - gitweb
Branch: b1_4_smallfix
authoradilger <adilger>
Wed, 22 Sep 2004 02:44:02 +0000 (02:44 +0000)
committeradilger <adilger>
Wed, 22 Sep 2004 02:44:02 +0000 (02:44 +0000)
Update and use EXT3_LINK_MAX constant instead of coding it inline.

ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.7.patch
lustre/kernel_patches/patches/ext3-nlinks-2.4.24.patch
lustre/kernel_patches/patches/ext3-nlinks-2.6.7.patch

index d753a28..b20be23 100644 (file)
@@ -2,12 +2,13 @@ Index: linux-2.6.7/fs/ext3/namei.c
 ===================================================================
 --- linux-2.6.7.orig/fs/ext3/namei.c   2004-06-15 23:19:36.000000000 -0600
 +++ linux-2.6.7/fs/ext3/namei.c        2004-08-20 17:48:54.000000000 -0600
-@@ -1596,11 +1596,16 @@ static int ext3_delete_entry (handle_t *
+@@ -1596,11 +1596,17 @@ static int ext3_delete_entry (handle_t *
  static inline void ext3_inc_count(handle_t *handle, struct inode *inode)
  {
        inode->i_nlink++;
 +      if (is_dx(inode) && inode->i_nlink > 1) {
-+              if (inode->i_nlink >= 65000) /* limit is 16-bit i_links_count */
++              /* limit is 16-bit i_links_count */
++              if (inode->i_nlink >= EXT3_LINK_MAX || inode->i_nlink == 2)
 +                      inode->i_nlink = 1;
 +        }
  }
@@ -137,6 +138,15 @@ Index: linux-2.6.7/include/linux/ext3_fs.h
  
  /*
   * Debug code
+@@ -79,7 +81,7 @@
+ /*
+  * Maximal count of links to a file
+  */
+-#define EXT3_LINK_MAX         32000
++#define EXT3_LINK_MAX         65000
+ /*
+  * Macro-instructions used to manage several block sizes
 @@ -595,14 +595,15 @@ struct ext3_dir_entry_2 {
   */
  
index f198362..ed3fee8 100644 (file)
@@ -1,11 +1,12 @@
 --- ./fs/ext3/namei.c.orig     2004-08-19 12:53:21.000000000 +0800
 +++ ./fs/ext3/namei.c  2004-08-19 12:44:18.000000000 +0800
-@@ -1541,11 +1541,16 @@
+@@ -1541,11 +1541,17 @@
  static inline void ext3_inc_count(handle_t *handle, struct inode *inode)
  {
        inode->i_nlink++;
 +      if (is_dx(inode) && inode->i_nlink > 1) {
-+              if (inode->i_nlink >= 65000) /* limit is 16-bit i_links_count */
++              /* limit is 16-bit i_links_count */
++              if (inode->i_nlink >= EXT3_LINK_MAX || inode->i_nlink == 2)
 +                      inode->i_nlink = 1;
 +        }
  }
  
  /*
   * Debug code
+@@ -79,7 +81,7 @@
+ /*
+  * Maximal count of links to a file
+  */
+-#define EXT3_LINK_MAX         32000
++#define EXT3_LINK_MAX         65000
+ /*
+  * Macro-instructions used to manage several block sizes
 @@ -581,14 +581,15 @@
   */
  
index d753a28..b20be23 100644 (file)
@@ -2,12 +2,13 @@ Index: linux-2.6.7/fs/ext3/namei.c
 ===================================================================
 --- linux-2.6.7.orig/fs/ext3/namei.c   2004-06-15 23:19:36.000000000 -0600
 +++ linux-2.6.7/fs/ext3/namei.c        2004-08-20 17:48:54.000000000 -0600
-@@ -1596,11 +1596,16 @@ static int ext3_delete_entry (handle_t *
+@@ -1596,11 +1596,17 @@ static int ext3_delete_entry (handle_t *
  static inline void ext3_inc_count(handle_t *handle, struct inode *inode)
  {
        inode->i_nlink++;
 +      if (is_dx(inode) && inode->i_nlink > 1) {
-+              if (inode->i_nlink >= 65000) /* limit is 16-bit i_links_count */
++              /* limit is 16-bit i_links_count */
++              if (inode->i_nlink >= EXT3_LINK_MAX || inode->i_nlink == 2)
 +                      inode->i_nlink = 1;
 +        }
  }
@@ -137,6 +138,15 @@ Index: linux-2.6.7/include/linux/ext3_fs.h
  
  /*
   * Debug code
+@@ -79,7 +81,7 @@
+ /*
+  * Maximal count of links to a file
+  */
+-#define EXT3_LINK_MAX         32000
++#define EXT3_LINK_MAX         65000
+ /*
+  * Macro-instructions used to manage several block sizes
 @@ -595,14 +595,15 @@ struct ext3_dir_entry_2 {
   */