3 .old..........pc/vfs_nointent_2.6.0-suse/fs/namei.c
4 .new.........fs/namei.c
5 Index: linux-2.6.4-51.0/fs/namei.c
6 ===================================================================
7 --- linux-2.6.4-51.0.orig/fs/namei.c 2004-04-05 17:36:42.000000000 -0400
8 +++ linux-2.6.4-51.0/fs/namei.c 2004-04-05 17:36:43.000000000 -0400
13 - error = do_truncate(dentry, 0);
14 + error = do_truncate(dentry, 0, 1);
16 put_write_access(inode);
20 struct dentry * dentry;
22 + intent_init(&nd.intent, IT_LOOKUP);
26 @@ -1536,6 +1537,15 @@
27 error = path_lookup(tmp, LOOKUP_PARENT, &nd);
31 + if (nd.dentry->d_inode->i_op->mknod_raw) {
32 + struct inode_operations *op = nd.dentry->d_inode->i_op;
33 + error = op->mknod_raw(&nd, mode, dev);
34 + /* the file system wants to use normal vfs path now */
35 + if (error != -EOPNOTSUPP)
39 dentry = lookup_create(&nd, 0);
40 error = PTR_ERR(dentry);
45 up(&nd.dentry->d_inode->i_sem);
50 @@ -1603,10 +1614,18 @@
52 struct dentry *dentry;
54 + intent_init(&nd.intent, IT_LOOKUP);
56 error = path_lookup(tmp, LOOKUP_PARENT, &nd);
59 + if (nd.dentry->d_inode->i_op->mkdir_raw) {
60 + struct inode_operations *op = nd.dentry->d_inode->i_op;
61 + error = op->mkdir_raw(&nd, mode);
62 + /* the file system wants to use normal vfs path now */
63 + if (error != -EOPNOTSUPP)
66 dentry = lookup_create(&nd, 1);
67 error = PTR_ERR(dentry);
68 if (!IS_ERR(dentry)) {
72 up(&nd.dentry->d_inode->i_sem);
79 struct dentry *dentry;
81 + intent_init(&nd.intent, IT_LOOKUP);
83 name = getname(pathname);
85 @@ -1716,6 +1737,16 @@
90 + if (nd.dentry->d_inode->i_op->rmdir_raw) {
91 + struct inode_operations *op = nd.dentry->d_inode->i_op;
93 + error = op->rmdir_raw(&nd);
94 + /* the file system wants to use normal vfs path now */
95 + if (error != -EOPNOTSUPP)
99 down(&nd.dentry->d_inode->i_sem);
100 dentry = lookup_hash(&nd.last, nd.dentry);
101 error = PTR_ERR(dentry);
102 @@ -1774,6 +1805,7 @@
103 struct dentry *dentry;
105 struct inode *inode = NULL;
106 + intent_init(&nd.intent, IT_LOOKUP);
108 name = getname(pathname);
110 @@ -1785,6 +1817,13 @@
112 if (nd.last_type != LAST_NORM)
114 + if (nd.dentry->d_inode->i_op->unlink_raw) {
115 + struct inode_operations *op = nd.dentry->d_inode->i_op;
116 + error = op->unlink_raw(&nd);
117 + /* the file system wants to use normal vfs path now */
118 + if (error != -EOPNOTSUPP)
121 down(&nd.dentry->d_inode->i_sem);
122 dentry = lookup_hash(&nd.last, nd.dentry);
123 error = PTR_ERR(dentry);
124 @@ -1852,10 +1891,18 @@
126 struct dentry *dentry;
128 + intent_init(&nd.intent, IT_LOOKUP);
130 error = path_lookup(to, LOOKUP_PARENT, &nd);
133 + if (nd.dentry->d_inode->i_op->symlink_raw) {
134 + struct inode_operations *op = nd.dentry->d_inode->i_op;
135 + error = op->symlink_raw(&nd, from);
136 + /* the file system wants to use normal vfs path now */
137 + if (error != -EOPNOTSUPP)
140 dentry = lookup_create(&nd, 0);
141 error = PTR_ERR(dentry);
142 if (!IS_ERR(dentry)) {
143 @@ -1863,6 +1910,7 @@
146 up(&nd.dentry->d_inode->i_sem);
151 @@ -1926,6 +1974,8 @@
152 struct nameidata nd, old_nd;
155 + intent_init(&nd.intent, IT_LOOKUP);
156 + intent_init(&old_nd.intent, IT_LOOKUP);
158 to = getname(newname);
160 @@ -1940,6 +1990,13 @@
162 if (old_nd.mnt != nd.mnt)
164 + if (nd.dentry->d_inode->i_op->link_raw) {
165 + struct inode_operations *op = nd.dentry->d_inode->i_op;
166 + error = op->link_raw(&old_nd, &nd);
167 + /* the file system wants to use normal vfs path now */
168 + if (error != -EOPNOTSUPP)
171 new_dentry = lookup_create(&nd, 0);
172 error = PTR_ERR(new_dentry);
173 if (!IS_ERR(new_dentry)) {
174 @@ -1990,7 +2047,7 @@
177 int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
178 - struct inode *new_dir, struct dentry *new_dentry)
179 + struct inode *new_dir, struct dentry *new_dentry)
182 struct inode *target;
183 @@ -2035,7 +2092,7 @@
186 int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
187 - struct inode *new_dir, struct dentry *new_dentry)
188 + struct inode *new_dir, struct dentry *new_dentry)
190 struct inode *target;
192 @@ -2112,6 +2169,8 @@
193 struct dentry * old_dentry, *new_dentry;
194 struct dentry * trap;
195 struct nameidata oldnd, newnd;
196 + intent_init(&oldnd.intent, IT_LOOKUP);
197 + intent_init(&newnd.intent, IT_LOOKUP);
199 error = path_lookup(oldname, LOOKUP_PARENT, &oldnd);
201 @@ -2134,6 +2193,13 @@
202 if (newnd.last_type != LAST_NORM)
205 + if (old_dir->d_inode->i_op->rename_raw) {
206 + error = old_dir->d_inode->i_op->rename_raw(&oldnd, &newnd);
207 + /* the file system wants to use normal vfs path now */
208 + if (error != -EOPNOTSUPP)
212 trap = lock_rename(new_dir, old_dir);
214 old_dentry = lookup_hash(&oldnd.last, old_dir);
215 @@ -2165,8 +2231,7 @@
216 if (new_dentry == trap)
219 - error = vfs_rename(old_dir->d_inode, old_dentry,
220 - new_dir->d_inode, new_dentry);
221 + error = vfs_rename(old_dir->d_inode, old_dentry, new_dir->d_inode, new_dentry);
225 Index: linux-2.6.4-51.0/fs/open.c
226 ===================================================================
227 --- linux-2.6.4-51.0.orig/fs/open.c 2004-04-05 17:36:42.000000000 -0400
228 +++ linux-2.6.4-51.0/fs/open.c 2004-04-06 01:37:39.000000000 -0400
233 -int do_truncate(struct dentry *dentry, loff_t length)
234 +int do_truncate(struct dentry *dentry, loff_t length, int called_from_open)
237 + struct inode_operations *op = dentry->d_inode->i_op;
238 struct iattr newattrs;
240 /* Not pretty: "inode->i_size" shouldn't really be signed. But it is. */
242 newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
243 down(&dentry->d_inode->i_sem);
244 down_write(&dentry->d_inode->i_alloc_sem);
245 - err = notify_change(dentry, &newattrs);
246 + if (called_from_open)
247 + newattrs.ia_valid |= ATTR_FROM_OPEN;
248 + if (op->setattr_raw) {
249 + newattrs.ia_valid |= ATTR_RAW;
250 + newattrs.ia_ctime = CURRENT_TIME;
251 + err = op->setattr_raw(dentry->d_inode, &newattrs);
253 + err = notify_change(dentry, &newattrs);
254 up_write(&dentry->d_inode->i_alloc_sem);
255 up(&dentry->d_inode->i_sem);
258 error = locks_verify_truncate(inode, NULL, length);
261 - error = do_truncate(nd.dentry, length);
262 + error = do_truncate(nd.dentry, length, 0);
264 put_write_access(inode);
268 error = locks_verify_truncate(inode, file, length);
270 - error = do_truncate(dentry, length);
271 + error = do_truncate(dentry, length, 0);
276 (error = permission(inode,MAY_WRITE,&nd)) != 0)
279 - down(&inode->i_sem);
280 - error = notify_change(nd.dentry, &newattrs);
282 + if (inode->i_op->setattr_raw) {
283 + struct inode_operations *op = nd.dentry->d_inode->i_op;
285 + newattrs.ia_valid |= ATTR_RAW;
286 + error = op->setattr_raw(inode, &newattrs);
287 + /* the file system wants to use normal vfs path now */
288 + if (error != -EOPNOTSUPP)
291 + down(&inode->i_sem);
292 + error = notify_change(nd.dentry, &newattrs);
299 (error = permission(inode,MAY_WRITE,&nd)) != 0)
302 - down(&inode->i_sem);
303 - error = notify_change(nd.dentry, &newattrs);
305 + if (inode->i_op->setattr_raw) {
306 + struct inode_operations *op = nd.dentry->d_inode->i_op;
308 + newattrs.ia_valid |= ATTR_RAW;
309 + error = op->setattr_raw(inode, &newattrs);
310 + /* the file system wants to use normal vfs path now */
311 + if (error != -EOPNOTSUPP)
314 + down(&inode->i_sem);
315 + error = notify_change(nd.dentry, &newattrs);
321 @@ -592,36 +620,52 @@
325 -asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
326 +int chmod_common(struct dentry *dentry, mode_t mode)
328 - struct inode * inode;
329 - struct dentry * dentry;
330 - struct file * file;
332 + struct inode * inode = dentry->d_inode;
333 struct iattr newattrs;
334 + int error = -EROFS;
338 + if (IS_RDONLY(inode))
341 + if (inode->i_op->setattr_raw) {
342 + struct inode_operations *op = dentry->d_inode->i_op;
344 - dentry = file->f_dentry;
345 - inode = dentry->d_inode;
346 + newattrs.ia_mode = mode;
347 + newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
348 + newattrs.ia_valid |= ATTR_RAW;
349 + error = op->setattr_raw(inode, &newattrs);
350 + /* the file system wants to use normal vfs path now */
351 + if (error != -EOPNOTSUPP)
356 - if (IS_RDONLY(inode))
360 if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
365 if (mode == (mode_t) -1)
366 mode = inode->i_mode;
367 newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
368 newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
369 - err = notify_change(dentry, &newattrs);
370 + error = notify_change(dentry, &newattrs);
377 +asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
379 + struct file * file;
386 + err = chmod_common(file->f_dentry, mode);
390 @@ -630,32 +674,13 @@
391 asmlinkage long sys_chmod(const char __user * filename, mode_t mode)
394 - struct inode * inode;
396 - struct iattr newattrs;
398 error = user_path_walk(filename, &nd);
401 - inode = nd.dentry->d_inode;
404 - if (IS_RDONLY(inode))
408 - if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
411 - down(&inode->i_sem);
412 - if (mode == (mode_t) -1)
413 - mode = inode->i_mode;
414 - newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
415 - newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
416 - error = notify_change(nd.dentry, &newattrs);
420 + error = chmod_common(nd.dentry, mode);
425 if (IS_RDONLY(inode))
428 + if (inode->i_op->setattr_raw) {
429 + struct inode_operations *op = dentry->d_inode->i_op;
431 + newattrs.ia_uid = user;
432 + newattrs.ia_gid = group;
433 + newattrs.ia_valid = ATTR_UID | ATTR_GID;
434 + newattrs.ia_valid |= ATTR_RAW;
435 + error = op->setattr_raw(inode, &newattrs);
436 + /* the file system wants to use normal vfs path now */
437 + if (error != -EOPNOTSUPP)
440 if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
442 newattrs.ia_valid = ATTR_CTIME;
445 if (!S_ISDIR(inode->i_mode))
446 newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID;
449 error = notify_change(dentry, &newattrs);
451 Index: linux-2.6.4-51.0/fs/exec.c
452 ===================================================================
453 --- linux-2.6.4-51.0.orig/fs/exec.c 2004-04-05 17:36:42.000000000 -0400
454 +++ linux-2.6.4-51.0/fs/exec.c 2004-04-05 17:36:43.000000000 -0400
455 @@ -1418,7 +1418,7 @@
457 if (!file->f_op->write)
459 - if (do_truncate(file->f_dentry, 0) != 0)
460 + if (do_truncate(file->f_dentry, 0, 0) != 0)
463 retval = binfmt->core_dump(signr, regs, file);
464 Index: linux-2.6.4-51.0/include/linux/fs.h
465 ===================================================================
466 --- linux-2.6.4-51.0.orig/include/linux/fs.h 2004-04-05 17:36:43.000000000 -0400
467 +++ linux-2.6.4-51.0/include/linux/fs.h 2004-04-05 17:36:43.000000000 -0400
468 @@ -866,13 +866,20 @@
469 int (*create) (struct inode *,struct dentry *,int, struct nameidata *);
470 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
471 int (*link) (struct dentry *,struct inode *,struct dentry *);
472 + int (*link_raw) (struct nameidata *,struct nameidata *);
473 int (*unlink) (struct inode *,struct dentry *);
474 + int (*unlink_raw) (struct nameidata *);
475 int (*symlink) (struct inode *,struct dentry *,const char *);
476 + int (*symlink_raw) (struct nameidata *,const char *);
477 int (*mkdir) (struct inode *,struct dentry *,int);
478 + int (*mkdir_raw) (struct nameidata *,int);
479 int (*rmdir) (struct inode *,struct dentry *);
480 + int (*rmdir_raw) (struct nameidata *);
481 int (*mknod) (struct inode *,struct dentry *,int,dev_t);
482 + int (*mknod_raw) (struct nameidata *,int,dev_t);
483 int (*rename) (struct inode *, struct dentry *,
484 struct inode *, struct dentry *);
485 + int (*rename_raw) (struct nameidata *, struct nameidata *);
486 int (*readlink) (struct dentry *, char __user *,int);
487 int (*follow_link) (struct dentry *, struct nameidata *);
488 void (*truncate) (struct inode *);
489 @@ -1169,7 +1176,7 @@
493 -extern int do_truncate(struct dentry *, loff_t start);
494 +extern int do_truncate(struct dentry *, loff_t start, int called_from_open);
495 extern struct file *filp_open(const char *, int, int);
496 extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
497 extern struct file * dentry_open_it(struct dentry *, struct vfsmount *, int, struct lookup_intent *);
498 Index: linux-2.6.4-51.0/net/unix/af_unix.c
499 ===================================================================
500 --- linux-2.6.4-51.0.orig/net/unix/af_unix.c 2004-04-05 12:42:07.000000000 -0400
501 +++ linux-2.6.4-51.0/net/unix/af_unix.c 2004-04-05 17:36:43.000000000 -0400
505 if (sunname->sun_path[0]) {
506 + intent_init(&nd.intent, IT_LOOKUP);
507 err = path_lookup(sunname->sun_path, LOOKUP_FOLLOW, &nd);