From 0932c4e400be315bf608a553d3ad2463e7923d4a Mon Sep 17 00:00:00 2001 From: Yang Sheng Date: Fri, 22 May 2015 00:01:08 +0800 Subject: [PATCH] LU-6030 ldiskfs: Remove alloc-policy patch Remove alloc_policy & wantedi two patches since they are no longer used. Signed-off-by: Yang Sheng Change-Id: Ia283e16afe9d35d667c48e38db83d2a9cacb152c Reviewed-on: http://review.whamcloud.com/14299 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Reviewed-by: Bob Glossman --- .../patches/rhel6.3/ext4-alloc-policy-2.6.patch | 87 ---------------------- .../patches/rhel6.3/ext4-osd-iop-common.patch | 7 +- .../patches/rhel6.3/ext4-wantedi-2.6.patch | 80 -------------------- .../patches/sles11sp2/ext4-osd-iop-common.patch | 7 +- .../series/ldiskfs-2.6-rhel6.4.series | 2 - .../series/ldiskfs-2.6-rhel6.5.series | 2 - .../series/ldiskfs-2.6-rhel6.6.series | 2 - .../kernel_patches/series/ldiskfs-2.6-rhel6.series | 2 - .../series/ldiskfs-2.6-sles11.series | 2 - .../series/ldiskfs-3.0-sles11.series | 2 - .../series/ldiskfs-3.0-sles11sp3.series | 2 - 11 files changed, 6 insertions(+), 189 deletions(-) delete mode 100644 ldiskfs/kernel_patches/patches/rhel6.3/ext4-alloc-policy-2.6.patch delete mode 100644 ldiskfs/kernel_patches/patches/rhel6.3/ext4-wantedi-2.6.patch diff --git a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-alloc-policy-2.6.patch b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-alloc-policy-2.6.patch deleted file mode 100644 index b5febbf..0000000 --- a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-alloc-policy-2.6.patch +++ /dev/null @@ -1,87 +0,0 @@ -Index: linux-2.6.27.21-0.1/fs/ext4/ialloc.c -=================================================================== ---- linux-2.6.27.21-0.1.orig/fs/ext4/ialloc.c 2009-07-07 14:47:04.000000000 +0530 -+++ linux-2.6.27.21-0.1/fs/ext4/ialloc.c 2009-07-07 15:04:02.000000000 +0530 -@@ -953,6 +953,36 @@ - return ERR_PTR(err); - } - -+unsigned long ext4_find_reverse(struct super_block *sb) -+{ -+ struct ext4_group_desc *desc; -+ struct buffer_head *bitmap_bh = NULL; -+ int group; -+ unsigned long ino, offset; -+ -+ for (offset = (EXT4_INODES_PER_GROUP(sb) >> 1); offset >= 0; -+ offset >>= 1) { -+ for (group = EXT4_SB(sb)->s_groups_count - 1; group >= 0; -+ --group) { -+ desc = ext4_get_group_desc(sb, group, NULL); -+ if (ext4_free_inodes_count(sb, desc) == 0) -+ continue; -+ -+ bitmap_bh = ext4_read_inode_bitmap(sb, group); -+ if (!bitmap_bh) -+ continue; -+ -+ ino = ext4_find_next_zero_bit((unsigned long *) -+ bitmap_bh->b_data, -+ EXT4_INODES_PER_GROUP(sb), offset); -+ if (ino < EXT4_INODES_PER_GROUP(sb)) -+ return (group * EXT4_INODES_PER_GROUP(sb) + -+ ino + 1); -+ } -+ } -+ return 0; -+} -+ - /* Verify that we are loading a valid orphan from disk */ - struct inode *ext4_orphan_get(struct super_block *sb, unsigned long ino) - { -Index: linux-2.6.27.21-0.1/fs/ext4/namei.c -=================================================================== ---- linux-2.6.27.21-0.1.orig/fs/ext4/namei.c 2009-07-07 14:47:05.000000000 +0530 -+++ linux-2.6.27.21-0.1/fs/ext4/namei.c 2009-07-07 15:04:21.000000000 +0530 -@@ -161,6 +161,12 @@ - u32 ldp_magic; - }; - -+/* Only use the least 3 bits of ldp_flags for goal policy */ -+typedef enum { -+ DP_GOAL_POLICY = 0, -+ DP_LASTGROUP_REVERSE = 1, -+} dp_policy_t; -+ - static inline ext4_lblk_t dx_get_block(struct dx_entry *entry); - static void dx_set_block(struct dx_entry *entry, ext4_lblk_t value); - static inline unsigned dx_get_hash(struct dx_entry *entry); -@@ -1771,8 +1777,14 @@ - if (dentry->d_fsdata != NULL) { - struct lvfs_dentry_params *param = dentry->d_fsdata; - -- if (param->ldp_magic == LVFS_DENTRY_PARAM_MAGIC) -- inum = param->ldp_inum; -+ if (param->ldp_magic == LVFS_DENTRY_PARAM_MAGIC) { -+ if ((dp_policy_t)(param->ldp_flags & 0x7) == -+ DP_LASTGROUP_REVERSE) -+ inum = ext4_find_reverse(sb); -+ else /* DP_GOAL_POLICY */ -+ inum = param->ldp_inum; -+ } -+ - } - return inum; - } -Index: linux-2.6.27.21-0.1/fs/ext4/ext4.h -=================================================================== ---- linux-2.6.27.21-0.1.orig/fs/ext4/ext4.h 2009-07-07 14:47:22.000000000 +0530 -+++ linux-2.6.27.21-0.1/fs/ext4/ext4.h 2009-07-07 15:04:02.000000000 +0530 -@@ -1101,6 +1101,7 @@ - EXT4_SB(dir->i_sb)->s_inode_goal); - } - extern void ext4_free_inode(handle_t *, struct inode *); -+extern unsigned long ext4_find_reverse(struct super_block *); - extern struct inode * ext4_orphan_get(struct super_block *, unsigned long); - extern unsigned long ext4_count_free_inodes(struct super_block *); - extern unsigned long ext4_count_dirs(struct super_block *); diff --git a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-osd-iop-common.patch b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-osd-iop-common.patch index bfa6b13..31c68a4 100644 --- a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-osd-iop-common.patch +++ b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-osd-iop-common.patch @@ -158,7 +158,7 @@ ext4_handle_sync(handle); - inode = ext4_new_inode(handle, dir, S_IFDIR | mode, -- &dentry->d_name, ext4_dentry_goal(dir->i_sb, dentry)); +- &dentry->d_name, 0); - err = PTR_ERR(inode); - if (IS_ERR(inode)) - goto out_stop; @@ -178,7 +178,7 @@ de = (struct ext4_dir_entry_2 *) dir_block->b_data; de->inode = cpu_to_le32(inode->i_ino); de->name_len = 1; -@@ -1938,18 +1952,47 @@ retry: +@@ -1938,18 +1952,46 @@ retry: BUFFER_TRACE(dir_block, "call ext4_handle_dirty_metadata"); err = ext4_handle_dirty_metadata(handle, inode, dir_block); if (err) @@ -219,8 +219,7 @@ + if (IS_DIRSYNC(dir)) + ext4_handle_sync(handle); + -+ inode = ext4_new_inode(handle, dir, S_IFDIR | mode, &dentry->d_name, -+ ext4_dentry_goal(dir->i_sb, dentry)); ++ inode = ext4_new_inode(handle, dir, S_IFDIR | mode, &dentry->d_name, 0); + err = PTR_ERR(inode); + if (IS_ERR(inode)) goto out_stop; diff --git a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-wantedi-2.6.patch b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-wantedi-2.6.patch deleted file mode 100644 index 1b37745..0000000 --- a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-wantedi-2.6.patch +++ /dev/null @@ -1,80 +0,0 @@ -Index: linux-2.6.32.i386/fs/ext4/namei.c -=================================================================== ---- linux-2.6.32.i386.orig/fs/ext4/namei.c 2010-04-07 00:16:32.000000000 +0530 -+++ linux-2.6.32.i386/fs/ext4/namei.c 2010-04-07 00:17:09.000000000 +0530 -@@ -144,6 +144,17 @@ - u16 size; - }; - -+/* -+ * dentry_param used by ext4_new_inode_wantedi() -+ */ -+#define LVFS_DENTRY_PARAM_MAGIC 20070216UL -+struct lvfs_dentry_params -+{ -+ unsigned long ldp_inum; -+ unsigned long ldp_flags; -+ u32 ldp_magic; -+}; -+ - static inline ext4_lblk_t dx_get_block(struct dx_entry *entry); - static void dx_set_block(struct dx_entry *entry, ext4_lblk_t value); - static inline unsigned dx_get_hash(struct dx_entry *entry); -@@ -1751,6 +1762,19 @@ - return err; - } - -+static unsigned ext4_dentry_goal(struct super_block *sb, struct dentry *dentry) -+{ -+ unsigned inum = EXT4_SB(sb)->s_inode_goal; -+ -+ if (dentry->d_fsdata != NULL) { -+ struct lvfs_dentry_params *param = dentry->d_fsdata; -+ -+ if (param->ldp_magic == LVFS_DENTRY_PARAM_MAGIC) -+ inum = param->ldp_inum; -+ } -+ return inum; -+} -+ - /* - * By the time this is called, we already have created - * the directory cache entry for the new file, but it -@@ -1745,7 +1769,8 @@ retry: - if (IS_DIRSYNC(dir)) - ext4_handle_sync(handle); - -- inode = ext4_new_inode(handle, dir, mode, &dentry->d_name, 0); -+ inode = ext4_new_inode(handle, dir, mode, &dentry->d_name, -+ ext4_dentry_goal(dir->i_sb, dentry)); - err = PTR_ERR(inode); - if (!IS_ERR(inode)) { - inode->i_op = &ext4_file_inode_operations; -@@ -1779,7 +1804,8 @@ retry: - if (IS_DIRSYNC(dir)) - ext4_handle_sync(handle); - -- inode = ext4_new_inode(handle, dir, mode, &dentry->d_name, 0); -+ inode = ext4_new_inode(handle, dir, mode, &dentry->d_name, -+ ext4_dentry_goal(dir->i_sb, dentry)); - err = PTR_ERR(inode); - if (!IS_ERR(inode)) { - init_special_inode(inode, inode->i_mode, rdev); -@@ -1817,7 +1843,7 @@ retry: - ext4_handle_sync(handle); - - inode = ext4_new_inode(handle, dir, S_IFDIR | mode, -- &dentry->d_name, 0); -+ &dentry->d_name, ext4_dentry_goal(dir->i_sb, dentry)); - err = PTR_ERR(inode); - if (IS_ERR(inode)) - goto out_stop; -@@ -2238,7 +2264,7 @@ retry: - ext4_handle_sync(handle); - - inode = ext4_new_inode(handle, dir, S_IFLNK|S_IRWXUGO, -- &dentry->d_name, 0); -+ &dentry->d_name, ext4_dentry_goal(dir->i_sb, dentry)); - err = PTR_ERR(inode); - if (IS_ERR(inode)) - goto out_stop; diff --git a/ldiskfs/kernel_patches/patches/sles11sp2/ext4-osd-iop-common.patch b/ldiskfs/kernel_patches/patches/sles11sp2/ext4-osd-iop-common.patch index 9c48794..a9014f2 100644 --- a/ldiskfs/kernel_patches/patches/sles11sp2/ext4-osd-iop-common.patch +++ b/ldiskfs/kernel_patches/patches/sles11sp2/ext4-osd-iop-common.patch @@ -164,7 +164,7 @@ ext4_handle_sync(handle); - inode = ext4_new_inode(handle, dir, S_IFDIR | mode, -- &dentry->d_name, ext4_dentry_goal(dir->i_sb, dentry)); +- &dentry->d_name, 0); - err = PTR_ERR(inode); - if (IS_ERR(inode)) - goto out_stop; @@ -184,7 +184,7 @@ de = (struct ext4_dir_entry_2 *) dir_block->b_data; de->inode = cpu_to_le32(inode->i_ino); de->name_len = 1; -@@ -1944,18 +1956,47 @@ retry: +@@ -1944,18 +1956,46 @@ retry: BUFFER_TRACE(dir_block, "call ext4_handle_dirty_metadata"); err = ext4_handle_dirty_metadata(handle, inode, dir_block); if (err) @@ -226,8 +226,7 @@ + if (IS_DIRSYNC(dir)) + ext4_handle_sync(handle); + -+ inode = ext4_new_inode(handle, dir, S_IFDIR | mode, &dentry->d_name, -+ ext4_dentry_goal(dir->i_sb, dentry)); ++ inode = ext4_new_inode(handle, dir, S_IFDIR | mode, &dentry->d_name, 0); + err = PTR_ERR(inode); + if (IS_ERR(inode)) goto out_stop; diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series index 48a1d49..ec2670c 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series @@ -2,7 +2,6 @@ rhel6.3/ext4-use-vzalloc-in-ext4_fill_flex_info.patch rhel6.3/ext4-introduce-ext4_kvmalloc-ext4_kzalloc-and-ext4_kvfree.patch rhel6.3/ext4-add-missing-kfree-on-error-return-path-in-add_new_gdb.patch rhel6.3/ext4-use-ext4_kvzalloc-ext4_kvmalloc-for-s_group_desc-and-s_group_info.patch -rhel6.3/ext4-wantedi-2.6.patch rhel6.3/ext4-map_inode_page-2.6.18.patch rhel6.3/export-ext4-2.6.patch rhel6.3/ext4-remove-cond_resched-calls.patch @@ -15,7 +14,6 @@ rhel6.3/ext4-print-inum-in-htree-warning.patch rhel6.4/ext4-prealloc.patch rhel6.3/ext4-mballoc-extra-checks.patch rhel6.4/ext4-misc.patch -rhel6.3/ext4-alloc-policy-2.6.patch rhel6.3/ext4-pdir-fix.patch rhel6.3/ext4-add-more-error-checks-to-ext4_mkdir.patch rhel6.3/ext4-osd-iop-common.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series index 14fcbc8..52cb190 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series @@ -2,7 +2,6 @@ rhel6.3/ext4-use-vzalloc-in-ext4_fill_flex_info.patch rhel6.3/ext4-introduce-ext4_kvmalloc-ext4_kzalloc-and-ext4_kvfree.patch rhel6.3/ext4-add-missing-kfree-on-error-return-path-in-add_new_gdb.patch rhel6.3/ext4-use-ext4_kvzalloc-ext4_kvmalloc-for-s_group_desc-and-s_group_info.patch -rhel6.3/ext4-wantedi-2.6.patch rhel6.3/ext4-map_inode_page-2.6.18.patch rhel6.3/export-ext4-2.6.patch rhel6.3/ext4-remove-cond_resched-calls.patch @@ -15,7 +14,6 @@ rhel6.3/ext4-print-inum-in-htree-warning.patch rhel6.4/ext4-prealloc.patch rhel6.3/ext4-mballoc-extra-checks.patch rhel6.4/ext4-misc.patch -rhel6.3/ext4-alloc-policy-2.6.patch rhel6.3/ext4-pdir-fix.patch rhel6.3/ext4-add-more-error-checks-to-ext4_mkdir.patch rhel6.3/ext4-osd-iop-common.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series index 29b3031..3f4f9a2 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series @@ -2,7 +2,6 @@ rhel6.3/ext4-use-vzalloc-in-ext4_fill_flex_info.patch rhel6.3/ext4-introduce-ext4_kvmalloc-ext4_kzalloc-and-ext4_kvfree.patch rhel6.3/ext4-add-missing-kfree-on-error-return-path-in-add_new_gdb.patch rhel6.3/ext4-use-ext4_kvzalloc-ext4_kvmalloc-for-s_group_desc-and-s_group_info.patch -rhel6.3/ext4-wantedi-2.6.patch rhel6.3/ext4-map_inode_page-2.6.18.patch rhel6.3/export-ext4-2.6.patch rhel6.3/ext4-remove-cond_resched-calls.patch @@ -14,7 +13,6 @@ rhel6.3/ext4-print-inum-in-htree-warning.patch rhel6.4/ext4-prealloc.patch rhel6.3/ext4-mballoc-extra-checks.patch rhel6.4/ext4-misc.patch -rhel6.3/ext4-alloc-policy-2.6.patch rhel6.3/ext4-pdir-fix.patch rhel6.3/ext4-add-more-error-checks-to-ext4_mkdir.patch rhel6.3/ext4-osd-iop-common.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series index 7186210..7d822b7 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series @@ -2,7 +2,6 @@ rhel6.3/ext4-use-vzalloc-in-ext4_fill_flex_info.patch rhel6.3/ext4-introduce-ext4_kvmalloc-ext4_kzalloc-and-ext4_kvfree.patch rhel6.3/ext4-add-missing-kfree-on-error-return-path-in-add_new_gdb.patch rhel6.3/ext4-use-ext4_kvzalloc-ext4_kvmalloc-for-s_group_desc-and-s_group_info.patch -rhel6.3/ext4-wantedi-2.6.patch rhel6.3/ext4-map_inode_page-2.6.18.patch rhel6.3/export-ext4-2.6.patch rhel6.3/ext4-remove-cond_resched-calls.patch @@ -15,7 +14,6 @@ rhel6.3/ext4-print-inum-in-htree-warning.patch rhel6.3/ext4-prealloc.patch rhel6.3/ext4-mballoc-extra-checks.patch rhel6.3/ext4-misc.patch -rhel6.3/ext4-alloc-policy-2.6.patch rhel6.3/ext4-pdir-fix.patch rhel6.3/ext4-add-more-error-checks-to-ext4_mkdir.patch rhel6.3/ext4-osd-iop-common.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series index dcf9adf..a69ef69 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series @@ -1,4 +1,3 @@ -rhel6.3/ext4-wantedi-2.6.patch rhel6.3/ext4-map_inode_page-2.6.18.patch rhel6.3/export-ext4-2.6.patch rhel6.3/ext4-remove-cond_resched-calls.patch @@ -16,7 +15,6 @@ rhel6.3/ext4-print-inum-in-htree-warning.patch rhel6.3/ext4-prealloc.patch rhel6.3/ext4-mballoc-extra-checks.patch rhel6.3/ext4-misc.patch -rhel6.3/ext4-alloc-policy-2.6.patch rhel6.3/ext4-pdir-fix.patch rhel6.3/ext4-add-more-error-checks-to-ext4_mkdir.patch rhel6.3/ext4-osd-iop-common.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series index 0312233..dabcea3 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series @@ -7,7 +7,6 @@ sles11sp2/ext4-journal-callback.patch sles11sp2/ext4-make-quota-as-first-class-supported-feature.patch sles11sp2/ext4-handle-cleanup-after-quota-failure.patch -rhel6.3/ext4-wantedi-2.6.patch sles11sp2/ext4-map_inode_page-3.0.patch sles11sp2/export-ext4-3.0.patch rhel6.3/ext4-remove-cond_resched-calls.patch @@ -20,7 +19,6 @@ sles11sp2/ext4-prealloc.patch sles11sp2/ext4-mballoc-extra-checks.patch sles11sp2/restore-path-in-walk_extent_callback.patch sles11sp2/ext4-misc.patch -rhel6.3/ext4-alloc-policy-2.6.patch rhel6.3/ext4-pdir-fix.patch sles11sp2/ext4-osd-iop-common.patch rhel6.3/ext4-osd-iam-exports.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp3.series b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp3.series index 7baca84..025e41a 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp3.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp3.series @@ -7,7 +7,6 @@ sles11sp2/ext4-journal-callback.patch sles11sp2/ext4-make-quota-as-first-class-supported-feature.patch sles11sp2/ext4-handle-cleanup-after-quota-failure.patch -rhel6.3/ext4-wantedi-2.6.patch sles11sp2/ext4-map_inode_page-3.0.patch sles11sp2/export-ext4-3.0.patch rhel6.3/ext4-remove-cond_resched-calls.patch @@ -20,7 +19,6 @@ sles11sp2/ext4-prealloc.patch sles11sp2/ext4-mballoc-extra-checks.patch sles11sp2/restore-path-in-walk_extent_callback.patch sles11sp2/ext4-misc.patch -rhel6.3/ext4-alloc-policy-2.6.patch rhel6.3/ext4-pdir-fix.patch sles11sp2/ext4-osd-iop-common.patch rhel6.3/ext4-osd-iam-exports.patch -- 1.8.3.1