3 .old..........pc/vfs_nointent_2.6.0-suse/fs/namei.c
4 .new.........fs/namei.c
5 Index: linux-2.6.5-12.1/fs/namei.c
6 ===================================================================
7 --- linux-2.6.5-12.1.orig/fs/namei.c 2004-05-11 15:41:54.000000000 -0400
8 +++ linux-2.6.5-12.1/fs/namei.c 2004-05-11 15:42:00.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 @@ -1554,6 +1555,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 @@ -1626,10 +1637,20 @@
52 struct dentry *dentry;
54 + intent_init(&nd.intent, IT_LOOKUP);
56 error = path_lookup(tmp, LOOKUP_PARENT, &nd);
60 + if (nd.dentry->d_inode->i_op->mkdir_raw) {
61 + struct inode_operations *op = nd.dentry->d_inode->i_op;
62 + error = op->mkdir_raw(&nd, mode);
63 + /* the file system wants to use normal vfs path now */
64 + if (error != -EOPNOTSUPP)
68 dentry = lookup_create(&nd, 1);
69 error = PTR_ERR(dentry);
70 if (!IS_ERR(dentry)) {
74 up(&nd.dentry->d_inode->i_sem);
81 struct dentry *dentry;
83 + intent_init(&nd.intent, IT_LOOKUP);
85 name = getname(pathname);
87 @@ -1744,6 +1765,16 @@
92 + if (nd.dentry->d_inode->i_op->rmdir_raw) {
93 + struct inode_operations *op = nd.dentry->d_inode->i_op;
95 + error = op->rmdir_raw(&nd);
96 + /* the file system wants to use normal vfs path now */
97 + if (error != -EOPNOTSUPP)
101 down(&nd.dentry->d_inode->i_sem);
102 dentry = lookup_hash(&nd.last, nd.dentry);
103 error = PTR_ERR(dentry);
104 @@ -1805,6 +1834,7 @@
105 struct dentry *dentry;
107 struct inode *inode = NULL;
108 + intent_init(&nd.intent, IT_LOOKUP);
110 name = getname(pathname);
112 @@ -1818,6 +1848,13 @@
114 if (nd.last_type != LAST_NORM)
116 + if (nd.dentry->d_inode->i_op->unlink_raw) {
117 + struct inode_operations *op = nd.dentry->d_inode->i_op;
118 + error = op->unlink_raw(&nd);
119 + /* the file system wants to use normal vfs path now */
120 + if (error != -EOPNOTSUPP)
123 down(&nd.dentry->d_inode->i_sem);
124 dentry = lookup_hash(&nd.last, nd.dentry);
125 error = PTR_ERR(dentry);
126 @@ -1891,10 +1928,18 @@
128 struct dentry *dentry;
130 + intent_init(&nd.intent, IT_LOOKUP);
132 error = path_lookup(to, LOOKUP_PARENT, &nd);
135 + if (nd.dentry->d_inode->i_op->symlink_raw) {
136 + struct inode_operations *op = nd.dentry->d_inode->i_op;
137 + error = op->symlink_raw(&nd, from);
138 + /* the file system wants to use normal vfs path now */
139 + if (error != -EOPNOTSUPP)
142 dentry = lookup_create(&nd, 0);
143 error = PTR_ERR(dentry);
144 if (!IS_ERR(dentry)) {
145 @@ -1902,6 +1947,7 @@
148 up(&nd.dentry->d_inode->i_sem);
153 @@ -1968,6 +2014,8 @@
154 struct nameidata nd, old_nd;
157 + intent_init(&nd.intent, IT_LOOKUP);
158 + intent_init(&old_nd.intent, IT_LOOKUP);
160 to = getname(newname);
162 @@ -1986,6 +2034,13 @@
164 if (old_nd.mnt != nd.mnt)
166 + if (nd.dentry->d_inode->i_op->link_raw) {
167 + struct inode_operations *op = nd.dentry->d_inode->i_op;
168 + error = op->link_raw(&old_nd, &nd);
169 + /* the file system wants to use normal vfs path now */
170 + if (error != -EOPNOTSUPP)
173 new_dentry = lookup_create(&nd, 0);
174 error = PTR_ERR(new_dentry);
175 if (!IS_ERR(new_dentry)) {
176 @@ -2160,6 +2215,8 @@
177 struct dentry * old_dentry, *new_dentry;
178 struct dentry * trap;
179 struct nameidata oldnd, newnd;
180 + intent_init(&oldnd.intent, IT_LOOKUP);
181 + intent_init(&newnd.intent, IT_LOOKUP);
183 error = path_lookup(oldname, LOOKUP_PARENT, &oldnd);
185 @@ -2182,6 +2239,13 @@
186 if (newnd.last_type != LAST_NORM)
189 + if (old_dir->d_inode->i_op->rename_raw) {
190 + error = old_dir->d_inode->i_op->rename_raw(&oldnd, &newnd);
191 + /* the file system wants to use normal vfs path now */
192 + if (error != -EOPNOTSUPP)
196 trap = lock_rename(new_dir, old_dir);
198 old_dentry = lookup_hash(&oldnd.last, old_dir);
199 @@ -2213,8 +2277,7 @@
200 if (new_dentry == trap)
203 - error = vfs_rename(old_dir->d_inode, old_dentry,
204 - new_dir->d_inode, new_dentry);
205 + error = vfs_rename(old_dir->d_inode, old_dentry, new_dir->d_inode, new_dentry);
209 Index: linux-2.6.5-12.1/fs/open.c
210 ===================================================================
211 --- linux-2.6.5-12.1.orig/fs/open.c 2004-05-11 15:41:54.000000000 -0400
212 +++ linux-2.6.5-12.1/fs/open.c 2004-05-11 16:07:02.000000000 -0400
217 -int do_truncate(struct dentry *dentry, loff_t length)
218 +int do_truncate(struct dentry *dentry, loff_t length, int called_from_open)
221 + struct inode_operations *op = dentry->d_inode->i_op;
222 struct iattr newattrs;
224 /* Not pretty: "inode->i_size" shouldn't really be signed. But it is. */
226 newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
227 down(&dentry->d_inode->i_sem);
228 down_write(&dentry->d_inode->i_alloc_sem);
229 - err = notify_change(dentry, &newattrs);
230 + if (called_from_open)
231 + newattrs.ia_valid |= ATTR_FROM_OPEN;
232 + if (op->setattr_raw) {
233 + newattrs.ia_valid |= ATTR_RAW;
234 + newattrs.ia_ctime = CURRENT_TIME;
235 + err = op->setattr_raw(dentry->d_inode, &newattrs);
237 + err = notify_change(dentry, &newattrs);
238 up_write(&dentry->d_inode->i_alloc_sem);
239 up(&dentry->d_inode->i_sem);
242 error = locks_verify_truncate(inode, NULL, length);
245 - error = do_truncate(nd.dentry, length);
246 + error = do_truncate(nd.dentry, length, 0);
248 put_write_access(inode);
252 error = locks_verify_truncate(inode, file, length);
254 - error = do_truncate(dentry, length);
255 + error = do_truncate(dentry, length, 0);
260 (error = permission(inode,MAY_WRITE,&nd)) != 0)
263 - down(&inode->i_sem);
264 - error = notify_change(nd.dentry, &newattrs);
266 + if (inode->i_op->setattr_raw) {
267 + struct inode_operations *op = nd.dentry->d_inode->i_op;
269 + newattrs.ia_valid |= ATTR_RAW;
270 + error = op->setattr_raw(inode, &newattrs);
271 + /* the file system wants to use normal vfs path now */
272 + if (error != -EOPNOTSUPP)
275 + down(&inode->i_sem);
276 + error = notify_change(nd.dentry, &newattrs);
282 @@ -613,39 +631,55 @@
286 -asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
287 +int chmod_common(struct dentry *dentry, mode_t mode)
289 - struct inode * inode;
290 - struct dentry * dentry;
291 - struct file * file;
293 + struct inode * inode = dentry->d_inode;
294 struct iattr newattrs;
295 + int error = -EROFS;
297 - FSHOOK_BEGIN(fchmod, err, .fd = fd, .mode = mode)
302 + if (IS_RDONLY(inode))
305 + if (inode->i_op->setattr_raw) {
306 + struct inode_operations *op = dentry->d_inode->i_op;
308 + newattrs.ia_mode = mode;
309 + newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
310 + newattrs.ia_valid |= ATTR_RAW;
311 + error = op->setattr_raw(inode, &newattrs);
312 + /* the file system wants to use the normal vfs path now */
313 + if (error != -EOPNOTSUPP)
317 - dentry = file->f_dentry;
318 - inode = dentry->d_inode;
321 - if (IS_RDONLY(inode))
325 if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
330 if (mode == (mode_t) -1)
331 mode = inode->i_mode;
332 newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
333 newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
334 - err = notify_change(dentry, &newattrs);
335 + error = notify_change(dentry, &newattrs);
343 +asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
345 + struct file * file;
348 + FSHOOK_BEGIN(fchmod, err, .fd = fd, .mode = mode)
354 + err = chmod_common(file->f_dentry, mode);
359 asmlinkage long sys_chmod(const char __user * filename, mode_t mode)
362 - struct inode * inode;
364 - struct iattr newattrs;
366 FSHOOK_BEGIN_USER_PATH_WALK(chmod,
372 - inode = nd.dentry->d_inode;
375 - if (IS_RDONLY(inode))
379 - if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
382 - down(&inode->i_sem);
383 - if (mode == (mode_t) -1)
384 - mode = inode->i_mode;
385 - newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
386 - newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
387 - error = notify_change(nd.dentry, &newattrs);
391 + error = chmod_common(nd.dentry, mode);
394 FSHOOK_END_USER_WALK(chmod, error, path)
396 if (IS_RDONLY(inode))
399 + if (inode->i_op->setattr_raw) {
400 + struct inode_operations *op = dentry->d_inode->i_op;
402 + newattrs.ia_uid = user;
403 + newattrs.ia_gid = group;
404 + newattrs.ia_valid = ATTR_UID | ATTR_GID | ATTR_CTIME;
405 + newattrs.ia_valid |= ATTR_RAW;
406 + error = op->setattr_raw(inode, &newattrs);
407 + /* the file system wants to use normal vfs path now */
408 + if (error != -EOPNOTSUPP)
411 if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
413 newattrs.ia_valid = ATTR_CTIME;
414 Index: linux-2.6.5-12.1/fs/exec.c
415 ===================================================================
416 --- linux-2.6.5-12.1.orig/fs/exec.c 2004-05-11 15:41:54.000000000 -0400
417 +++ linux-2.6.5-12.1/fs/exec.c 2004-05-11 15:42:00.000000000 -0400
418 @@ -1435,7 +1435,7 @@
420 if (!file->f_op->write)
422 - if (do_truncate(file->f_dentry, 0) != 0)
423 + if (do_truncate(file->f_dentry, 0, 0) != 0)
426 retval = binfmt->core_dump(signr, regs, file);
427 Index: linux-2.6.5-12.1/include/linux/fs.h
428 ===================================================================
429 --- linux-2.6.5-12.1.orig/include/linux/fs.h 2004-05-11 15:41:54.000000000 -0400
430 +++ linux-2.6.5-12.1/include/linux/fs.h 2004-05-11 15:42:00.000000000 -0400
431 @@ -878,13 +878,20 @@
432 int (*create) (struct inode *,struct dentry *,int, struct nameidata *);
433 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
434 int (*link) (struct dentry *,struct inode *,struct dentry *);
435 + int (*link_raw) (struct nameidata *,struct nameidata *);
436 int (*unlink) (struct inode *,struct dentry *);
437 + int (*unlink_raw) (struct nameidata *);
438 int (*symlink) (struct inode *,struct dentry *,const char *);
439 + int (*symlink_raw) (struct nameidata *,const char *);
440 int (*mkdir) (struct inode *,struct dentry *,int);
441 + int (*mkdir_raw) (struct nameidata *,int);
442 int (*rmdir) (struct inode *,struct dentry *);
443 + int (*rmdir_raw) (struct nameidata *);
444 int (*mknod) (struct inode *,struct dentry *,int,dev_t);
445 + int (*mknod_raw) (struct nameidata *,int,dev_t);
446 int (*rename) (struct inode *, struct dentry *,
447 struct inode *, struct dentry *);
448 + int (*rename_raw) (struct nameidata *, struct nameidata *);
449 int (*readlink) (struct dentry *, char __user *,int);
450 int (*follow_link) (struct dentry *, struct nameidata *);
451 void (*truncate) (struct inode *);
452 @@ -1182,7 +1189,7 @@
456 -extern int do_truncate(struct dentry *, loff_t start);
457 +extern int do_truncate(struct dentry *, loff_t start, int called_from_open);
458 extern struct file *filp_open(const char *, int, int);
459 extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
460 extern struct file * dentry_open_it(struct dentry *, struct vfsmount *, int, struct lookup_intent *);
461 Index: linux-2.6.5-12.1/net/unix/af_unix.c
462 ===================================================================
463 --- linux-2.6.5-12.1.orig/net/unix/af_unix.c 2004-04-03 22:37:36.000000000 -0500
464 +++ linux-2.6.5-12.1/net/unix/af_unix.c 2004-05-11 15:42:00.000000000 -0400
468 if (sunname->sun_path[0]) {
469 + intent_init(&nd.intent, IT_LOOKUP);
470 err = path_lookup(sunname->sun_path, LOOKUP_FOLLOW, &nd);