From b3e80db590db8bd4db8b3754670e1426d16067fa Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 22 Sep 2004 02:44:02 +0000 Subject: [PATCH] Branch: b1_4_smallfix Update and use EXT3_LINK_MAX constant instead of coding it inline. --- ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.7.patch | 14 ++++++++++++-- lustre/kernel_patches/patches/ext3-nlinks-2.4.24.patch | 14 ++++++++++++-- lustre/kernel_patches/patches/ext3-nlinks-2.6.7.patch | 14 ++++++++++++-- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.7.patch b/ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.7.patch index d753a28..b20be23 100644 --- a/ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.7.patch +++ b/ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.7.patch @@ -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 { */ diff --git a/lustre/kernel_patches/patches/ext3-nlinks-2.4.24.patch b/lustre/kernel_patches/patches/ext3-nlinks-2.4.24.patch index f198362..ed3fee8 100644 --- a/lustre/kernel_patches/patches/ext3-nlinks-2.4.24.patch +++ b/lustre/kernel_patches/patches/ext3-nlinks-2.4.24.patch @@ -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; + } } @@ -147,6 +148,15 @@ /* * 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 @@ */ diff --git a/lustre/kernel_patches/patches/ext3-nlinks-2.6.7.patch b/lustre/kernel_patches/patches/ext3-nlinks-2.6.7.patch index d753a28..b20be23 100644 --- a/lustre/kernel_patches/patches/ext3-nlinks-2.6.7.patch +++ b/lustre/kernel_patches/patches/ext3-nlinks-2.6.7.patch @@ -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 { */ -- 1.8.3.1