X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=ldiskfs%2Fkernel_patches%2Fpatches%2Fext4-wantedi-2.6-rhel5.patch;h=20c2c3885545a6fe4a7c2d912e933fc723f6c74c;hp=e0c6f8d8cac5b07d1f3fc16d775e57d06a815f46;hb=1cbf25caab01ac561bb35053ca34fb6eb7336b3d;hpb=b175e2441b0cd9fae60341ba92b0f7f192e71446 diff --git a/ldiskfs/kernel_patches/patches/ext4-wantedi-2.6-rhel5.patch b/ldiskfs/kernel_patches/patches/ext4-wantedi-2.6-rhel5.patch index e0c6f8d..20c2c38 100644 --- a/ldiskfs/kernel_patches/patches/ext4-wantedi-2.6-rhel5.patch +++ b/ldiskfs/kernel_patches/patches/ext4-wantedi-2.6-rhel5.patch @@ -1,169 +1,84 @@ -Index: linux-2.6.18.i386/fs/ext4/ialloc.c +Index: linux-2.6.18-194.3.1/fs/ext4/namei.c =================================================================== ---- linux-2.6.18.i386.orig/fs/ext4/ialloc.c -+++ linux-2.6.18.i386/fs/ext4/ialloc.c -@@ -576,7 +576,8 @@ static int find_group_other(struct super - * For other inodes, search forward from the parent directory's block - * group to find a free inode. - */ --struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode) -+struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode, -+ unsigned long goal) - { - struct super_block *sb; - struct buffer_head *bitmap_bh = NULL; -@@ -607,6 +608,43 @@ struct inode *ext4_new_inode(handle_t *h - sbi = EXT4_SB(sb); - es = sbi->s_es; - -+ if (goal) { -+ group = (goal - 1) / EXT4_INODES_PER_GROUP(sb); -+ ino = (goal - 1) % EXT4_INODES_PER_GROUP(sb); -+ err = -EIO; -+ -+ gdp = ext4_get_group_desc(sb, group, &bh2); -+ if (!gdp) -+ goto fail; -+ -+ bitmap_bh = ext4_read_inode_bitmap(sb, group); -+ if (!bitmap_bh) -+ goto fail; -+ -+ BUFFER_TRACE(bh, "get_write_access"); -+ err = ext4_journal_get_write_access(handle, bitmap_bh); -+ if (err) -+ goto fail; -+ -+ if (ext4_set_bit_atomic(sb_bgl_lock(sbi, group), -+ ino, bitmap_bh->b_data)) { -+ printk(KERN_ERR "goal inode %lu unavailable\n", goal); -+ /* Oh well, we tried. */ -+ goto continue_allocation; -+ } -+ -+ BUFFER_TRACE(bh, "call ext4_journal_dirty_metadata"); -+ err = ext4_journal_dirty_metadata(handle, bitmap_bh); -+ if (err) -+ goto fail; -+ -+ /* We've shortcircuited the allocation system successfully, -+ * now finish filling in the inode. -+ */ -+ goto got; -+ } -+ -+continue_allocation: - if (sbi->s_log_groups_per_flex) { - ret2 = find_group_flex(sb, dir, &group); - goto got_group; -Index: linux-2.6.18.i386/fs/ext4/namei.c -=================================================================== ---- linux-2.6.18.i386.orig/fs/ext4/namei.c -+++ linux-2.6.18.i386/fs/ext4/namei.c -@@ -104,6 +104,7 @@ struct dx_entry - __le32 block; - }; - -+ - /* - * dx_root_info is laid out so that if it should somehow get overlaid by a - * dirent the two low bits of the hash version will be zero. Therefore, the -@@ -149,6 +150,14 @@ struct dx_map_entry +--- linux-2.6.18-194.3.1.orig/fs/ext4/namei.c ++++ linux-2.6.18-194.3.1/fs/ext4/namei.c +@@ -148,6 +148,17 @@ struct dx_map_entry u16 size; }; ++/* ++ * dentry_param used by ext4_new_inode_wantedi() ++ */ +#define LVFS_DENTRY_PARAM_MAGIC 20070216UL +struct lvfs_dentry_params +{ -+ unsigned long p_inum; -+ void *p_ptr; -+ u32 magic; ++ 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); -@@ -1708,6 +1717,20 @@ static int ext4_add_nondir(handle_t *han + static inline unsigned dx_get_hash(struct dx_entry *entry); +@@ -1761,6 +1772,19 @@ static int ext4_add_nondir(handle_t *han return err; } -+static struct inode * ext4_new_inode_wantedi(handle_t *handle, struct inode *dir, -+ int mode, struct dentry *dentry) ++static unsigned ext4_dentry_goal(struct super_block *sb, struct dentry *dentry) +{ -+ unsigned long inum = 0; ++ unsigned inum = EXT4_SB(sb)->s_inode_goal; + + if (dentry->d_fsdata != NULL) { + struct lvfs_dentry_params *param = dentry->d_fsdata; + -+ if (param->magic == LVFS_DENTRY_PARAM_MAGIC) -+ inum = param->p_inum; ++ if (param->ldp_magic == LVFS_DENTRY_PARAM_MAGIC) ++ inum = param->ldp_inum; + } -+ return ext4_new_inode(handle, dir, mode, inum); ++ return inum; +} + /* * By the time this is called, we already have created * the directory cache entry for the new file, but it -@@ -1733,7 +1756,7 @@ retry: +@@ -1786,7 +1810,8 @@ retry: if (IS_DIRSYNC(dir)) - handle->h_sync = 1; + ext4_handle_sync(handle); -- inode = ext4_new_inode (handle, dir, mode); -+ inode = ext4_new_inode_wantedi (handle, dir, mode, dentry); +- 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; -@@ -1767,7 +1790,7 @@ retry: +@@ -1820,7 +1845,8 @@ retry: if (IS_DIRSYNC(dir)) - handle->h_sync = 1; + ext4_handle_sync(handle); -- inode = ext4_new_inode (handle, dir, mode); -+ inode = ext4_new_inode_wantedi (handle, dir, mode, dentry); +- 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); -@@ -1803,7 +1826,7 @@ retry: +@@ -1857,8 +1883,8 @@ retry: if (IS_DIRSYNC(dir)) - handle->h_sync = 1; + ext4_handle_sync(handle); -- inode = ext4_new_inode (handle, dir, S_IFDIR | mode); -+ inode = ext4_new_inode_wantedi (handle, dir, S_IFDIR | mode, dentry); +- inode = ext4_new_inode(handle, dir, S_IFDIR | mode, +- &dentry->d_name, 0); ++ inode = ext4_new_inode(handle, dir, S_IFDIR | mode, &dentry->d_name, ++ ext4_dentry_goal(dir->i_sb, dentry)); err = PTR_ERR(inode); if (IS_ERR(inode)) goto out_stop; -@@ -2203,7 +2226,7 @@ retry: +@@ -2270,8 +2296,8 @@ retry: if (IS_DIRSYNC(dir)) - handle->h_sync = 1; + ext4_handle_sync(handle); -- inode = ext4_new_inode (handle, dir, S_IFLNK|S_IRWXUGO); -+ inode = ext4_new_inode_wantedi (handle, dir, S_IFLNK|S_IRWXUGO, dentry); +- inode = ext4_new_inode(handle, dir, S_IFLNK|S_IRWXUGO, +- &dentry->d_name, 0); ++ inode = ext4_new_inode(handle, dir, S_IFLNK|S_IRWXUGO, &dentry->d_name, ++ ext4_dentry_goal(dir->i_sb, dentry)); err = PTR_ERR(inode); if (IS_ERR(inode)) goto out_stop; -Index: linux-2.6.18.i386/fs/ext4/ext4.h -=================================================================== ---- linux-2.6.18.i386.orig/fs/ext4/ext4.h -+++ linux-2.6.18.i386/fs/ext4/ext4.h -@@ -1013,7 +1013,8 @@ extern int ext4fs_dirhash(const char *na - dx_hash_info *hinfo); - - /* ialloc.c */ --extern struct inode * ext4_new_inode (handle_t *, struct inode *, int); -+extern struct inode * ext4_new_inode (handle_t *, struct inode *, int, -+ unsigned long); - extern void ext4_free_inode (handle_t *, struct inode *); - extern struct inode * ext4_orphan_get (struct super_block *, unsigned long); - extern unsigned long ext4_count_free_inodes (struct super_block *); -Index: linux-2.6.18.i386/fs/ext4/migrate.c -=================================================================== ---- linux-2.6.18.i386.orig/fs/ext4/migrate.c -+++ linux-2.6.18.i386/fs/ext4/migrate.c -@@ -485,7 +485,7 @@ int ext4_ext_migrate(struct inode *inode - } - tmp_inode = ext4_new_inode(handle, - inode->i_sb->s_root->d_inode, -- S_IFREG); -+ S_IFREG, 0); - if (IS_ERR(tmp_inode)) { - retval = -ENOMEM; - ext4_journal_stop(handle);