1 fs/ext3/ialloc.c | 5 +++--
3 fs/ext3/namei.c | 43 +++++++++++++++++++++++++++++++++++++------
4 include/asm-alpha/fcntl.h | 1 +
5 include/asm-arm/fcntl.h | 1 +
6 include/asm-cris/fcntl.h | 1 +
7 include/asm-i386/fcntl.h | 1 +
8 include/asm-ia64/fcntl.h | 1 +
9 include/asm-m68k/fcntl.h | 1 +
10 include/asm-mips/fcntl.h | 1 +
11 include/asm-mips64/fcntl.h | 1 +
12 include/asm-parisc/fcntl.h | 1 +
13 include/asm-ppc/fcntl.h | 1 +
14 include/asm-s390/fcntl.h | 1 +
15 include/asm-s390x/fcntl.h | 1 +
16 include/asm-sh/fcntl.h | 1 +
17 include/asm-sparc/fcntl.h | 1 +
18 include/asm-sparc64/fcntl.h | 1 +
19 include/linux/ext3_fs.h | 2 +-
20 19 files changed, 57 insertions(+), 10 deletions(-)
22 --- linux-2.4.18-chaos/fs/ext3/ialloc.c~ext3-extents-oflag-2.4.18-chaos 2003-10-08 10:29:12.000000000 +0400
23 +++ linux-2.4.18-chaos-alexey/fs/ext3/ialloc.c 2003-10-08 10:29:30.000000000 +0400
24 @@ -331,7 +331,8 @@ int ext3_itable_block_used(struct super_
26 struct inode * ext3_new_inode (handle_t *handle,
27 const struct inode * dir, int mode,
30 + struct lookup_intent *it)
32 struct super_block * sb;
33 struct buffer_head * bh;
34 @@ -573,7 +574,7 @@ repeat:
35 ei->i_prealloc_count = 0;
37 ei->i_block_group = i;
38 - if (test_opt(sb, EXTENTS))
39 + if (test_opt(sb, EXTENTS) && it && (it->it_flags & O_EXTENTS))
40 EXT3_I(inode)->i_flags |= EXT3_EXTENTS_FL;
42 sema_init(&ei->i_ext_sem, 1);
43 --- linux-2.4.18-chaos/fs/ext3/namei.c~ext3-extents-oflag-2.4.18-chaos 2003-10-08 10:29:11.000000000 +0400
44 +++ linux-2.4.18-chaos-alexey/fs/ext3/namei.c 2003-10-08 10:36:33.000000000 +0400
45 @@ -1204,7 +1204,9 @@ static int ext3_add_nondir(handle_t *han
48 static struct inode * ext3_new_inode_wantedi(handle_t *handle, struct inode *dir,
49 - int mode, struct dentry *dentry)
50 + int mode, struct dentry *dentry,
51 + struct lookup_intent *it)
54 unsigned long inum = 0;
56 @@ -1213,7 +1215,7 @@ static struct inode * ext3_new_inode_wan
57 (struct dentry_params *) dentry->d_fsdata;
60 - return ext3_new_inode(handle, dir, mode, inum);
61 + return ext3_new_inode(handle, dir, mode, inum, it);
65 @@ -1238,7 +1240,35 @@ static int ext3_create (struct inode * d
69 - inode = ext3_new_inode_wantedi (handle, dir, mode, dentry);
70 + inode = ext3_new_inode_wantedi (handle, dir, mode, dentry, NULL);
71 + err = PTR_ERR(inode);
72 + if (!IS_ERR(inode)) {
73 + inode->i_op = &ext3_file_inode_operations;
74 + inode->i_fop = &ext3_file_operations;
75 + inode->i_mapping->a_ops = &ext3_aops;
76 + err = ext3_add_nondir(handle, dentry, inode);
77 + ext3_mark_inode_dirty(handle, inode);
79 + ext3_journal_stop(handle, dir);
83 +static int ext3_create_it (struct inode * dir, struct dentry * dentry, int mode,
84 + struct lookup_intent *it)
87 + struct inode * inode;
90 + handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
91 + EXT3_INDEX_EXTRA_TRANS_BLOCKS + 3);
93 + return PTR_ERR(handle);
98 + inode = ext3_new_inode_wantedi (handle, dir, mode, dentry, it);
100 if (!IS_ERR(inode)) {
101 inode->i_op = &ext3_file_inode_operations;
102 @@ -1266,7 +1296,7 @@ static int ext3_mknod (struct inode * di
106 - inode = ext3_new_inode_wantedi (handle, dir, mode, dentry);
107 + inode = ext3_new_inode_wantedi (handle, dir, mode, dentry, NULL);
108 err = PTR_ERR(inode);
109 if (!IS_ERR(inode)) {
110 init_special_inode(inode, mode, rdev);
111 @@ -1296,7 +1326,7 @@ static int ext3_mkdir(struct inode * dir
115 - inode = ext3_new_inode_wantedi (handle, dir, S_IFDIR | mode, dentry);
116 + inode = ext3_new_inode_wantedi (handle, dir, S_IFDIR|mode, dentry, NULL);
117 err = PTR_ERR(inode);
120 @@ -1688,7 +1718,7 @@ static int ext3_symlink (struct inode *
124 - inode = ext3_new_inode_wantedi (handle, dir, S_IFLNK|S_IRWXUGO, dentry);
125 + inode = ext3_new_inode_wantedi (handle, dir, S_IFLNK|S_IRWXUGO, dentry,NULL);
126 err = PTR_ERR(inode);
129 @@ -1892,6 +1922,7 @@ end_rename:
130 * directories can handle most operations...
132 struct inode_operations ext3_dir_inode_operations = {
133 + create_it: ext3_create_it, /* BKL held */
134 create: ext3_create, /* BKL held */
135 lookup: ext3_lookup, /* BKL held */
136 link: ext3_link, /* BKL held */
137 --- linux-2.4.18-chaos/include/asm-alpha/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2003-07-28 17:52:07.000000000 +0400
138 +++ linux-2.4.18-chaos-alexey/include/asm-alpha/fcntl.h 2003-10-08 10:29:30.000000000 +0400
140 #define O_LARGEFILE 0400000 /* will be set by the kernel on every open */
141 #define O_ATOMICLOOKUP 01000000 /* do atomic file lookup */
142 #define O_DIRECT 02000000 /* direct disk access - should check with OSF/1 */
143 +#define O_EXTENTS 04000000 /* create file with extents if possible */
145 #define F_DUPFD 0 /* dup */
146 #define F_GETFD 1 /* get close_on_exec */
147 --- linux-2.4.18-chaos/include/asm-arm/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2003-07-28 17:52:07.000000000 +0400
148 +++ linux-2.4.18-chaos-alexey/include/asm-arm/fcntl.h 2003-10-08 10:29:30.000000000 +0400
150 #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
151 #define O_LARGEFILE 0400000
152 #define O_ATOMICLOOKUP 01000000
153 +#define O_EXTENTS 02000000 /* create file with extents if possible */
155 #define F_DUPFD 0 /* dup */
156 #define F_GETFD 1 /* get close_on_exec */
157 --- linux-2.4.18-chaos/include/asm-cris/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2001-02-09 03:32:44.000000000 +0300
158 +++ linux-2.4.18-chaos-alexey/include/asm-cris/fcntl.h 2003-10-08 10:29:30.000000000 +0400
160 #define O_LARGEFILE 0100000
161 #define O_DIRECTORY 0200000 /* must be a directory */
162 #define O_NOFOLLOW 0400000 /* don't follow links */
163 +#define O_EXTENTS 01000000 /* create file with extents if possible */
165 #define F_DUPFD 0 /* dup */
166 #define F_GETFD 1 /* get f_flags */
167 --- linux-2.4.18-chaos/include/asm-i386/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2003-07-28 17:52:09.000000000 +0400
168 +++ linux-2.4.18-chaos-alexey/include/asm-i386/fcntl.h 2003-10-08 10:29:30.000000000 +0400
170 #define O_DIRECTORY 0200000 /* must be a directory */
171 #define O_NOFOLLOW 0400000 /* don't follow links */
172 #define O_ATOMICLOOKUP 01000000 /* do atomic file lookup */
173 +#define O_EXTENTS 02000000 /* create file with extents if possible */
175 #define F_DUPFD 0 /* dup */
176 #define F_GETFD 1 /* get close_on_exec */
177 --- linux-2.4.18-chaos/include/asm-ia64/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2003-07-28 17:52:09.000000000 +0400
178 +++ linux-2.4.18-chaos-alexey/include/asm-ia64/fcntl.h 2003-10-08 10:29:30.000000000 +0400
180 #define O_DIRECTORY 0200000 /* must be a directory */
181 #define O_NOFOLLOW 0400000 /* don't follow links */
182 #define O_ATOMICLOOKUP 01000000 /* do atomic file lookup */
183 +#define O_EXTENTS 02000000 /* create file with extents if possible */
185 #define F_DUPFD 0 /* dup */
186 #define F_GETFD 1 /* get close_on_exec */
187 --- linux-2.4.18-chaos/include/asm-m68k/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2000-11-28 05:00:49.000000000 +0300
188 +++ linux-2.4.18-chaos-alexey/include/asm-m68k/fcntl.h 2003-10-08 10:29:30.000000000 +0400
190 #define O_NOFOLLOW 0100000 /* don't follow links */
191 #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
192 #define O_LARGEFILE 0400000
193 +#define O_EXTENTS 01000000 /* create file with extents if possible */
195 #define F_DUPFD 0 /* dup */
196 #define F_GETFD 1 /* get close_on_exec */
197 --- linux-2.4.18-chaos/include/asm-mips64/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2003-07-28 17:52:15.000000000 +0400
198 +++ linux-2.4.18-chaos-alexey/include/asm-mips64/fcntl.h 2003-10-08 10:29:30.000000000 +0400
200 #define O_DIRECTORY 0x10000 /* must be a directory */
201 #define O_NOFOLLOW 0x20000 /* don't follow links */
202 #define O_ATOMICLOOKUP 0x40000
203 +#define O_EXTENTS 0x80000 /* create file with extents if possible */
205 #define O_NDELAY O_NONBLOCK
207 --- linux-2.4.18-chaos/include/asm-mips/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2003-07-28 17:52:14.000000000 +0400
208 +++ linux-2.4.18-chaos-alexey/include/asm-mips/fcntl.h 2003-10-08 10:29:30.000000000 +0400
210 #define O_DIRECTORY 0x10000 /* must be a directory */
211 #define O_NOFOLLOW 0x20000 /* don't follow links */
212 #define O_ATOMICLOOKUP 0x40000
213 +#define O_EXTENTS 02000000 /* create file with extents if possible */
215 #define O_NDELAY O_NONBLOCK
217 --- linux-2.4.18-chaos/include/asm-parisc/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2000-12-05 23:29:39.000000000 +0300
218 +++ linux-2.4.18-chaos-alexey/include/asm-parisc/fcntl.h 2003-10-08 10:29:30.000000000 +0400
220 #define O_NOCTTY 00400000 /* not fcntl */
221 #define O_DSYNC 01000000 /* HPUX only */
222 #define O_RSYNC 02000000 /* HPUX only */
223 +#define O_EXTENTS 04000000 /* create file with extents if possible */
225 #define FASYNC 00020000 /* fcntl, for BSD compatibility */
226 #define O_DIRECT 00040000 /* direct disk access hint - currently ignored */
227 --- linux-2.4.18-chaos/include/asm-ppc/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2003-07-28 17:52:15.000000000 +0400
228 +++ linux-2.4.18-chaos-alexey/include/asm-ppc/fcntl.h 2003-10-08 10:29:30.000000000 +0400
230 #define O_LARGEFILE 0200000
231 #define O_DIRECT 0400000 /* direct disk access hint */
232 #define O_ATOMICLOOKUP 01000000 /* do atomic file lookup */
233 +#define O_EXTENT 02000000 /* create file with extents if possible */
235 #define F_DUPFD 0 /* dup */
236 #define F_GETFD 1 /* get close_on_exec */
237 --- linux-2.4.18-chaos/include/asm-s390/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2003-07-28 17:52:15.000000000 +0400
238 +++ linux-2.4.18-chaos-alexey/include/asm-s390/fcntl.h 2003-10-08 10:29:30.000000000 +0400
240 #define O_DIRECTORY 0200000 /* must be a directory */
241 #define O_NOFOLLOW 0400000 /* don't follow links */
242 #define O_ATOMICLOOKUP 01000000 /* do atomic file lookup */
243 +#define O_EXTENTS 02000000 /* create file with extents if possible */
245 #define F_DUPFD 0 /* dup */
246 #define F_GETFD 1 /* get close_on_exec */
247 --- linux-2.4.18-chaos/include/asm-s390x/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2003-07-28 17:52:15.000000000 +0400
248 +++ linux-2.4.18-chaos-alexey/include/asm-s390x/fcntl.h 2003-10-08 10:29:30.000000000 +0400
250 #define O_DIRECTORY 0200000 /* must be a directory */
251 #define O_NOFOLLOW 0400000 /* don't follow links */
252 #define O_ATOMICLOOKUP 01000000 /* do atomic file lookup */
253 +#define O_EXTENTS 02000000 /* create file with extents if possible */
255 #define F_DUPFD 0 /* dup */
256 #define F_GETFD 1 /* get close_on_exec */
257 --- linux-2.4.18-chaos/include/asm-sh/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2003-07-28 17:52:15.000000000 +0400
258 +++ linux-2.4.18-chaos-alexey/include/asm-sh/fcntl.h 2003-10-08 10:29:30.000000000 +0400
260 #define O_DIRECTORY 0200000 /* must be a directory */
261 #define O_NOFOLLOW 0400000 /* don't follow links */
262 #define O_ATOMICLOOKUP 01000000
263 +#define O_EXTENTS 02000000 /* create file with extents if possible */
265 #define F_DUPFD 0 /* dup */
266 #define F_GETFD 1 /* get close_on_exec */
267 --- linux-2.4.18-chaos/include/asm-sparc64/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2003-07-28 17:52:16.000000000 +0400
268 +++ linux-2.4.18-chaos-alexey/include/asm-sparc64/fcntl.h 2003-10-08 10:29:30.000000000 +0400
270 #define O_LARGEFILE 0x40000
271 #define O_ATOMICLOOKUP 0x80000 /* do atomic file lookup */
272 #define O_DIRECT 0x100000 /* direct disk access hint */
273 +#define O_EXTENTS 0x200000 /* create file with extents if possible */
276 #define F_DUPFD 0 /* dup */
277 --- linux-2.4.18-chaos/include/asm-sparc/fcntl.h~ext3-extents-oflag-2.4.18-chaos 2003-07-28 17:52:16.000000000 +0400
278 +++ linux-2.4.18-chaos-alexey/include/asm-sparc/fcntl.h 2003-10-08 10:29:30.000000000 +0400
280 #define O_LARGEFILE 0x40000
281 #define O_ATOMICLOOKUP 0x80000 /* do atomic file lookup */
282 #define O_DIRECT 0x100000 /* direct disk access hint */
283 +#define O_EXTENTS 0x200000 /* create file with extents if possible */
285 #define F_DUPFD 0 /* dup */
286 #define F_GETFD 1 /* get close_on_exec */
287 --- linux-2.4.18-chaos/include/linux/ext3_fs.h~ext3-extents-oflag-2.4.18-chaos 2003-10-08 10:29:12.000000000 +0400
288 +++ linux-2.4.18-chaos-alexey/include/linux/ext3_fs.h 2003-10-08 10:29:30.000000000 +0400
289 @@ -641,7 +641,7 @@ extern int ext3_sync_file (struct file *
292 extern struct inode * ext3_new_inode (handle_t *, const struct inode *, int,
294 + unsigned long, struct lookup_intent *);
295 extern void ext3_free_inode (handle_t *, struct inode *);
296 extern struct inode * ext3_orphan_get (struct super_block *, unsigned long);
297 extern unsigned long ext3_count_free_inodes (struct super_block *);
298 --- linux-2.4.18-chaos/fs/ext3/inode.c~ext3-extents-oflag-2.4.18-chaos 2003-10-08 10:29:12.000000000 +0400
299 +++ linux-2.4.18-chaos-alexey/fs/ext3/inode.c 2003-10-08 10:29:30.000000000 +0400
300 @@ -2204,7 +2204,7 @@ void ext3_truncate_thread(struct inode *
304 - new_inode = ext3_new_inode(handle, old_inode, old_inode->i_mode, 0);
305 + new_inode = ext3_new_inode(handle, old_inode, old_inode->i_mode, 0, 0);
306 if (IS_ERR(new_inode)) {
307 ext3_debug("truncate inode %lu directly (no new inodes)\n",