1 diff -rp ldiskfs/linux-stage/fs/ext3/ialloc.c ldiskfs.new/linux-stage/fs/ext3/ialloc.c
2 *** linux-stage/fs/ext3/ialloc.c 2009-04-10 08:44:23.000000000 +0300
3 --- linux-stage/fs/ext3/ialloc.c 2009-04-10 08:39:37.000000000 +0300
4 *************** fail_drop:
10 + unsigned long ext3_find_reverse(struct super_block *sb)
12 + struct ext3_group_desc *desc;
13 + struct buffer_head *bitmap_bh = NULL;
15 + unsigned long ino, offset;
17 + for (offset = (EXT3_INODES_PER_GROUP(sb) >> 1); offset >= 0;
19 + for (group = EXT3_SB(sb)->s_groups_count - 1; group >= 0;
21 + desc = ext3_get_group_desc(sb, group, NULL);
22 + if (desc->bg_free_inodes_count == 0)
25 + bitmap_bh = read_inode_bitmap(sb, group);
29 + ino = ext3_find_next_zero_bit((unsigned long *)
31 + EXT3_INODES_PER_GROUP(sb), offset);
32 + if (ino < EXT3_INODES_PER_GROUP(sb))
33 + return(group * EXT3_INODES_PER_GROUP(sb) +
40 /* Verify that we are loading a valid orphan from disk */
41 struct inode *ext3_orphan_get(struct super_block *sb, unsigned long ino)
43 diff -rp ldiskfs/linux-stage/fs/ext3/namei.c ldiskfs.new/linux-stage/fs/ext3/namei.c
44 *** linux-stage/fs/ext3/namei.c 2009-04-10 08:44:23.000000000 +0300
45 --- linux-stage/fs/ext3/namei.c 2009-04-10 08:39:37.000000000 +0300
46 *************** struct dx_map_entry
51 #define LVFS_DENTRY_PARAM_MAGIC 20070216UL
52 struct lvfs_dentry_params
54 ! unsigned long p_inum;
59 #ifdef CONFIG_EXT3_INDEX
60 static inline unsigned dx_get_block (struct dx_entry *entry);
61 static void dx_set_block (struct dx_entry *entry, unsigned value);
67 + * dentry_param used by ext3_new_inode_wantedi()
69 #define LVFS_DENTRY_PARAM_MAGIC 20070216UL
70 struct lvfs_dentry_params
72 ! unsigned long ldp_inum;
77 + /* Only use the least 3 bits of ldp_flags for goal policy */
80 + DP_LASTGROUP_REVERSE = 1,
83 #ifdef CONFIG_EXT3_INDEX
84 static inline unsigned dx_get_block (struct dx_entry *entry);
85 static void dx_set_block (struct dx_entry *entry, unsigned value);
86 *************** static struct inode * ext3_new_inode_wan
88 if (dentry->d_fsdata != NULL) {
89 struct lvfs_dentry_params *param = dentry->d_fsdata;
91 ! if (param->magic == LVFS_DENTRY_PARAM_MAGIC)
92 ! inum = param->p_inum;
94 return ext3_new_inode(handle, dir, mode, inum);
97 if (dentry->d_fsdata != NULL) {
98 struct lvfs_dentry_params *param = dentry->d_fsdata;
100 ! if (param->ldp_magic == LVFS_DENTRY_PARAM_MAGIC) {
101 ! if ((dp_policy_t)(param->ldp_flags & 0x7) ==
102 ! DP_LASTGROUP_REVERSE)
103 ! inum = ext3_find_reverse(dir->i_sb);
104 ! else /* DP_GOAL_POLICY */
105 ! inum = param->ldp_inum;
108 return ext3_new_inode(handle, dir, mode, inum);
110 diff -rp ldiskfs/linux-stage/include/linux/ext3_fs.h ldiskfs.new/linux-stage/include/linux/ext3_fs.h
111 *** linux-stage/include/linux/ext3_fs.h 2009-04-10 08:44:23.000000000 +0300
112 --- linux-stage/include/linux/ext3_fs.h 2009-04-10 08:39:37.000000000 +0300
113 *************** extern int ext3fs_dirhash(const char *na
117 extern struct inode * ext3_new_inode (handle_t *, struct inode *, int,
119 + extern unsigned long ext3_find_reverse(struct super_block *);
120 extern void ext3_free_inode (handle_t *, struct inode *);
121 extern struct inode * ext3_orphan_get (struct super_block *, unsigned long);
122 extern unsigned long ext3_count_free_inodes (struct super_block *);