1 --- lustre/extN-clean/namei.c 2002-12-30 05:56:09.000000000 -0500
2 +++ lustre/extN/namei.c 2002-12-30 06:29:39.000000000 -0500
7 - inode = extN_new_inode (handle, dir, mode);
8 + inode = extN_new_inode (handle, dir, mode,
9 + (unsigned long)dentry->d_fsdata);
12 inode->i_op = &extN_file_inode_operations;
17 - inode = extN_new_inode (handle, dir, mode);
18 + inode = extN_new_inode (handle, dir, mode,
19 + (unsigned long)dentry->d_fsdata);
22 init_special_inode(inode, mode, rdev);
27 - inode = extN_new_inode (handle, dir, S_IFDIR | mode);
28 + inode = extN_new_inode (handle, dir, S_IFDIR | mode,
29 + (unsigned long)dentry->d_fsdata);
37 - inode = extN_new_inode (handle, dir, S_IFLNK|S_IRWXUGO);
38 + inode = extN_new_inode (handle, dir, S_IFLNK|S_IRWXUGO,
39 + (unsigned long)dentry->d_fsdata);
43 --- lustre/extN-clean/ialloc.c 2002-12-28 23:56:42.000000000 -0500
44 +++ lustre/extN/ialloc.c 2002-12-30 06:29:39.000000000 -0500
46 * For other inodes, search forward from the parent directory's block
47 * group to find a free inode.
49 -struct inode * extN_new_inode (handle_t *handle,
50 - const struct inode * dir, int mode)
51 +struct inode *extN_new_inode(handle_t *handle, const struct inode *dir,
52 + int mode, unsigned long goal)
54 struct super_block * sb;
55 struct buffer_head * bh;
62 + i = (goal - 1) / EXTN_INODES_PER_GROUP(sb);
63 + j = (goal - 1) % EXTN_INODES_PER_GROUP(sb);
64 + gdp = extN_get_group_desc(sb, i, &bh2);
66 + bitmap_nr = load_inode_bitmap (sb, i);
70 + bh = sbi->s_inode_bitmap[bitmap_nr];
72 + BUFFER_TRACE(bh, "get_write_access");
73 + err = extN_journal_get_write_access(handle, bh);
76 + if (extN_set_bit(j, bh->b_data)) {
77 + printk(KERN_ERR "goal inode %lu unavailable", goal);
78 + /* Oh well, we tried. */
82 + BUFFER_TRACE(bh, "call extN_journal_dirty_metadata");
83 + err = extN_journal_dirty_metadata(handle, bh);
86 + /* We've shortcircuited the allocation system successfully,
87 + * now finish filling in the inode.
89 + goto have_bit_and_group;
100 j += i * sbi->s_inodes_per_group + 1;
101 if (j < sbi->s_first_ino || j > le32_to_cpu(es->s_inodes_count)) {
102 extN_error (sb, "extN_new_inode",
103 --- lustre/extN-clean/ioctl.c 2002-12-28 23:56:42.000000000 -0500
104 +++ lustre/extN/ioctl.c 2002-12-30 06:29:39.000000000 -0500
106 extN_debug ("cmd = %u, arg = %lu\n", cmd, arg);
109 + case EXTN_IOC_CREATE_INUM: {
111 + struct dentry *dchild, *dparent;
114 + dparent = list_entry(inode->i_dentry.next, struct dentry,
116 + snprintf(name, sizeof name, "%lu", arg);
117 + dchild = lookup_one_len(name, dparent, strlen(name));
118 + if (dchild->d_inode) {
119 + printk(KERN_ERR "%*s/%lu already exists (ino %lu)\n",
120 + dparent->d_name.len, dparent->d_name.name, arg,
121 + dchild->d_inode->i_ino);
124 + dchild->d_fsdata = (void *)arg;
125 + rc = vfs_create(inode, dchild, 0644);
127 + printk(KERN_ERR "vfs_create: %d\n", rc);
128 + else if (dchild->d_inode->i_ino != arg)
134 case EXTN_IOC_GETFLAGS:
135 flags = ei->i_flags & EXTN_FL_USER_VISIBLE;
136 return put_user(flags, (int *) arg);
137 --- lustre/include/linux/extN_fs.h~ 2002-12-30 06:01:43.000000000 -0500
138 +++ lustre/include/linux/extN_fs.h 2002-12-30 06:02:51.000000000 -0500
140 #define EXTN_IOC_SETFLAGS _IOW('f', 2, long)
141 #define EXTN_IOC_GETVERSION _IOR('f', 3, long)
142 #define EXTN_IOC_SETVERSION _IOW('f', 4, long)
143 +/* EXTN_IOC_CREATE_INUM at bottom of file (visible to kernel and user). */
144 #define EXTN_IOC_GETVERSION_OLD _IOR('v', 1, long)
145 #define EXTN_IOC_SETVERSION_OLD _IOW('v', 2, long)
146 #ifdef CONFIG_JBD_DEBUG
148 extern int extN_sync_file (struct file *, struct dentry *, int);
151 -extern struct inode * extN_new_inode (handle_t *, const struct inode *, int);
152 +extern struct inode * extN_new_inode (handle_t *, const struct inode *, int,
154 extern void extN_free_inode (handle_t *, struct inode *);
155 extern struct inode * extN_orphan_get (struct super_block *, ino_t);
156 extern unsigned long extN_count_free_inodes (struct super_block *);
159 #endif /* __KERNEL__ */
161 +#define EXTN_IOC_CREATE_INUM _IOW('f', 5, long)
163 #endif /* _LINUX_EXTN_FS_H */