1 diff -rup RH_2_6_9_55.orig/fs/cifs/dir.c RH_2_6_9_55/fs/cifs/dir.c
2 --- RH_2_6_9_55.orig/fs/cifs/dir.c
3 +++ RH_2_6_9_55/fs/cifs/dir.c
4 @@ -157,11 +157,7 @@ cifs_create(struct inode *inode, struct
6 #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0)
7 if(nd && (nd->flags & LOOKUP_OPEN)) {
8 -#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,5) /* SUSE included Lustre patch */
9 int oflags = nd->intent.it_flags;
11 - int oflags = nd->intent.open.flags;
15 if (oflags & FMODE_READ)
16 diff -rup RH_2_6_9_55.orig/fs/exec.c RH_2_6_9_55/fs/exec.c
17 --- RH_2_6_9_55.orig/fs/exec.c
18 +++ RH_2_6_9_55/fs/exec.c
19 @@ -126,9 +126,10 @@ asmlinkage long sys_uselib(const char __
24 - nd.intent.open.flags = FMODE_READ|FMODE_EXEC;
25 - error = __user_walk(library, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
26 + intent_init(&nd.intent, IT_OPEN);
28 + nd.intent.it_flags = FMODE_READ|FMODE_EXEC;
29 + error = __user_walk_it(library, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
33 @@ -140,7 +141,7 @@ asmlinkage long sys_uselib(const char __
37 - file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
38 + file = dentry_open_it(nd.dentry, nd.mnt, O_RDONLY, &nd.intent);
39 error = PTR_ERR(file);
42 @@ -489,8 +490,9 @@ struct file *open_exec(const char *name)
46 - nd.intent.open.flags = FMODE_READ|FMODE_EXEC;
47 - err = path_lookup(name, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
48 + intent_init(&nd.intent, IT_OPEN);
49 + nd.intent.it_flags = FMODE_READ|FMODE_EXEC;
50 + err = path_lookup_it(name, LOOKUP_FOLLOW, &nd);
54 @@ -501,7 +503,7 @@ struct file *open_exec(const char *name)
55 int err = permission(inode, MAY_EXEC, &nd);
58 - file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
59 + file = dentry_open_it(nd.dentry, nd.mnt, O_RDONLY, &nd.intent);
61 err = deny_write_access(file);
63 diff -rup RH_2_6_9_55.orig/fs/inode.c RH_2_6_9_55/fs/inode.c
64 --- RH_2_6_9_55.orig/fs/inode.c
65 +++ RH_2_6_9_55/fs/inode.c
66 @@ -235,6 +235,7 @@ void __iget(struct inode * inode)
67 inodes_stat.nr_unused--;
70 +EXPORT_SYMBOL(__iget);
72 * clear_inode - clear an inode
73 * @inode: inode to clear
74 diff -rup RH_2_6_9_55.orig/fs/namei.c RH_2_6_9_55/fs/namei.c
75 --- RH_2_6_9_55.orig/fs/namei.c
76 +++ RH_2_6_9_55/fs/namei.c
77 @@ -282,8 +282,19 @@ int deny_write_access(struct file * file
81 +void intent_release(struct lookup_intent *it)
85 + if (it->it_magic != INTENT_MAGIC)
87 + if (it->it_op_release)
88 + it->it_op_release(it);
91 void path_release(struct nameidata *nd)
93 + intent_release(&nd->intent);
97 @@ -395,8 +406,12 @@ static struct dentry * real_lookup(struc
99 struct dentry * result;
100 struct inode *dir = parent->d_inode;
109 * First re-do the cached lookup just in case it was created
110 * while we waited for the directory semaphore..
111 @@ -433,8 +448,12 @@ static struct dentry * real_lookup(struc
113 if (result->d_op && result->d_op->d_revalidate) {
114 result = do_revalidate(result, nd);
116 - result = ERR_PTR(-ENOENT);
119 + result = ERR_PTR(-ESTALE);
120 + if (!IS_ERR(result))
126 @@ -464,6 +483,7 @@ static inline int __vfs_follow_link(stru
134 @@ -473,6 +493,7 @@ static inline int __vfs_follow_link(stru
135 /* weird __emul_prefix() stuff did it */
138 + intent_reset_fs_part(&nd->intent);
139 res = link_path_walk(link, nd);
141 if (nd->depth || res || nd->last_type!=LAST_NORM)
142 @@ -681,6 +702,33 @@ fail:
143 return PTR_ERR(dentry);
146 +static int revalidate_special(struct nameidata *nd)
148 + struct dentry *dentry = nd->dentry;
149 + int err, counter = 0;
152 + if (!dentry->d_op || !dentry->d_op->d_revalidate)
154 + if (!dentry->d_op->d_revalidate(dentry, nd)) {
155 + struct dentry *new;
156 + if ((err = permission(dentry->d_parent->d_inode, MAY_EXEC, nd)))
158 + new = real_lookup(dentry->d_parent, &dentry->d_name, nd);
160 + return PTR_ERR(new);
161 + d_invalidate(dentry);
163 + nd->dentry = dentry = new;
166 + goto revalidate_again;
167 + //printk("excessive revalidate_it loops\n");
175 * This is the basic name resolution function, turning a pathname into
176 @@ -782,13 +830,17 @@ static fastcall int __link_path_walk(con
179 if (inode->i_op->follow_link) {
180 + int save_flags = nd->flags;
182 if (next.mnt != nd->mnt) {
185 nd->dentry = dget(next.dentry);
187 + nd->flags |= LOOKUP_LINK_NOTLAST;
188 err = do_follow_link(next.dentry, nd);
189 + if (!(save_flags & LOOKUP_LINK_NOTLAST))
190 + nd->flags &= ~LOOKUP_LINK_NOTLAST;
194 @@ -828,14 +880,34 @@ last_component:
195 inode = nd->dentry->d_inode;
198 + nd->flags |= LOOKUP_LAST;
199 + err = revalidate_special(nd);
200 + nd->flags &= ~LOOKUP_LAST;
201 + if (!nd->dentry->d_inode)
207 + if (lookup_flags & LOOKUP_DIRECTORY) {
209 + if (!nd->dentry->d_inode->i_op ||
210 + !nd->dentry->d_inode->i_op->lookup){
218 if (nd->dentry->d_op && nd->dentry->d_op->d_hash) {
219 err = nd->dentry->d_op->d_hash(nd->dentry, &this);
223 + nd->flags |= LOOKUP_LAST;
224 err = do_lookup(nd, &this, &next, atomic);
225 + nd->flags &= ~LOOKUP_LAST;
228 follow_mount(&next.mnt, &next.dentry);
229 @@ -1007,7 +1079,7 @@ set_it:
232 /* Returns 0 and nd will be valid on success; Retuns error, otherwise. */
233 -int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata *nd)
234 +int fastcall path_lookup_it(const char *name, unsigned int flags, struct nameidata *nd)
238 @@ -1041,6 +1113,12 @@ out:
242 +int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata *nd)
244 + intent_init(&nd->intent, IT_GETATTR);
245 + return path_lookup_it(name, flags, nd);
249 * Restricted form of lookup. Doesn't follow links, single-component only,
250 * needs parent already locked. Doesn't follow mounts.
251 @@ -1091,7 +1169,7 @@ struct dentry * lookup_hash(struct qstr
255 -struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
256 +struct dentry * lookup_one_len_it(const char * name, struct dentry * base, int len, struct nameidata *nd)
260 @@ -1111,11 +1189,16 @@ struct dentry * lookup_one_len(const cha
262 this.hash = end_name_hash(hash);
264 - return lookup_hash(&this, base);
265 + return __lookup_hash(&this, base, nd);
267 return ERR_PTR(-EACCES);
270 +struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
272 + return lookup_one_len_it(name, base, len, NULL);
278 @@ -1127,18 +1210,24 @@ access:
279 * that namei follows links, while lnamei does not.
282 -int fastcall __user_walk(const char __user *name, unsigned flags, struct nameidata *nd)
283 +int fastcall __user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd)
285 char *tmp = getname(name);
286 int err = PTR_ERR(tmp);
289 - err = path_lookup(tmp, flags, nd);
290 + err = path_lookup_it(tmp, flags, nd);
296 +int fastcall __user_walk(const char __user *name, unsigned flags, struct nameidata *nd)
298 + intent_init(&nd->intent, IT_LOOKUP);
299 + return __user_walk_it(name, flags, nd);
303 * It's inline, so penalty for filesystems that don't use sticky bit is
305 @@ -1384,7 +1473,7 @@ int may_open(struct nameidata *nd, int a
309 - error = do_truncate(dentry, 0, ATTR_MTIME|ATTR_CTIME);
310 + error = do_truncate(dentry, 0, ATTR_MTIME|ATTR_CTIME|ATTR_FROM_OPEN);
312 put_write_access(inode);
314 @@ -1425,14 +1514,14 @@ int open_namei(const char * pathname, in
315 acc_mode |= MAY_APPEND;
317 /* Fill in the open() intent data */
318 - nd->intent.open.flags = flag;
319 - nd->intent.open.create_mode = mode;
320 + nd->intent.it_flags = flag;
321 + nd->intent.it_create_mode = mode;
324 * The simplest case - just a plain lookup.
326 if (!(flag & O_CREAT)) {
327 - error = path_lookup(pathname, lookup_flags(flag)|LOOKUP_OPEN, nd);
328 + error = path_lookup_it(pathname, lookup_flags(flag)|LOOKUP_OPEN, nd);
332 @@ -1441,7 +1530,8 @@ int open_namei(const char * pathname, in
334 * Create - we need to know the parent.
336 - error = path_lookup(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd);
337 + nd->intent.it_op |= IT_CREAT;
338 + error = path_lookup_it(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd);
342 @@ -1457,7 +1547,9 @@ int open_namei(const char * pathname, in
344 nd->flags &= ~LOOKUP_PARENT;
345 down(&dir->d_inode->i_sem);
346 + nd->flags |= LOOKUP_LAST;
347 dentry = __lookup_hash(&nd->last, nd->dentry, nd);
348 + nd->flags &= ~LOOKUP_LAST;
351 error = PTR_ERR(dentry);
352 @@ -1570,7 +1662,9 @@ do_link:
355 down(&dir->d_inode->i_sem);
356 + nd->flags |= LOOKUP_LAST;
357 dentry = __lookup_hash(&nd->last, nd->dentry, nd);
358 + nd->flags &= ~LOOKUP_LAST;
359 __putname(nd->last.name);
362 @@ -1644,10 +1738,20 @@ asmlinkage long sys_mknod(const char __u
363 tmp = getname(filename);
367 - error = path_lookup(tmp, LOOKUP_PARENT, &nd);
369 + intent_init(&nd.intent, IT_LOOKUP);
370 + error = path_lookup_it(tmp, LOOKUP_PARENT, &nd);
374 + if (nd.dentry->d_inode->i_op->mknod_raw) {
375 + struct inode_operations *op = nd.dentry->d_inode->i_op;
376 + error = op->mknod_raw(&nd, mode, dev);
377 + /* the file system wants to use normal vfs path now */
378 + if (error != -EOPNOTSUPP)
382 dentry = lookup_create(&nd, 0);
383 error = PTR_ERR(dentry);
385 @@ -1674,6 +1778,7 @@ asmlinkage long sys_mknod(const char __u
388 up(&nd.dentry->d_inode->i_sem);
393 @@ -1716,10 +1821,20 @@ asmlinkage long sys_mkdir(const char __u
395 struct dentry *dentry;
397 + intent_init(&nd.intent, IT_LOOKUP);
399 - error = path_lookup(tmp, LOOKUP_PARENT, &nd);
400 + error = path_lookup_it(tmp, LOOKUP_PARENT, &nd);
404 + if (nd.dentry->d_inode->i_op->mkdir_raw) {
405 + struct inode_operations *op = nd.dentry->d_inode->i_op;
406 + error = op->mkdir_raw(&nd, mode);
407 + /* the file system wants to use normal vfs path now */
408 + if (error != -EOPNOTSUPP)
412 dentry = lookup_create(&nd, 1);
413 error = PTR_ERR(dentry);
414 if (!IS_ERR(dentry)) {
415 @@ -1729,6 +1844,7 @@ asmlinkage long sys_mkdir(const char __u
418 up(&nd.dentry->d_inode->i_sem);
423 @@ -1814,7 +1930,8 @@ asmlinkage long sys_rmdir(const char __u
425 return PTR_ERR(name);
427 - error = path_lookup(name, LOOKUP_PARENT, &nd);
428 + intent_init(&nd.intent, IT_LOOKUP);
429 + error = path_lookup_it(name, LOOKUP_PARENT, &nd);
433 @@ -1829,6 +1946,16 @@ asmlinkage long sys_rmdir(const char __u
438 + if (nd.dentry->d_inode->i_op->rmdir_raw) {
439 + struct inode_operations *op = nd.dentry->d_inode->i_op;
441 + error = op->rmdir_raw(&nd);
442 + /* the file system wants to use normal vfs path now */
443 + if (error != -EOPNOTSUPP)
447 down(&nd.dentry->d_inode->i_sem);
448 dentry = lookup_hash(&nd.last, nd.dentry);
449 error = PTR_ERR(dentry);
450 @@ -1892,12 +2019,22 @@ asmlinkage long sys_unlink(const char __
452 return PTR_ERR(name);
454 - error = path_lookup(name, LOOKUP_PARENT, &nd);
455 + intent_init(&nd.intent, IT_LOOKUP);
456 + error = path_lookup_it(name, LOOKUP_PARENT, &nd);
460 if (nd.last_type != LAST_NORM)
463 + if (nd.dentry->d_inode->i_op->unlink_raw) {
464 + struct inode_operations *op = nd.dentry->d_inode->i_op;
465 + error = op->unlink_raw(&nd);
466 + /* the file system wants to use normal vfs path now */
467 + if (error != -EOPNOTSUPP)
471 down(&nd.dentry->d_inode->i_sem);
472 dentry = lookup_hash(&nd.last, nd.dentry);
473 error = PTR_ERR(dentry);
474 @@ -1965,10 +2102,20 @@ asmlinkage long sys_symlink(const char _
476 struct dentry *dentry;
478 + intent_init(&nd.intent, IT_LOOKUP);
480 - error = path_lookup(to, LOOKUP_PARENT, &nd);
481 + error = path_lookup_it(to, LOOKUP_PARENT, &nd);
485 + if (nd.dentry->d_inode->i_op->symlink_raw) {
486 + struct inode_operations *op = nd.dentry->d_inode->i_op;
487 + error = op->symlink_raw(&nd, from);
488 + /* the file system wants to use normal vfs path now */
489 + if (error != -EOPNOTSUPP)
493 dentry = lookup_create(&nd, 0);
494 error = PTR_ERR(dentry);
495 if (!IS_ERR(dentry)) {
496 @@ -1976,6 +2123,7 @@ asmlinkage long sys_symlink(const char _
499 up(&nd.dentry->d_inode->i_sem);
504 @@ -2045,15 +2193,26 @@ asmlinkage long sys_link(const char __us
508 - error = __user_walk(oldname, 0, &old_nd);
509 + intent_init(&old_nd.intent, IT_LOOKUP);
510 + error = __user_walk_it(oldname, 0, &old_nd);
513 - error = path_lookup(to, LOOKUP_PARENT, &nd);
515 + intent_init(&nd.intent, IT_LOOKUP);
516 + error = path_lookup_it(to, LOOKUP_PARENT, &nd);
520 if (old_nd.mnt != nd.mnt)
522 + if (nd.dentry->d_inode->i_op->link_raw) {
523 + struct inode_operations *op = nd.dentry->d_inode->i_op;
524 + error = op->link_raw(&old_nd, &nd);
525 + /* the file system wants to use normal vfs path now */
526 + if (error != -EOPNOTSUPP)
530 new_dentry = lookup_create(&nd, 0);
531 error = PTR_ERR(new_dentry);
532 if (!IS_ERR(new_dentry)) {
533 @@ -2229,11 +2388,13 @@ static inline int do_rename(const char *
534 struct dentry * trap;
535 struct nameidata oldnd, newnd;
537 - error = path_lookup(oldname, LOOKUP_PARENT, &oldnd);
538 + intent_init(&oldnd.intent, IT_LOOKUP);
539 + error = path_lookup_it(oldname, LOOKUP_PARENT, &oldnd);
543 - error = path_lookup(newname, LOOKUP_PARENT, &newnd);
544 + intent_init(&newnd.intent, IT_LOOKUP);
545 + error = path_lookup_it(newname, LOOKUP_PARENT, &newnd);
549 @@ -2250,6 +2411,13 @@ static inline int do_rename(const char *
550 if (newnd.last_type != LAST_NORM)
553 + if (old_dir->d_inode->i_op->rename_raw) {
554 + error = old_dir->d_inode->i_op->rename_raw(&oldnd, &newnd);
555 + /* the file system wants to use normal vfs path now */
556 + if (error != -EOPNOTSUPP)
560 trap = lock_rename(new_dir, old_dir);
562 old_dentry = lookup_hash(&oldnd.last, old_dir);
563 @@ -2281,8 +2449,7 @@ static inline int do_rename(const char *
564 if (new_dentry == trap)
567 - error = vfs_rename(old_dir->d_inode, old_dentry,
568 - new_dir->d_inode, new_dentry);
569 + error = vfs_rename(old_dir->d_inode, old_dentry, new_dir->d_inode, new_dentry);
573 @@ -2473,6 +2640,7 @@ EXPORT_SYMBOL(page_readlink);
574 EXPORT_SYMBOL(page_symlink);
575 EXPORT_SYMBOL(page_symlink_inode_operations);
576 EXPORT_SYMBOL(path_lookup);
577 +EXPORT_SYMBOL(path_lookup_it);
578 EXPORT_SYMBOL(path_release);
579 EXPORT_SYMBOL(path_walk);
580 EXPORT_SYMBOL(permission);
581 diff -urNp RH_2_6_9_42_0_3.orig/fs/namespace.c RH_2_6_9_42_0_3/fs/namespace.c
582 --- RH_2_6_9_42_0_3.orig/fs/namespace.c
583 +++ RH_2_6_9_42_0_3/fs/namespace.c
584 @@ -114,6 +115,7 @@ static inline int check_mnt(struct vfsmo
586 static void detach_mnt(struct vfsmount *mnt, struct nameidata *old_nd)
588 + memset(old_nd, 0, sizeof(*old_nd));
589 old_nd->dentry = mnt->mnt_mountpoint;
590 old_nd->mnt = mnt->mnt_parent;
591 mnt->mnt_parent = mnt;
592 @@ -441,6 +442,8 @@ static int do_umount(struct vfsmount *mn
596 + if (sb->s_op->umount_lustre)
597 + sb->s_op->umount_lustre(sb);
598 if( (flags&MNT_FORCE) && sb->s_op->umount_begin)
599 sb->s_op->umount_begin(sb);
601 @@ -665,7 +668,8 @@ static int do_loopback(struct nameidata
603 if (!old_name || !*old_name)
605 - err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
606 + intent_init(&old_nd.intent, IT_LOOKUP);
607 + err = path_lookup_it(old_name, LOOKUP_FOLLOW, &old_nd);
611 @@ -739,7 +743,8 @@ static int do_move_mount(struct nameidat
613 if (!old_name || !*old_name)
615 - err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
616 + intent_init(&old_nd.intent, IT_LOOKUP);
617 + err = path_lookup_it(old_name, LOOKUP_FOLLOW, &old_nd);
621 @@ -1074,7 +1079,8 @@ long do_mount(char * dev_name, char * di
622 flags &= ~(MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_ACTIVE);
624 /* ... and get the mountpoint */
625 - retval = path_lookup(dir_name, LOOKUP_FOLLOW, &nd);
626 + intent_init(&nd.intent, IT_LOOKUP);
627 + retval = path_lookup_it(dir_name, LOOKUP_FOLLOW, &nd);
631 diff -rup RH_2_6_9_55.orig/fs/nfs/dir.c RH_2_6_9_55/fs/nfs/dir.c
632 --- RH_2_6_9_55.orig/fs/nfs/dir.c
633 +++ RH_2_6_9_55/fs/nfs/dir.c
634 @@ -839,7 +839,7 @@ int nfs_is_exclusive_create(struct inode
636 if (!nd || (nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_CREATE))
638 - return (nd->intent.open.flags & O_EXCL) != 0;
639 + return (nd->intent.it_flags & O_EXCL) != 0;
642 static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
643 @@ -915,7 +915,7 @@ static int is_atomic_open(struct inode *
644 if (nd->flags & LOOKUP_DIRECTORY)
646 /* Are we trying to write to a read only partition? */
647 - if (IS_RDONLY(dir) && (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
648 + if (IS_RDONLY(dir) && (nd->intent.it_flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
652 @@ -936,7 +936,7 @@ static struct dentry *nfs_atomic_lookup(
653 dentry->d_op = NFS_PROTO(dir)->dentry_ops;
655 /* Let vfs_create() deal with O_EXCL */
656 - if (nd->intent.open.flags & O_EXCL)
657 + if (nd->intent.it_flags & O_EXCL)
660 /* Open the file on the server */
661 @@ -948,7 +948,7 @@ static struct dentry *nfs_atomic_lookup(
665 - if (nd->intent.open.flags & O_CREAT) {
666 + if (nd->intent.it_flags & O_CREAT) {
667 nfs_begin_data_update(dir);
668 inode = nfs4_atomic_open(dir, dentry, nd);
669 nfs_end_data_update(dir);
670 @@ -967,7 +967,7 @@ static struct dentry *nfs_atomic_lookup(
674 - if (!(nd->intent.open.flags & O_NOFOLLOW))
675 + if (!(nd->intent.it_flags & O_NOFOLLOW))
679 @@ -1005,7 +1005,7 @@ static int nfs_open_revalidate(struct de
680 /* NFS only supports OPEN on regular files */
681 if (!S_ISREG(inode->i_mode))
683 - openflags = nd->intent.open.flags;
684 + openflags = nd->intent.it_flags;
685 /* We cannot do exclusive creation on a positive dentry */
686 if ((openflags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL))
688 @@ -1213,7 +1213,7 @@ static int nfs_create(struct inode *dir,
689 attr.ia_valid = ATTR_MODE;
691 if (nd && (nd->flags & LOOKUP_CREATE))
692 - open_flags = nd->intent.open.flags;
693 + open_flags = nd->intent.it_flags;
696 * The 0 argument passed into the create function should one day
697 diff -rup RH_2_6_9_55.orig/fs/nfs/nfs4proc.c RH_2_6_9_55/fs/nfs/nfs4proc.c
698 --- RH_2_6_9_55.orig/fs/nfs/nfs4proc.c
699 +++ RH_2_6_9_55/fs/nfs/nfs4proc.c
700 @@ -770,27 +770,27 @@ nfs4_atomic_open(struct inode *dir, stru
701 struct nfs4_inc_open *inc_open;
703 if (nd->flags & LOOKUP_CREATE) {
704 - attr.ia_mode = nd->intent.open.create_mode;
705 + attr.ia_mode = nd->intent.it_create_mode;
706 attr.ia_valid = ATTR_MODE;
707 if (!IS_POSIXACL(dir))
708 attr.ia_mode &= ~current->fs->umask;
711 - BUG_ON(nd->intent.open.flags & O_CREAT);
712 + BUG_ON(nd->intent.it_flags & O_CREAT);
715 /* track info in case the open never completes */
716 if (!(inc_open = kmalloc(sizeof(*inc_open), GFP_KERNEL)))
717 return ERR_PTR(-ENOMEM);
718 cred = rpcauth_lookupcred(NFS_SERVER(dir)->client->cl_auth, 0);
719 - state = nfs4_do_open(dir, &dentry->d_name, nd->intent.open.flags, &attr, cred);
720 + state = nfs4_do_open(dir, &dentry->d_name, nd->intent.it_flags, &attr, cred);
724 return (struct inode *)state;
726 inc_open->task = current;
727 - inc_open->flags = nd->intent.open.flags;
728 + inc_open->flags = nd->intent.it_flags;
729 INIT_LIST_HEAD(&inc_open->state);
730 spin_lock(&state->inode->i_lock);
731 list_add(&inc_open->state, &state->inc_open);
732 diff -rup RH_2_6_9_55.orig/fs/open.c RH_2_6_9_55/fs/open.c
733 --- RH_2_6_9_55.orig/fs/open.c
734 +++ RH_2_6_9_55/fs/open.c
735 @@ -195,6 +195,7 @@ out:
736 int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs)
739 + struct inode_operations *op = dentry->d_inode->i_op;
740 struct iattr newattrs;
742 /* Not pretty: "inode->i_size" shouldn't really be signed. But it is. */
743 @@ -204,8 +205,16 @@ int do_truncate(struct dentry *dentry, l
744 newattrs.ia_size = length;
745 newattrs.ia_valid = ATTR_SIZE | time_attrs;
746 down(&dentry->d_inode->i_sem);
747 - err = notify_change(dentry, &newattrs);
748 - up(&dentry->d_inode->i_sem);
749 + if (op->setattr_raw) {
750 + newattrs.ia_valid |= ATTR_RAW;
751 + newattrs.ia_ctime = CURRENT_TIME;
752 + down_write(&dentry->d_inode->i_alloc_sem);
753 + err = op->setattr_raw(dentry->d_inode, &newattrs);
754 + up_write(&dentry->d_inode->i_alloc_sem);
756 + err = notify_change(dentry, &newattrs);
757 + up(&dentry->d_inode->i_sem);
762 @@ -214,12 +223,13 @@ static inline long do_sys_truncate(const
764 struct inode * inode;
769 if (length < 0) /* sorry, but loff_t says... */
772 - error = user_path_walk(path, &nd);
774 + intent_init(&nd.intent, IT_GETATTR);
775 + error = user_path_walk_it(path, &nd);
778 inode = nd.dentry->d_inode;
779 @@ -390,9 +400,19 @@ asmlinkage long sys_utime(char __user *
780 (error = permission(inode,MAY_WRITE,&nd)) != 0)
783 - down(&inode->i_sem);
784 - error = notify_change(nd.dentry, &newattrs);
786 + if (inode->i_op->setattr_raw) {
787 + struct inode_operations *op = nd.dentry->d_inode->i_op;
789 + newattrs.ia_valid |= ATTR_RAW;
790 + error = op->setattr_raw(inode, &newattrs);
791 + /* the file system wants to use normal vfs path now */
792 + if (error != -EOPNOTSUPP)
795 + down(&inode->i_sem);
796 + error = notify_change(nd.dentry, &newattrs);
802 @@ -443,9 +463,19 @@ long do_utimes(char __user * filename, s
803 (error = permission(inode,MAY_WRITE,&nd)) != 0)
806 - down(&inode->i_sem);
807 - error = notify_change(nd.dentry, &newattrs);
809 + if (inode->i_op->setattr_raw) {
810 + struct inode_operations *op = nd.dentry->d_inode->i_op;
812 + newattrs.ia_valid |= ATTR_RAW;
813 + error = op->setattr_raw(inode, &newattrs);
814 + /* the file system wants to use normal vfs path now */
815 + if (error != -EOPNOTSUPP)
818 + down(&inode->i_sem);
819 + error = notify_change(nd.dentry, &newattrs);
825 @@ -473,6 +503,7 @@ asmlinkage long sys_access(const char __
826 int old_fsuid, old_fsgid;
827 kernel_cap_t old_cap;
829 + intent_init(&nd.intent, IT_GETATTR);
831 if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
833 @@ -497,13 +528,14 @@ asmlinkage long sys_access(const char __
835 current->cap_effective = current->cap_permitted;
837 - res = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
838 + res = __user_walk_it(filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
840 res = permission(nd.dentry->d_inode, mode, &nd);
841 /* SuS v2 requires we report a read only fs too */
842 if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
843 && !special_file(nd.dentry->d_inode->i_mode))
849 @@ -518,8 +550,9 @@ asmlinkage long sys_chdir(const char __u
853 + intent_init(&nd.intent, IT_GETATTR);
855 - error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
856 + error = __user_walk_it(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
860 @@ -571,8 +604,9 @@ asmlinkage long sys_chroot(const char __
864 + intent_init(&nd.intent, IT_GETATTR);
866 - error = __user_walk(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
867 + error = __user_walk_it(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
871 @@ -595,36 +629,52 @@ out:
873 EXPORT_SYMBOL_GPL(sys_chroot);
875 -asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
876 +int chmod_common(struct dentry *dentry, mode_t mode)
878 - struct inode * inode;
879 - struct dentry * dentry;
880 - struct file * file;
882 + struct inode * inode = dentry->d_inode;
883 struct iattr newattrs;
884 + int error = -EROFS;
888 + if (IS_RDONLY(inode))
891 + if (inode->i_op->setattr_raw) {
892 + struct inode_operations *op = dentry->d_inode->i_op;
894 - dentry = file->f_dentry;
895 - inode = dentry->d_inode;
896 + newattrs.ia_mode = mode;
897 + newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
898 + newattrs.ia_valid |= ATTR_RAW;
899 + error = op->setattr_raw(inode, &newattrs);
900 + /* the file system wants to use the normal vfs path now */
901 + if (error != -EOPNOTSUPP)
906 - if (IS_RDONLY(inode))
910 if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
915 if (mode == (mode_t) -1)
916 mode = inode->i_mode;
917 newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
918 newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
919 - err = notify_change(dentry, &newattrs);
920 + error = notify_change(dentry, &newattrs);
927 +asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
929 + struct file * file;
936 + err = chmod_common(file->f_dentry, mode);
940 @@ -633,32 +683,13 @@ out:
941 asmlinkage long sys_chmod(const char __user * filename, mode_t mode)
944 - struct inode * inode;
946 - struct iattr newattrs;
948 error = user_path_walk(filename, &nd);
951 - inode = nd.dentry->d_inode;
954 - if (IS_RDONLY(inode))
958 - if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
961 - down(&inode->i_sem);
962 - if (mode == (mode_t) -1)
963 - mode = inode->i_mode;
964 - newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
965 - newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
966 - error = notify_change(nd.dentry, &newattrs);
970 + error = chmod_common(nd.dentry, mode);
974 @@ -679,6 +710,18 @@ static int chown_common(struct dentry *
975 if (IS_RDONLY(inode))
978 + if (inode->i_op->setattr_raw) {
979 + struct inode_operations *op = dentry->d_inode->i_op;
981 + newattrs.ia_uid = user;
982 + newattrs.ia_gid = group;
983 + newattrs.ia_valid = ATTR_UID | ATTR_GID | ATTR_CTIME;
984 + newattrs.ia_valid |= ATTR_RAW;
985 + error = op->setattr_raw(inode, &newattrs);
986 + /* the file system wants to use normal vfs path now */
987 + if (error != -EOPNOTSUPP)
990 if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
992 newattrs.ia_valid = ATTR_CTIME;
993 @@ -692,6 +735,7 @@ static int chown_common(struct dentry *
995 if (!S_ISDIR(inode->i_mode))
996 newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID;
999 error = notify_change(dentry, &newattrs);
1001 @@ -739,8 +783,6 @@ asmlinkage long sys_fchown(unsigned int
1005 -static struct file *__dentry_open(struct dentry *, struct vfsmount *, int, struct file *);
1008 * Note that while the flag value (low two bits) for sys_open means:
1010 @@ -758,8 +800,9 @@ static struct file *__dentry_open(struct
1011 struct file *filp_open(const char * filename, int flags, int mode)
1013 int namei_flags, error;
1014 + struct file * temp_filp;
1015 struct nameidata nd;
1017 + intent_init(&nd.intent, IT_OPEN);
1019 namei_flags = flags;
1020 if ((namei_flags+1) & O_ACCMODE)
1021 @@ -767,16 +810,11 @@ struct file *filp_open(const char * file
1022 if (namei_flags & O_TRUNC)
1026 - f = get_empty_filp();
1028 - return ERR_PTR(error);
1030 error = open_namei(filename, namei_flags, mode, &nd);
1032 - return __dentry_open(nd.dentry, nd.mnt, flags, f);
1036 + temp_filp = dentry_open_it(nd.dentry, nd.mnt, flags, &nd.intent);
1039 return ERR_PTR(error);
1042 @@ -784,29 +822,27 @@ EXPORT_SYMBOL(filp_open);
1044 struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
1048 + struct lookup_intent it;
1049 + intent_init(&it, IT_LOOKUP);
1052 - f = get_empty_filp();
1056 - return ERR_PTR(error);
1059 - return __dentry_open(dentry, mnt, flags, f);
1060 + return dentry_open_it(dentry, mnt, flags, &it);
1063 EXPORT_SYMBOL(dentry_open);
1065 -static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags, struct file *f)
1066 +struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, int flags, struct lookup_intent *it)
1069 struct inode *inode;
1073 + f = get_empty_filp();
1075 + goto cleanup_dentry;
1077 f->f_mode = ((flags+1) & O_ACCMODE) | FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
1079 inode = dentry->d_inode;
1080 if (f->f_mode & FMODE_WRITE) {
1081 error = get_write_access(inode);
1082 @@ -825,6 +861,7 @@ static struct file *__dentry_open(struct
1083 error = f->f_op->open(inode,f);
1086 + intent_release(it);
1088 f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
1090 @@ -849,6 +886,8 @@ cleanup_all:
1095 + intent_release(it);
1098 return ERR_PTR(error);
1099 diff -rup RH_2_6_9_55.orig/fs/stat.c RH_2_6_9_55/fs/stat.c
1100 --- RH_2_6_9_55.orig/fs/stat.c
1101 +++ RH_2_6_9_55/fs/stat.c
1102 @@ -37,7 +37,7 @@ void generic_fillattr(struct inode *inod
1104 EXPORT_SYMBOL(generic_fillattr);
1106 -int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
1107 +int vfs_getattr_it(struct vfsmount *mnt, struct dentry *dentry, struct lookup_intent *it, struct kstat *stat)
1109 struct inode *inode = dentry->d_inode;
1111 @@ -46,6 +46,8 @@ int vfs_getattr(struct vfsmount *mnt, st
1115 + if (inode->i_op->getattr_it)
1116 + return inode->i_op->getattr_it(mnt, dentry, it, stat);
1117 if (inode->i_op->getattr)
1118 return inode->i_op->getattr(mnt, dentry, stat);
1120 @@ -62,7 +64,7 @@ int vfs_getattr(struct vfsmount *mnt, st
1122 EXPORT_SYMBOL(vfs_getattr);
1124 -int vfs_getattr64(struct vfsmount *mnt, struct dentry *dentry, struct kstat64 *stat)
1125 +int vfs_getattr64_it(struct vfsmount *mnt, struct dentry *dentry, struct lookup_intent *it, struct kstat64 *stat)
1127 struct inode *inode = dentry->d_inode;
1129 @@ -79,6 +81,13 @@ int vfs_getattr64(struct vfsmount *mnt,
1130 return ixop->getattr64(mnt, dentry, stat);
1133 + if (inode->i_op->getattr_it) {
1134 + retval = inode->i_op->getattr_it(mnt, dentry, it, (struct kstat *) stat);
1136 + stat->ino64 = stat->ino;
1140 if (inode->i_op->getattr) {
1141 retval = inode->i_op->getattr(mnt, dentry, (struct kstat *) stat);
1143 @@ -98,16 +107,28 @@ int vfs_getattr64(struct vfsmount *mnt,
1148 EXPORT_SYMBOL(vfs_getattr64);
1150 +int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
1152 + return vfs_getattr_it(mnt, dentry, NULL, stat);
1155 +int vfs_getattr64(struct vfsmount *mnt, struct dentry *dentry, struct kstat64 *stat)
1157 + return vfs_getattr64_it(mnt, dentry, NULL, stat);
1160 int vfs_stat(char __user *name, struct kstat *stat)
1162 struct nameidata nd;
1164 + intent_init(&nd.intent, IT_GETATTR);
1166 - error = user_path_walk(name, &nd);
1167 + error = user_path_walk_it(name, &nd);
1169 - error = vfs_getattr(nd.mnt, nd.dentry, stat);
1170 + error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
1174 @@ -119,10 +140,11 @@ int vfs_lstat(char __user *name, struct
1176 struct nameidata nd;
1178 + intent_init(&nd.intent, IT_GETATTR);
1180 - error = user_path_walk_link(name, &nd);
1181 + error = user_path_walk_link_it(name, &nd);
1183 - error = vfs_getattr(nd.mnt, nd.dentry, stat);
1184 + error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
1188 @@ -134,9 +156,12 @@ int vfs_fstat(unsigned int fd, struct ks
1190 struct file *f = fget(fd);
1192 + struct nameidata nd;
1193 + intent_init(&nd.intent, IT_GETATTR);
1196 - error = vfs_getattr(f->f_vfsmnt, f->f_dentry, stat);
1197 + error = vfs_getattr_it(f->f_vfsmnt, f->f_dentry, &nd.intent, stat);
1198 + intent_release(&nd.intent);
1202 @@ -148,10 +173,11 @@ int vfs_stat64(char __user *name, struct
1204 struct nameidata nd;
1206 + intent_init(&nd.intent, IT_GETATTR);
1208 - error = user_path_walk(name, &nd);
1209 + error = user_path_walk_it(name, &nd);
1211 - error = vfs_getattr64(nd.mnt, nd.dentry, stat);
1212 + error = vfs_getattr64_it(nd.mnt, nd.dentry, &nd.intent, stat);
1216 @@ -163,10 +189,11 @@ int vfs_lstat64(char __user *name, struc
1218 struct nameidata nd;
1220 + intent_init(&nd.intent, IT_GETATTR);
1222 - error = user_path_walk_link(name, &nd);
1223 + error = user_path_walk_link_it(name, &nd);
1225 - error = vfs_getattr64(nd.mnt, nd.dentry, stat);
1226 + error = vfs_getattr64_it(nd.mnt, nd.dentry, &nd.intent, stat);
1230 @@ -178,9 +205,11 @@ int vfs_fstat64(unsigned int fd, struct
1232 struct file *f = fget(fd);
1234 + struct nameidata nd;
1235 + intent_init(&nd.intent, IT_GETATTR);
1238 - error = vfs_getattr64(f->f_vfsmnt, f->f_dentry, stat);
1239 + error = vfs_getattr64_it(f->f_vfsmnt, f->f_dentry, &nd.intent, stat);
1243 diff -rup RH_2_6_9_55.orig/include/linux/dcache.h RH_2_6_9_55/include/linux/dcache.h
1244 --- RH_2_6_9_55.orig/include/linux/dcache.h
1245 +++ RH_2_6_9_55/include/linux/dcache.h
1249 #include <asm/atomic.h>
1250 +#include <linux/string.h>
1251 #include <linux/list.h>
1252 #include <linux/spinlock.h>
1253 #include <linux/cache.h>
1254 @@ -37,6 +38,8 @@ struct qstr {
1255 const unsigned char *name;
1258 +#include <linux/namei.h>
1260 struct dentry_stat_t {
1263 diff -rup RH_2_6_9_55.orig/include/linux/fs.h RH_2_6_9_55/include/linux/fs.h
1264 --- RH_2_6_9_55.orig/include/linux/fs.h
1265 +++ RH_2_6_9_55/include/linux/fs.h
1266 @@ -266,6 +266,8 @@ typedef void (dio_iodone_t)(struct inode
1267 #define ATTR_ATTR_FLAG 1024
1268 #define ATTR_KILL_SUID 2048
1269 #define ATTR_KILL_SGID 4096
1270 +#define ATTR_RAW 8192 /* file system, not vfs will massage attrs */
1271 +#define ATTR_FROM_OPEN 16384 /* called from open path, ie O_TRUNC */
1274 * This is the Inode Attributes structure, used for notify_change(). It
1275 @@ -464,6 +466,7 @@ struct inode {
1276 struct block_device *i_bdev;
1277 struct cdev *i_cdev;
1279 + void *i_filterdata;
1283 @@ -597,6 +600,7 @@ struct file {
1284 spinlock_t f_ep_lock;
1285 #endif /* #ifdef CONFIG_EPOLL */
1286 struct address_space *f_mapping;
1287 + struct lookup_intent *f_it;
1289 extern spinlock_t files_lock;
1290 #define file_list_lock() spin_lock(&files_lock);
1291 @@ -967,20 +971,29 @@ struct inode_operations {
1292 int (*create) (struct inode *,struct dentry *,int, struct nameidata *);
1293 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
1294 int (*link) (struct dentry *,struct inode *,struct dentry *);
1295 + int (*link_raw) (struct nameidata *,struct nameidata *);
1296 int (*unlink) (struct inode *,struct dentry *);
1297 + int (*unlink_raw) (struct nameidata *);
1298 int (*symlink) (struct inode *,struct dentry *,const char *);
1299 + int (*symlink_raw) (struct nameidata *,const char *);
1300 int (*mkdir) (struct inode *,struct dentry *,int);
1301 + int (*mkdir_raw) (struct nameidata *,int);
1302 int (*rmdir) (struct inode *,struct dentry *);
1303 + int (*rmdir_raw) (struct nameidata *);
1304 int (*mknod) (struct inode *,struct dentry *,int,dev_t);
1305 + int (*mknod_raw) (struct nameidata *,int,dev_t);
1306 int (*rename) (struct inode *, struct dentry *,
1307 struct inode *, struct dentry *);
1308 + int (*rename_raw) (struct nameidata *, struct nameidata *);
1309 int (*readlink) (struct dentry *, char __user *,int);
1310 int (*follow_link) (struct dentry *, struct nameidata *);
1311 void (*put_link) (struct dentry *, struct nameidata *);
1312 void (*truncate) (struct inode *);
1313 int (*permission) (struct inode *, int, struct nameidata *);
1314 int (*setattr) (struct dentry *, struct iattr *);
1315 + int (*setattr_raw) (struct inode *, struct iattr *);
1316 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
1317 + int (*getattr_it) (struct vfsmount *, struct dentry *, struct lookup_intent *, struct kstat *);
1318 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
1319 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
1320 ssize_t (*listxattr) (struct dentry *, char *, size_t);
1321 @@ -1025,6 +1038,7 @@ struct super_operations {
1322 int (*remount_fs) (struct super_block *, int *, char *);
1323 void (*clear_inode) (struct inode *);
1324 void (*umount_begin) (struct super_block *);
1325 + void (*umount_lustre) (struct super_block *);
1327 int (*show_options)(struct seq_file *, struct vfsmount *);
1329 @@ -1217,6 +1231,7 @@ extern int unregister_filesystem(struct
1330 extern struct vfsmount *kern_mount(struct file_system_type *);
1331 extern int may_umount_tree(struct vfsmount *);
1332 extern int may_umount(struct vfsmount *);
1333 +struct vfsmount *do_kern_mount(const char *type, int flags, const char *name, void *data);
1334 extern long do_mount(char *, char *, char *, unsigned long, void *);
1336 extern int vfs_statfs(struct super_block *, struct kstatfs *);
1337 @@ -1277,10 +1292,10 @@ static inline int break_lease(struct ino
1342 extern int do_truncate(struct dentry *, loff_t start, unsigned int);
1343 extern struct file *filp_open(const char *, int, int);
1344 extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
1345 +extern struct file * dentry_open_it(struct dentry *, struct vfsmount *, int, struct lookup_intent *);
1346 extern int filp_close(struct file *, fl_owner_t id);
1347 extern char * getname(const char __user *);
1349 diff -rup RH_2_6_9_55.orig/include/linux/mount.h RH_2_6_9_55/include/linux/mount.h
1350 --- RH_2_6_9_55.orig/include/linux/mount.h
1351 +++ RH_2_6_9_55/include/linux/mount.h
1352 @@ -34,6 +34,7 @@ struct vfsmount
1353 struct list_head mnt_list;
1354 struct list_head mnt_fslink; /* link in fs-specific expiry list */
1355 struct namespace *mnt_namespace; /* containing namespace */
1356 + unsigned long mnt_last_used; /* for GNS auto-umount (jiffies) */
1359 static inline struct vfsmount *mntget(struct vfsmount *mnt)
1360 diff -rup RH_2_6_9_55.orig/include/linux/namei.h RH_2_6_9_55/include/linux/namei.h
1361 --- RH_2_6_9_55.orig/include/linux/namei.h
1362 +++ RH_2_6_9_55/include/linux/namei.h
1364 #define _LINUX_NAMEI_H
1366 #include <linux/linkage.h>
1367 +#include <linux/string.h>
1372 -struct open_intent {
1375 +/* intent opcodes */
1376 +#define IT_OPEN (1)
1377 +#define IT_CREAT (1<<1)
1378 +#define IT_READDIR (1<<2)
1379 +#define IT_GETATTR (1<<3)
1380 +#define IT_LOOKUP (1<<4)
1381 +#define IT_UNLINK (1<<5)
1382 +#define IT_TRUNC (1<<6)
1383 +#define IT_GETXATTR (1<<7)
1385 +struct lustre_intent_data {
1386 + int it_disposition;
1388 + __u64 it_lock_handle;
1393 +#define INTENT_MAGIC 0x19620323
1394 +struct lookup_intent {
1396 + void (*it_op_release)(struct lookup_intent *);
1399 + int it_create_mode;
1401 + struct lustre_intent_data lustre;
1405 +static inline void intent_reset_fs_part(struct lookup_intent *it)
1407 + memset(&it->d, 0, sizeof(it->d));
1408 + it->it_magic = INTENT_MAGIC;
1409 + it->it_op_release = NULL;
1412 +static inline void intent_init(struct lookup_intent *it, int op)
1414 + memset(it, 0, sizeof(*it));
1415 + it->it_magic = INTENT_MAGIC;
1419 enum { MAX_NESTED_LINKS = 8 };
1422 @@ -21,10 +62,7 @@ struct nameidata {
1424 char *saved_names[MAX_NESTED_LINKS + 1];
1428 - struct open_intent open;
1430 + struct lookup_intent intent;
1434 @@ -47,6 +85,8 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
1435 #define LOOKUP_NOALT 32
1436 #define LOOKUP_ATOMIC 64
1437 #define LOOKUP_REVAL 128
1438 +#define LOOKUP_LAST (0x1000)
1439 +#define LOOKUP_LINK_NOTLAST (0x2000)
1443 @@ -56,11 +96,18 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
1444 #define LOOKUP_ACCESS (0x0400)
1446 extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *));
1447 +extern int FASTCALL(__user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd));
1448 +#define user_path_walk_it(name,nd) \
1449 + __user_walk_it(name, LOOKUP_FOLLOW, nd)
1450 +#define user_path_walk_link_it(name,nd) \
1451 + __user_walk_it(name, 0, nd)
1452 +extern void intent_release(struct lookup_intent *);
1453 #define user_path_walk(name,nd) \
1454 __user_walk(name, LOOKUP_FOLLOW, nd)
1455 #define user_path_walk_link(name,nd) \
1456 __user_walk(name, 0, nd)
1457 extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
1458 +extern int FASTCALL(path_lookup_it(const char *, unsigned, struct nameidata *));
1459 extern int FASTCALL(path_walk(const char *, struct nameidata *));
1460 extern int FASTCALL(link_path_walk(const char *, struct nameidata *));
1461 extern void path_release(struct nameidata *);