1 fs/ext3/ialloc.c | 38 ++++++++++++++++++++++++++++++++++++--
2 fs/ext3/ioctl.c | 25 +++++++++++++++++++++++++
3 fs/ext3/namei.c | 12 ++++++++----
4 include/linux/ext3_fs.h | 5 ++++-
5 4 files changed, 73 insertions(+), 7 deletions(-)
7 --- linux-2.4.20/fs/ext3/namei.c~extN-wantedi 2003-04-08 23:35:55.000000000 -0600
8 +++ linux-2.4.20-braam/fs/ext3/namei.c 2003-04-08 23:35:55.000000000 -0600
9 @@ -1555,7 +1555,8 @@ static int ext3_create (struct inode * d
13 - inode = ext3_new_inode (handle, dir, mode);
14 + inode = ext3_new_inode (handle, dir, mode,
15 + (unsigned long)dentry->d_fsdata);
18 inode->i_op = &ext3_file_inode_operations;
19 @@ -1583,7 +1584,8 @@ static int ext3_mknod (struct inode * di
23 - inode = ext3_new_inode (handle, dir, mode);
24 + inode = ext3_new_inode (handle, dir, mode,
25 + (unsigned long)dentry->d_fsdata);
28 init_special_inode(inode, mode, rdev);
29 @@ -1613,7 +1615,8 @@ static int ext3_mkdir(struct inode * dir
33 - inode = ext3_new_inode (handle, dir, S_IFDIR | mode);
34 + inode = ext3_new_inode (handle, dir, S_IFDIR | mode,
35 + (unsigned long)dentry->d_fsdata);
39 @@ -2009,7 +2012,8 @@ static int ext3_symlink (struct inode *
43 - inode = ext3_new_inode (handle, dir, S_IFLNK|S_IRWXUGO);
44 + inode = ext3_new_inode (handle, dir, S_IFLNK|S_IRWXUGO,
45 + (unsigned long)dentry->d_fsdata);
49 --- linux-2.4.20/fs/ext3/ialloc.c~extN-wantedi 2003-04-08 23:35:55.000000000 -0600
50 +++ linux-2.4.20-braam/fs/ext3/ialloc.c 2003-04-08 23:35:55.000000000 -0600
51 @@ -299,7 +299,8 @@ error_return:
52 * group to find a free inode.
54 struct inode * ext3_new_inode (handle_t *handle,
55 - const struct inode * dir, int mode)
56 + const struct inode * dir, int mode,
59 struct super_block * sb;
60 struct buffer_head * bh;
61 @@ -323,7 +324,39 @@ struct inode * ext3_new_inode (handle_t
62 init_rwsem(&inode->u.ext3_i.truncate_sem);
65 - es = sb->u.ext3_sb.s_es;
66 + es = EXT3_SB(sb)->s_es;
69 + i = (goal - 1) / EXT3_INODES_PER_GROUP(sb);
70 + j = (goal - 1) % EXT3_INODES_PER_GROUP(sb);
71 + gdp = ext3_get_group_desc(sb, i, &bh2);
73 + bitmap_nr = load_inode_bitmap (sb, i);
77 + bh = EXT3_SB(sb)->s_inode_bitmap[bitmap_nr];
79 + BUFFER_TRACE(bh, "get_write_access");
80 + err = ext3_journal_get_write_access(handle, bh);
83 + if (ext3_set_bit(j, bh->b_data)) {
84 + printk(KERN_ERR "goal inode %lu unavailable\n", goal);
85 + /* Oh well, we tried. */
89 + BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
90 + err = ext3_journal_dirty_metadata(handle, bh);
93 + /* We've shortcircuited the allocation system successfully,
94 + * now finish filling in the inode.
96 + goto have_bit_and_group;
102 @@ -438,6 +471,7 @@ repeat:
106 + have_bit_and_group:
107 j += i * EXT3_INODES_PER_GROUP(sb) + 1;
108 if (j < EXT3_FIRST_INO(sb) || j > le32_to_cpu(es->s_inodes_count)) {
109 ext3_error (sb, "ext3_new_inode",
110 --- linux-2.4.20/fs/ext3/ioctl.c~extN-wantedi 2003-04-08 23:35:55.000000000 -0600
111 +++ linux-2.4.20-braam/fs/ext3/ioctl.c 2003-04-08 23:35:55.000000000 -0600
112 @@ -23,6 +23,31 @@ int ext3_ioctl (struct inode * inode, st
113 ext3_debug ("cmd = %u, arg = %lu\n", cmd, arg);
116 + case EXT3_IOC_CREATE_INUM: {
118 + struct dentry *dchild, *dparent;
121 + dparent = list_entry(inode->i_dentry.next, struct dentry,
123 + snprintf(name, sizeof name, "%lu", arg);
124 + dchild = lookup_one_len(name, dparent, strlen(name));
125 + if (dchild->d_inode) {
126 + printk(KERN_ERR "%*s/%lu already exists (ino %lu)\n",
127 + dparent->d_name.len, dparent->d_name.name, arg,
128 + dchild->d_inode->i_ino);
131 + dchild->d_fsdata = (void *)arg;
132 + rc = vfs_create(inode, dchild, 0644);
134 + printk(KERN_ERR "vfs_create: %d\n", rc);
135 + else if (dchild->d_inode->i_ino != arg)
141 case EXT3_IOC_GETFLAGS:
142 flags = inode->u.ext3_i.i_flags & EXT3_FL_USER_VISIBLE;
143 return put_user(flags, (int *) arg);
144 --- linux-2.4.20/include/linux/ext3_fs.h~extN-wantedi 2003-04-08 23:35:55.000000000 -0600
145 +++ linux-2.4.20-braam/include/linux/ext3_fs.h 2003-04-08 23:35:55.000000000 -0600
146 @@ -201,6 +201,7 @@ struct ext3_group_desc
147 #define EXT3_IOC_SETFLAGS _IOW('f', 2, long)
148 #define EXT3_IOC_GETVERSION _IOR('f', 3, long)
149 #define EXT3_IOC_SETVERSION _IOW('f', 4, long)
150 +/* EXT3_IOC_CREATE_INUM at bottom of file (visible to kernel and user). */
151 #define EXT3_IOC_GETVERSION_OLD _IOR('v', 1, long)
152 #define EXT3_IOC_SETVERSION_OLD _IOW('v', 2, long)
153 #ifdef CONFIG_JBD_DEBUG
154 @@ -671,7 +672,8 @@ extern int ext3fs_dirhash(const char *na
155 dx_hash_info *hinfo);
158 -extern struct inode * ext3_new_inode (handle_t *, const struct inode *, int);
159 +extern struct inode * ext3_new_inode (handle_t *, const struct inode *, int,
161 extern void ext3_free_inode (handle_t *, struct inode *);
162 extern struct inode * ext3_orphan_get (struct super_block *, unsigned long);
163 extern unsigned long ext3_count_free_inodes (struct super_block *);
164 @@ -757,4 +759,5 @@ extern struct inode_operations ext3_fast
166 #endif /* __KERNEL__ */
168 +#define EXT3_IOC_CREATE_INUM _IOW('f', 5, long)
169 #endif /* _LINUX_EXT3_FS_H */