1 fs/ext3/ialloc.c | 40 ++++++++++++++++++++++++++++++++++++++--
3 fs/ext3/ioctl.c | 25 +++++++++++++++++++++++++
4 fs/ext3/namei.c | 21 +++++++++++++++++----
5 include/linux/dcache.h | 5 +++++
6 include/linux/ext3_fs.h | 5 ++++-
7 6 files changed, 90 insertions(+), 8 deletions(-)
9 --- linux-2.4.18-chaos-uml/fs/ext3/namei.c~extN-wantedi 2003-09-18 12:17:23.000000000 +0400
10 +++ linux-2.4.18-chaos-uml-alexey/fs/ext3/namei.c 2003-09-18 12:17:26.000000000 +0400
11 @@ -1531,6 +1531,19 @@ static int ext3_add_nondir(handle_t *han
15 +static struct inode * ext3_new_inode_wantedi(handle_t *handle, struct inode *dir,
16 + int mode, struct dentry *dentry)
18 + unsigned long inum = 0;
20 + if (dentry->d_fsdata != NULL) {
21 + struct dentry_params *param =
22 + (struct dentry_params *) dentry->d_fsdata;
23 + inum = param->p_inum;
25 + return ext3_new_inode(handle, dir, mode, inum);
29 * By the time this is called, we already have created
30 * the directory cache entry for the new file, but it
31 @@ -1554,7 +1567,7 @@ static int ext3_create (struct inode * d
35 - inode = ext3_new_inode (handle, dir, mode);
36 + inode = ext3_new_inode_wantedi (handle, dir, mode, dentry);
39 inode->i_op = &ext3_file_inode_operations;
40 @@ -1583,7 +1596,7 @@ static int ext3_mknod (struct inode * di
44 - inode = ext3_new_inode (handle, dir, mode);
45 + inode = ext3_new_inode_wantedi (handle, dir, mode, dentry);
48 init_special_inode(inode, mode, rdev);
49 @@ -1614,7 +1627,7 @@ static int ext3_mkdir(struct inode * dir
53 - inode = ext3_new_inode (handle, dir, S_IFDIR | mode);
54 + inode = ext3_new_inode_wantedi (handle, dir, S_IFDIR | mode, dentry);
58 @@ -2008,7 +2021,7 @@ static int ext3_symlink (struct inode *
62 - inode = ext3_new_inode (handle, dir, S_IFLNK|S_IRWXUGO);
63 + inode = ext3_new_inode_wantedi (handle, dir, S_IFLNK|S_IRWXUGO, dentry);
67 --- linux-2.4.18-chaos-uml/fs/ext3/ialloc.c~extN-wantedi 2003-09-18 12:17:25.000000000 +0400
68 +++ linux-2.4.18-chaos-uml-alexey/fs/ext3/ialloc.c 2003-09-18 12:17:26.000000000 +0400
69 @@ -330,7 +330,8 @@ int ext3_itable_block_used(struct super_
70 * group to find a free inode.
72 struct inode * ext3_new_inode (handle_t *handle,
73 - const struct inode * dir, int mode)
74 + const struct inode * dir, int mode,
77 struct super_block * sb;
78 struct buffer_head * bh;
79 @@ -323,7 +324,41 @@ struct inode * ext3_new_inode (handle_t
80 init_rwsem(&inode->u.ext3_i.truncate_sem);
83 - es = sb->u.ext3_sb.s_es;
84 + es = EXT3_SB(sb)->s_es;
87 + i = (goal - 1) / EXT3_INODES_PER_GROUP(sb);
88 + j = (goal - 1) % EXT3_INODES_PER_GROUP(sb);
89 + gdp = ext3_get_group_desc(sb, i, &bh2);
91 + bitmap_nr = load_inode_bitmap (sb, i);
92 + if (bitmap_nr < 0) {
97 + bh = EXT3_SB(sb)->s_inode_bitmap[bitmap_nr];
99 + BUFFER_TRACE(bh, "get_write_access");
100 + err = ext3_journal_get_write_access(handle, bh);
101 + if (err) goto fail;
103 + if (ext3_set_bit(j, bh->b_data)) {
104 + printk(KERN_ERR "goal inode %lu unavailable\n", goal);
105 + /* Oh well, we tried. */
109 + BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
110 + err = ext3_journal_dirty_metadata(handle, bh);
111 + if (err) goto fail;
113 + /* We've shortcircuited the allocation system successfully,
114 + * now finish filling in the inode.
116 + goto have_bit_and_group;
122 @@ -438,6 +471,7 @@ repeat:
126 + have_bit_and_group:
127 j += i * EXT3_INODES_PER_GROUP(sb) + 1;
128 if (j < EXT3_FIRST_INO(sb) || j > le32_to_cpu(es->s_inodes_count)) {
129 ext3_error (sb, "ext3_new_inode",
130 --- linux-2.4.18-18.8.0-l15/fs/ext3/inode.c~extN-wantedi Thu Jul 3 00:15:41 2003
131 +++ linux-2.4.18-18.8.0-l15-adilger/fs/ext3/inode.c Thu Jul 3 00:17:28 2003
132 @@ -2070,7 +2070,7 @@ void ext3_truncate_thread(struct inode *
136 - new_inode = ext3_new_inode(handle, old_inode, old_inode->i_mode);
137 + new_inode = ext3_new_inode(handle, old_inode, old_inode->i_mode, 0);
138 if (IS_ERR(new_inode)) {
139 ext3_debug("truncate inode %lu directly (no new inodes)\n",
141 --- linux-2.4.20/fs/ext3/ioctl.c~extN-wantedi 2003-04-08 23:35:55.000000000 -0600
142 +++ linux-2.4.20-braam/fs/ext3/ioctl.c 2003-04-08 23:35:55.000000000 -0600
143 @@ -23,6 +23,31 @@ int ext3_ioctl (struct inode * inode, st
144 ext3_debug ("cmd = %u, arg = %lu\n", cmd, arg);
147 + case EXT3_IOC_CREATE_INUM: {
149 + struct dentry *dchild, *dparent;
152 + dparent = list_entry(inode->i_dentry.next, struct dentry,
154 + snprintf(name, sizeof name, "%lu", arg);
155 + dchild = lookup_one_len(name, dparent, strlen(name));
156 + if (dchild->d_inode) {
157 + printk(KERN_ERR "%*s/%lu already exists (ino %lu)\n",
158 + dparent->d_name.len, dparent->d_name.name, arg,
159 + dchild->d_inode->i_ino);
162 + dchild->d_fsdata = (void *)arg;
163 + rc = vfs_create(inode, dchild, 0644);
165 + printk(KERN_ERR "vfs_create: %d\n", rc);
166 + else if (dchild->d_inode->i_ino != arg)
172 case EXT3_IOC_GETFLAGS:
173 flags = inode->u.ext3_i.i_flags & EXT3_FL_USER_VISIBLE;
174 return put_user(flags, (int *) arg);
175 --- linux-2.4.20/include/linux/ext3_fs.h~extN-wantedi 2003-04-08 23:35:55.000000000 -0600
176 +++ linux-2.4.20-braam/include/linux/ext3_fs.h 2003-04-08 23:35:55.000000000 -0600
177 @@ -201,6 +201,7 @@ struct ext3_group_desc
178 #define EXT3_IOC_SETFLAGS _IOW('f', 2, long)
179 #define EXT3_IOC_GETVERSION _IOR('f', 3, long)
180 #define EXT3_IOC_SETVERSION _IOW('f', 4, long)
181 +/* EXT3_IOC_CREATE_INUM at bottom of file (visible to kernel and user). */
182 #define EXT3_IOC_GETVERSION_OLD _IOR('v', 1, long)
183 #define EXT3_IOC_SETVERSION_OLD _IOW('v', 2, long)
184 #ifdef CONFIG_JBD_DEBUG
185 @@ -671,7 +672,8 @@ extern int ext3fs_dirhash(const char *na
186 dx_hash_info *hinfo);
189 -extern struct inode * ext3_new_inode (handle_t *, const struct inode *, int);
190 +extern struct inode * ext3_new_inode (handle_t *, const struct inode *, int,
192 extern void ext3_free_inode (handle_t *, struct inode *);
193 extern struct inode * ext3_orphan_get (struct super_block *, unsigned long);
194 extern unsigned long ext3_count_free_inodes (struct super_block *);
195 @@ -776,4 +778,5 @@ extern struct inode_operations ext3_fast
197 #endif /* __KERNEL__ */
199 +#define EXT3_IOC_CREATE_INUM _IOW('f', 5, long)
200 #endif /* _LINUX_EXT3_FS_H */
201 --- linux-2.4.18-chaos-uml/include/linux/dcache.h~extN-wantedi 2003-09-18 12:17:17.000000000 +0400
202 +++ linux-2.4.18-chaos-uml-alexey/include/linux/dcache.h 2003-09-18 12:18:47.000000000 +0400
203 @@ -62,6 +62,11 @@ static inline void intent_init(struct lo
205 #define IS_ROOT(x) ((x) == (x)->d_parent)
207 +struct dentry_params {
208 + unsigned long p_inum;
213 * "quick string" -- eases parameter passing, but more importantly
214 * saves "metadata" about the string (ie length and the hash).