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,9 +503,10 @@ struct file *open_exec(const char *name)
55 int err = permission(inode, MAY_EXEC, &nd);
58 - file = dentry_open(nd.dentry, nd.mnt,
59 + file = dentry_open_it(nd.dentry, nd.mnt,
61 - O_RDONLY|O_LARGEFILE : O_RDONLY);
62 + O_RDONLY|O_LARGEFILE : O_RDONLY,
65 err = deny_write_access(file);
67 diff -rup RH_2_6_9_55.orig/fs/inode.c RH_2_6_9_55/fs/inode.c
68 --- RH_2_6_9_55.orig/fs/inode.c
69 +++ RH_2_6_9_55/fs/inode.c
70 @@ -235,6 +235,7 @@ void __iget(struct inode * inode)
71 inodes_stat.nr_unused--;
74 +EXPORT_SYMBOL(__iget);
76 * clear_inode - clear an inode
77 * @inode: inode to clear
78 diff -rup RH_2_6_9_55.orig/fs/namei.c RH_2_6_9_55/fs/namei.c
79 --- RH_2_6_9_55.orig/fs/namei.c
80 +++ RH_2_6_9_55/fs/namei.c
81 @@ -282,8 +282,19 @@ int deny_write_access(struct file * file
85 +void intent_release(struct lookup_intent *it)
89 + if (it->it_magic != INTENT_MAGIC)
91 + if (it->it_op_release)
92 + it->it_op_release(it);
95 void path_release(struct nameidata *nd)
97 + intent_release(&nd->intent);
101 @@ -395,8 +406,12 @@ static struct dentry * real_lookup(struc
103 struct dentry * result;
104 struct inode *dir = parent->d_inode;
113 * First re-do the cached lookup just in case it was created
114 * while we waited for the directory semaphore..
115 @@ -433,8 +448,12 @@ static struct dentry * real_lookup(struc
117 if (result->d_op && result->d_op->d_revalidate) {
118 result = do_revalidate(result, nd);
120 - result = ERR_PTR(-ENOENT);
123 + result = ERR_PTR(-ESTALE);
124 + if (!IS_ERR(result))
130 @@ -464,6 +483,7 @@ static inline int __vfs_follow_link(stru
138 @@ -473,6 +493,7 @@ static inline int __vfs_follow_link(stru
139 /* weird __emul_prefix() stuff did it */
142 + intent_reset_fs_part(&nd->intent);
143 res = link_path_walk(link, nd);
145 if (nd->depth || res || nd->last_type!=LAST_NORM)
146 @@ -681,6 +702,33 @@ fail:
147 return PTR_ERR(dentry);
150 +static int revalidate_special(struct nameidata *nd)
152 + struct dentry *dentry = nd->dentry;
153 + int err, counter = 0;
156 + if (!dentry->d_op || !dentry->d_op->d_revalidate)
158 + if (!dentry->d_op->d_revalidate(dentry, nd)) {
159 + struct dentry *new;
160 + if ((err = permission(dentry->d_parent->d_inode, MAY_EXEC, nd)))
162 + new = real_lookup(dentry->d_parent, &dentry->d_name, nd);
164 + return PTR_ERR(new);
165 + d_invalidate(dentry);
167 + nd->dentry = dentry = new;
170 + goto revalidate_again;
171 + //printk("excessive revalidate_it loops\n");
179 * This is the basic name resolution function, turning a pathname into
180 @@ -782,13 +830,17 @@ static fastcall int __link_path_walk(con
183 if (inode->i_op->follow_link) {
184 + int save_flags = nd->flags;
186 if (next.mnt != nd->mnt) {
189 nd->dentry = dget(next.dentry);
191 + nd->flags |= LOOKUP_LINK_NOTLAST;
192 err = do_follow_link(next.dentry, nd);
193 + if (!(save_flags & LOOKUP_LINK_NOTLAST))
194 + nd->flags &= ~LOOKUP_LINK_NOTLAST;
198 @@ -828,14 +880,34 @@ last_component:
199 inode = nd->dentry->d_inode;
202 + nd->flags |= LOOKUP_LAST;
203 + err = revalidate_special(nd);
204 + nd->flags &= ~LOOKUP_LAST;
205 + if (!nd->dentry->d_inode)
211 + if (lookup_flags & LOOKUP_DIRECTORY) {
213 + if (!nd->dentry->d_inode->i_op ||
214 + !nd->dentry->d_inode->i_op->lookup){
222 if (nd->dentry->d_op && nd->dentry->d_op->d_hash) {
223 err = nd->dentry->d_op->d_hash(nd->dentry, &this);
227 + nd->flags |= LOOKUP_LAST;
228 err = do_lookup(nd, &this, &next, atomic);
229 + nd->flags &= ~LOOKUP_LAST;
232 follow_mount(&next.mnt, &next.dentry);
233 @@ -1007,7 +1079,7 @@ set_it:
236 /* Returns 0 and nd will be valid on success; Retuns error, otherwise. */
237 -int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata *nd)
238 +int fastcall path_lookup_it(const char *name, unsigned int flags, struct nameidata *nd)
242 @@ -1041,6 +1113,12 @@ out:
246 +int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata *nd)
248 + intent_init(&nd->intent, IT_GETATTR);
249 + return path_lookup_it(name, flags, nd);
253 * Restricted form of lookup. Doesn't follow links, single-component only,
254 * needs parent already locked. Doesn't follow mounts.
255 @@ -1091,7 +1169,7 @@ struct dentry * lookup_hash(struct qstr
259 -struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
260 +struct dentry * lookup_one_len_it(const char * name, struct dentry * base, int len, struct nameidata *nd)
264 @@ -1111,11 +1189,16 @@ struct dentry * lookup_one_len(const cha
266 this.hash = end_name_hash(hash);
268 - return lookup_hash(&this, base);
269 + return __lookup_hash(&this, base, nd);
271 return ERR_PTR(-EACCES);
274 +struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
276 + return lookup_one_len_it(name, base, len, NULL);
282 @@ -1127,18 +1210,24 @@ access:
283 * that namei follows links, while lnamei does not.
286 -int fastcall __user_walk(const char __user *name, unsigned flags, struct nameidata *nd)
287 +int fastcall __user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd)
289 char *tmp = getname(name);
290 int err = PTR_ERR(tmp);
293 - err = path_lookup(tmp, flags, nd);
294 + err = path_lookup_it(tmp, flags, nd);
300 +int fastcall __user_walk(const char __user *name, unsigned flags, struct nameidata *nd)
302 + intent_init(&nd->intent, IT_LOOKUP);
303 + return __user_walk_it(name, flags, nd);
307 * It's inline, so penalty for filesystems that don't use sticky bit is
309 @@ -1384,7 +1473,7 @@ int may_open(struct nameidata *nd, int a
313 - error = do_truncate(dentry, 0, ATTR_MTIME|ATTR_CTIME);
314 + error = do_truncate(dentry, 0, ATTR_MTIME|ATTR_CTIME|ATTR_FROM_OPEN);
316 put_write_access(inode);
318 @@ -1425,14 +1514,14 @@ int open_namei(const char * pathname, in
319 acc_mode |= MAY_APPEND;
321 /* Fill in the open() intent data */
322 - nd->intent.open.flags = flag;
323 - nd->intent.open.create_mode = mode;
324 + nd->intent.it_flags = flag;
325 + nd->intent.it_create_mode = mode;
328 * The simplest case - just a plain lookup.
330 if (!(flag & O_CREAT)) {
331 - error = path_lookup(pathname, lookup_flags(flag)|LOOKUP_OPEN, nd);
332 + error = path_lookup_it(pathname, lookup_flags(flag)|LOOKUP_OPEN, nd);
336 @@ -1441,7 +1530,8 @@ int open_namei(const char * pathname, in
338 * Create - we need to know the parent.
340 - error = path_lookup(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd);
341 + nd->intent.it_op |= IT_CREAT;
342 + error = path_lookup_it(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd);
346 @@ -1457,7 +1547,9 @@ int open_namei(const char * pathname, in
348 nd->flags &= ~LOOKUP_PARENT;
349 down(&dir->d_inode->i_sem);
350 + nd->flags |= LOOKUP_LAST;
351 dentry = __lookup_hash(&nd->last, nd->dentry, nd);
352 + nd->flags &= ~LOOKUP_LAST;
355 error = PTR_ERR(dentry);
356 @@ -1570,7 +1662,9 @@ do_link:
359 down(&dir->d_inode->i_sem);
360 + nd->flags |= LOOKUP_LAST;
361 dentry = __lookup_hash(&nd->last, nd->dentry, nd);
362 + nd->flags &= ~LOOKUP_LAST;
363 __putname(nd->last.name);
366 @@ -1644,10 +1738,20 @@ asmlinkage long sys_mknod(const char __u
367 tmp = getname(filename);
371 - error = path_lookup(tmp, LOOKUP_PARENT, &nd);
373 + intent_init(&nd.intent, IT_LOOKUP);
374 + error = path_lookup_it(tmp, LOOKUP_PARENT, &nd);
378 + if (nd.dentry->d_inode->i_op->mknod_raw) {
379 + struct inode_operations *op = nd.dentry->d_inode->i_op;
380 + error = op->mknod_raw(&nd, mode, dev);
381 + /* the file system wants to use normal vfs path now */
382 + if (error != -EOPNOTSUPP)
386 dentry = lookup_create(&nd, 0);
387 error = PTR_ERR(dentry);
389 @@ -1674,6 +1778,7 @@ asmlinkage long sys_mknod(const char __u
392 up(&nd.dentry->d_inode->i_sem);
397 @@ -1716,10 +1821,20 @@ asmlinkage long sys_mkdir(const char __u
399 struct dentry *dentry;
401 + intent_init(&nd.intent, IT_LOOKUP);
403 - error = path_lookup(tmp, LOOKUP_PARENT, &nd);
404 + error = path_lookup_it(tmp, LOOKUP_PARENT, &nd);
408 + if (nd.dentry->d_inode->i_op->mkdir_raw) {
409 + struct inode_operations *op = nd.dentry->d_inode->i_op;
410 + error = op->mkdir_raw(&nd, mode);
411 + /* the file system wants to use normal vfs path now */
412 + if (error != -EOPNOTSUPP)
416 dentry = lookup_create(&nd, 1);
417 error = PTR_ERR(dentry);
418 if (!IS_ERR(dentry)) {
419 @@ -1729,6 +1844,7 @@ asmlinkage long sys_mkdir(const char __u
422 up(&nd.dentry->d_inode->i_sem);
427 @@ -1814,7 +1930,8 @@ asmlinkage long sys_rmdir(const char __u
429 return PTR_ERR(name);
431 - error = path_lookup(name, LOOKUP_PARENT, &nd);
432 + intent_init(&nd.intent, IT_LOOKUP);
433 + error = path_lookup_it(name, LOOKUP_PARENT, &nd);
437 @@ -1829,6 +1946,16 @@ asmlinkage long sys_rmdir(const char __u
442 + if (nd.dentry->d_inode->i_op->rmdir_raw) {
443 + struct inode_operations *op = nd.dentry->d_inode->i_op;
445 + error = op->rmdir_raw(&nd);
446 + /* the file system wants to use normal vfs path now */
447 + if (error != -EOPNOTSUPP)
451 down(&nd.dentry->d_inode->i_sem);
452 dentry = lookup_hash(&nd.last, nd.dentry);
453 error = PTR_ERR(dentry);
454 @@ -1892,12 +2019,22 @@ asmlinkage long sys_unlink(const char __
456 return PTR_ERR(name);
458 - error = path_lookup(name, LOOKUP_PARENT, &nd);
459 + intent_init(&nd.intent, IT_LOOKUP);
460 + error = path_lookup_it(name, LOOKUP_PARENT, &nd);
464 if (nd.last_type != LAST_NORM)
467 + if (nd.dentry->d_inode->i_op->unlink_raw) {
468 + struct inode_operations *op = nd.dentry->d_inode->i_op;
469 + error = op->unlink_raw(&nd);
470 + /* the file system wants to use normal vfs path now */
471 + if (error != -EOPNOTSUPP)
475 down(&nd.dentry->d_inode->i_sem);
476 dentry = lookup_hash(&nd.last, nd.dentry);
477 error = PTR_ERR(dentry);
478 @@ -1965,10 +2102,20 @@ asmlinkage long sys_symlink(const char _
480 struct dentry *dentry;
482 + intent_init(&nd.intent, IT_LOOKUP);
484 - error = path_lookup(to, LOOKUP_PARENT, &nd);
485 + error = path_lookup_it(to, LOOKUP_PARENT, &nd);
489 + if (nd.dentry->d_inode->i_op->symlink_raw) {
490 + struct inode_operations *op = nd.dentry->d_inode->i_op;
491 + error = op->symlink_raw(&nd, from);
492 + /* the file system wants to use normal vfs path now */
493 + if (error != -EOPNOTSUPP)
497 dentry = lookup_create(&nd, 0);
498 error = PTR_ERR(dentry);
499 if (!IS_ERR(dentry)) {
500 @@ -1976,6 +2123,7 @@ asmlinkage long sys_symlink(const char _
503 up(&nd.dentry->d_inode->i_sem);
508 @@ -2045,15 +2193,26 @@ asmlinkage long sys_link(const char __us
512 - error = __user_walk(oldname, 0, &old_nd);
513 + intent_init(&old_nd.intent, IT_LOOKUP);
514 + error = __user_walk_it(oldname, 0, &old_nd);
517 - error = path_lookup(to, LOOKUP_PARENT, &nd);
519 + intent_init(&nd.intent, IT_LOOKUP);
520 + error = path_lookup_it(to, LOOKUP_PARENT, &nd);
524 if (old_nd.mnt != nd.mnt)
526 + if (nd.dentry->d_inode->i_op->link_raw) {
527 + struct inode_operations *op = nd.dentry->d_inode->i_op;
528 + error = op->link_raw(&old_nd, &nd);
529 + /* the file system wants to use normal vfs path now */
530 + if (error != -EOPNOTSUPP)
534 new_dentry = lookup_create(&nd, 0);
535 error = PTR_ERR(new_dentry);
536 if (!IS_ERR(new_dentry)) {
537 @@ -2229,11 +2388,13 @@ static inline int do_rename(const char *
538 struct dentry * trap;
539 struct nameidata oldnd, newnd;
541 - error = path_lookup(oldname, LOOKUP_PARENT, &oldnd);
542 + intent_init(&oldnd.intent, IT_LOOKUP);
543 + error = path_lookup_it(oldname, LOOKUP_PARENT, &oldnd);
547 - error = path_lookup(newname, LOOKUP_PARENT, &newnd);
548 + intent_init(&newnd.intent, IT_LOOKUP);
549 + error = path_lookup_it(newname, LOOKUP_PARENT, &newnd);
553 @@ -2250,6 +2411,13 @@ static inline int do_rename(const char *
554 if (newnd.last_type != LAST_NORM)
557 + if (old_dir->d_inode->i_op->rename_raw) {
558 + error = old_dir->d_inode->i_op->rename_raw(&oldnd, &newnd);
559 + /* the file system wants to use normal vfs path now */
560 + if (error != -EOPNOTSUPP)
564 trap = lock_rename(new_dir, old_dir);
566 old_dentry = lookup_hash(&oldnd.last, old_dir);
567 @@ -2281,8 +2449,7 @@ static inline int do_rename(const char *
568 if (new_dentry == trap)
571 - error = vfs_rename(old_dir->d_inode, old_dentry,
572 - new_dir->d_inode, new_dentry);
573 + error = vfs_rename(old_dir->d_inode, old_dentry, new_dir->d_inode, new_dentry);
577 @@ -2473,6 +2640,7 @@ EXPORT_SYMBOL(page_readlink);
578 EXPORT_SYMBOL(page_symlink);
579 EXPORT_SYMBOL(page_symlink_inode_operations);
580 EXPORT_SYMBOL(path_lookup);
581 +EXPORT_SYMBOL(path_lookup_it);
582 EXPORT_SYMBOL(path_release);
583 EXPORT_SYMBOL(path_walk);
584 EXPORT_SYMBOL(permission);
585 diff -urNp RH_2_6_9_42_0_3.orig/fs/namespace.c RH_2_6_9_42_0_3/fs/namespace.c
586 --- RH_2_6_9_42_0_3.orig/fs/namespace.c
587 +++ RH_2_6_9_42_0_3/fs/namespace.c
588 @@ -114,6 +115,7 @@ static inline int check_mnt(struct vfsmo
590 static void detach_mnt(struct vfsmount *mnt, struct nameidata *old_nd)
592 + memset(old_nd, 0, sizeof(*old_nd));
593 old_nd->dentry = mnt->mnt_mountpoint;
594 old_nd->mnt = mnt->mnt_parent;
595 mnt->mnt_parent = mnt;
596 @@ -441,6 +442,8 @@ static int do_umount(struct vfsmount *mn
600 + if (sb->s_op->umount_lustre)
601 + sb->s_op->umount_lustre(sb);
602 if( (flags&MNT_FORCE) && sb->s_op->umount_begin)
603 sb->s_op->umount_begin(sb);
605 @@ -665,7 +668,8 @@ static int do_loopback(struct nameidata
607 if (!old_name || !*old_name)
609 - err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
610 + intent_init(&old_nd.intent, IT_LOOKUP);
611 + err = path_lookup_it(old_name, LOOKUP_FOLLOW, &old_nd);
615 @@ -739,7 +743,8 @@ static int do_move_mount(struct nameidat
617 if (!old_name || !*old_name)
619 - err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
620 + intent_init(&old_nd.intent, IT_LOOKUP);
621 + err = path_lookup_it(old_name, LOOKUP_FOLLOW, &old_nd);
625 @@ -1074,7 +1079,8 @@ long do_mount(char * dev_name, char * di
626 flags &= ~(MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_ACTIVE);
628 /* ... and get the mountpoint */
629 - retval = path_lookup(dir_name, LOOKUP_FOLLOW, &nd);
630 + intent_init(&nd.intent, IT_LOOKUP);
631 + retval = path_lookup_it(dir_name, LOOKUP_FOLLOW, &nd);
635 diff -rup RH_2_6_9_55.orig/fs/nfs/dir.c RH_2_6_9_55/fs/nfs/dir.c
636 --- RH_2_6_9_55.orig/fs/nfs/dir.c
637 +++ RH_2_6_9_55/fs/nfs/dir.c
638 @@ -839,7 +839,7 @@ int nfs_is_exclusive_create(struct inode
640 if (!nd || (nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_CREATE))
642 - return (nd->intent.open.flags & O_EXCL) != 0;
643 + return (nd->intent.it_flags & O_EXCL) != 0;
646 static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
647 @@ -915,7 +915,7 @@ static int is_atomic_open(struct inode *
648 if (nd->flags & LOOKUP_DIRECTORY)
650 /* Are we trying to write to a read only partition? */
651 - if (IS_RDONLY(dir) && (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
652 + if (IS_RDONLY(dir) && (nd->intent.it_flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
656 @@ -936,7 +936,7 @@ static struct dentry *nfs_atomic_lookup(
657 dentry->d_op = NFS_PROTO(dir)->dentry_ops;
659 /* Let vfs_create() deal with O_EXCL */
660 - if (nd->intent.open.flags & O_EXCL)
661 + if (nd->intent.it_flags & O_EXCL)
664 /* Open the file on the server */
665 @@ -948,7 +948,7 @@ static struct dentry *nfs_atomic_lookup(
669 - if (nd->intent.open.flags & O_CREAT) {
670 + if (nd->intent.it_flags & O_CREAT) {
671 nfs_begin_data_update(dir);
672 inode = nfs4_atomic_open(dir, dentry, nd);
673 nfs_end_data_update(dir);
674 @@ -967,7 +967,7 @@ static struct dentry *nfs_atomic_lookup(
678 - if (!(nd->intent.open.flags & O_NOFOLLOW))
679 + if (!(nd->intent.it_flags & O_NOFOLLOW))
683 @@ -1005,7 +1005,7 @@ static int nfs_open_revalidate(struct de
684 /* NFS only supports OPEN on regular files */
685 if (!S_ISREG(inode->i_mode))
687 - openflags = nd->intent.open.flags;
688 + openflags = nd->intent.it_flags;
689 /* We cannot do exclusive creation on a positive dentry */
690 if ((openflags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL))
692 @@ -1213,7 +1213,7 @@ static int nfs_create(struct inode *dir,
693 attr.ia_valid = ATTR_MODE;
695 if (nd && (nd->flags & LOOKUP_CREATE))
696 - open_flags = nd->intent.open.flags;
697 + open_flags = nd->intent.it_flags;
700 * The 0 argument passed into the create function should one day
701 diff -rup RH_2_6_9_55.orig/fs/nfs/nfs4proc.c RH_2_6_9_55/fs/nfs/nfs4proc.c
702 --- RH_2_6_9_55.orig/fs/nfs/nfs4proc.c
703 +++ RH_2_6_9_55/fs/nfs/nfs4proc.c
704 @@ -770,27 +770,27 @@ nfs4_atomic_open(struct inode *dir, stru
705 struct nfs4_inc_open *inc_open;
707 if (nd->flags & LOOKUP_CREATE) {
708 - attr.ia_mode = nd->intent.open.create_mode;
709 + attr.ia_mode = nd->intent.it_create_mode;
710 attr.ia_valid = ATTR_MODE;
711 if (!IS_POSIXACL(dir))
712 attr.ia_mode &= ~current->fs->umask;
715 - BUG_ON(nd->intent.open.flags & O_CREAT);
716 + BUG_ON(nd->intent.it_flags & O_CREAT);
719 /* track info in case the open never completes */
720 if (!(inc_open = kmalloc(sizeof(*inc_open), GFP_KERNEL)))
721 return ERR_PTR(-ENOMEM);
722 cred = rpcauth_lookupcred(NFS_SERVER(dir)->client->cl_auth, 0);
723 - state = nfs4_do_open(dir, &dentry->d_name, nd->intent.open.flags, &attr, cred);
724 + state = nfs4_do_open(dir, &dentry->d_name, nd->intent.it_flags, &attr, cred);
728 return (struct inode *)state;
730 inc_open->task = current;
731 - inc_open->flags = nd->intent.open.flags;
732 + inc_open->flags = nd->intent.it_flags;
733 INIT_LIST_HEAD(&inc_open->state);
734 spin_lock(&state->inode->i_lock);
735 list_add(&inc_open->state, &state->inc_open);
736 diff -rup RH_2_6_9_55.orig/fs/open.c RH_2_6_9_55/fs/open.c
737 --- RH_2_6_9_55.orig/fs/open.c
738 +++ RH_2_6_9_55/fs/open.c
739 @@ -195,6 +195,7 @@ out:
740 int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs)
743 + struct inode_operations *op = dentry->d_inode->i_op;
744 struct iattr newattrs;
746 /* Not pretty: "inode->i_size" shouldn't really be signed. But it is. */
747 @@ -204,8 +205,16 @@ int do_truncate(struct dentry *dentry, l
748 newattrs.ia_size = length;
749 newattrs.ia_valid = ATTR_SIZE | time_attrs;
750 down(&dentry->d_inode->i_sem);
751 - err = notify_change(dentry, &newattrs);
752 - up(&dentry->d_inode->i_sem);
753 + if (op->setattr_raw) {
754 + newattrs.ia_valid |= ATTR_RAW;
755 + newattrs.ia_ctime = CURRENT_TIME;
756 + down_write(&dentry->d_inode->i_alloc_sem);
757 + err = op->setattr_raw(dentry->d_inode, &newattrs);
758 + up_write(&dentry->d_inode->i_alloc_sem);
760 + err = notify_change(dentry, &newattrs);
761 + up(&dentry->d_inode->i_sem);
766 @@ -214,12 +223,13 @@ static inline long do_sys_truncate(const
768 struct inode * inode;
773 if (length < 0) /* sorry, but loff_t says... */
776 - error = user_path_walk(path, &nd);
778 + intent_init(&nd.intent, IT_GETATTR);
779 + error = user_path_walk_it(path, &nd);
782 inode = nd.dentry->d_inode;
783 @@ -390,9 +400,19 @@ asmlinkage long sys_utime(char __user *
784 (error = permission(inode,MAY_WRITE,&nd)) != 0)
787 - down(&inode->i_sem);
788 - error = notify_change(nd.dentry, &newattrs);
790 + if (inode->i_op->setattr_raw) {
791 + struct inode_operations *op = nd.dentry->d_inode->i_op;
793 + newattrs.ia_valid |= ATTR_RAW;
794 + error = op->setattr_raw(inode, &newattrs);
795 + /* the file system wants to use normal vfs path now */
796 + if (error != -EOPNOTSUPP)
799 + down(&inode->i_sem);
800 + error = notify_change(nd.dentry, &newattrs);
806 @@ -443,9 +463,19 @@ long do_utimes(char __user * filename, s
807 (error = permission(inode,MAY_WRITE,&nd)) != 0)
810 - down(&inode->i_sem);
811 - error = notify_change(nd.dentry, &newattrs);
813 + if (inode->i_op->setattr_raw) {
814 + struct inode_operations *op = nd.dentry->d_inode->i_op;
816 + newattrs.ia_valid |= ATTR_RAW;
817 + error = op->setattr_raw(inode, &newattrs);
818 + /* the file system wants to use normal vfs path now */
819 + if (error != -EOPNOTSUPP)
822 + down(&inode->i_sem);
823 + error = notify_change(nd.dentry, &newattrs);
829 @@ -473,6 +503,7 @@ asmlinkage long sys_access(const char __
830 int old_fsuid, old_fsgid;
831 kernel_cap_t old_cap;
833 + intent_init(&nd.intent, IT_GETATTR);
835 if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
837 @@ -497,13 +528,14 @@ asmlinkage long sys_access(const char __
839 current->cap_effective = current->cap_permitted;
841 - res = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
842 + res = __user_walk_it(filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
844 res = permission(nd.dentry->d_inode, mode, &nd);
845 /* SuS v2 requires we report a read only fs too */
846 if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
847 && !special_file(nd.dentry->d_inode->i_mode))
853 @@ -518,8 +550,9 @@ asmlinkage long sys_chdir(const char __u
857 + intent_init(&nd.intent, IT_GETATTR);
859 - error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
860 + error = __user_walk_it(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
864 @@ -571,8 +604,9 @@ asmlinkage long sys_chroot(const char __
868 + intent_init(&nd.intent, IT_GETATTR);
870 - error = __user_walk(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
871 + error = __user_walk_it(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
875 @@ -595,36 +629,52 @@ out:
877 EXPORT_SYMBOL_GPL(sys_chroot);
879 -asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
880 +int chmod_common(struct dentry *dentry, mode_t mode)
882 - struct inode * inode;
883 - struct dentry * dentry;
884 - struct file * file;
886 + struct inode * inode = dentry->d_inode;
887 struct iattr newattrs;
888 + int error = -EROFS;
892 + if (IS_RDONLY(inode))
895 + if (inode->i_op->setattr_raw) {
896 + struct inode_operations *op = dentry->d_inode->i_op;
898 - dentry = file->f_dentry;
899 - inode = dentry->d_inode;
900 + newattrs.ia_mode = mode;
901 + newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
902 + newattrs.ia_valid |= ATTR_RAW;
903 + error = op->setattr_raw(inode, &newattrs);
904 + /* the file system wants to use the normal vfs path now */
905 + if (error != -EOPNOTSUPP)
910 - if (IS_RDONLY(inode))
914 if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
919 if (mode == (mode_t) -1)
920 mode = inode->i_mode;
921 newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
922 newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
923 - err = notify_change(dentry, &newattrs);
924 + error = notify_change(dentry, &newattrs);
931 +asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
933 + struct file * file;
940 + err = chmod_common(file->f_dentry, mode);
944 @@ -633,32 +683,13 @@ out:
945 asmlinkage long sys_chmod(const char __user * filename, mode_t mode)
948 - struct inode * inode;
950 - struct iattr newattrs;
952 error = user_path_walk(filename, &nd);
955 - inode = nd.dentry->d_inode;
958 - if (IS_RDONLY(inode))
962 - if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
965 - down(&inode->i_sem);
966 - if (mode == (mode_t) -1)
967 - mode = inode->i_mode;
968 - newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
969 - newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
970 - error = notify_change(nd.dentry, &newattrs);
974 + error = chmod_common(nd.dentry, mode);
978 @@ -679,6 +710,18 @@ static int chown_common(struct dentry *
979 if (IS_RDONLY(inode))
982 + if (inode->i_op->setattr_raw) {
983 + struct inode_operations *op = dentry->d_inode->i_op;
985 + newattrs.ia_uid = user;
986 + newattrs.ia_gid = group;
987 + newattrs.ia_valid = ATTR_UID | ATTR_GID | ATTR_CTIME;
988 + newattrs.ia_valid |= ATTR_RAW;
989 + error = op->setattr_raw(inode, &newattrs);
990 + /* the file system wants to use normal vfs path now */
991 + if (error != -EOPNOTSUPP)
994 if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
996 newattrs.ia_valid = ATTR_CTIME;
997 @@ -692,6 +735,7 @@ static int chown_common(struct dentry *
999 if (!S_ISDIR(inode->i_mode))
1000 newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID;
1002 down(&inode->i_sem);
1003 error = notify_change(dentry, &newattrs);
1005 @@ -739,8 +783,6 @@ asmlinkage long sys_fchown(unsigned int
1009 -static struct file *__dentry_open(struct dentry *, struct vfsmount *, int, struct file *);
1012 * Note that while the flag value (low two bits) for sys_open means:
1014 @@ -758,8 +800,9 @@ static struct file *__dentry_open(struct
1015 struct file *filp_open(const char * filename, int flags, int mode)
1017 int namei_flags, error;
1018 + struct file * temp_filp;
1019 struct nameidata nd;
1021 + intent_init(&nd.intent, IT_OPEN);
1023 namei_flags = flags;
1024 if ((namei_flags+1) & O_ACCMODE)
1025 @@ -767,16 +810,11 @@ struct file *filp_open(const char * file
1026 if (namei_flags & O_TRUNC)
1030 - f = get_empty_filp();
1032 - return ERR_PTR(error);
1034 error = open_namei(filename, namei_flags, mode, &nd);
1036 - return __dentry_open(nd.dentry, nd.mnt, flags, f);
1040 + temp_filp = dentry_open_it(nd.dentry, nd.mnt, flags, &nd.intent);
1043 return ERR_PTR(error);
1046 @@ -784,29 +822,27 @@ EXPORT_SYMBOL(filp_open);
1048 struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
1052 + struct lookup_intent it;
1053 + intent_init(&it, IT_LOOKUP);
1056 - f = get_empty_filp();
1060 - return ERR_PTR(error);
1063 - return __dentry_open(dentry, mnt, flags, f);
1064 + return dentry_open_it(dentry, mnt, flags, &it);
1067 EXPORT_SYMBOL(dentry_open);
1069 -static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags, struct file *f)
1070 +struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, int flags, struct lookup_intent *it)
1073 struct inode *inode;
1077 + f = get_empty_filp();
1079 + goto cleanup_dentry;
1081 f->f_mode = ((flags+1) & O_ACCMODE) | FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
1083 inode = dentry->d_inode;
1084 if (f->f_mode & FMODE_WRITE) {
1085 error = get_write_access(inode);
1086 @@ -825,6 +861,7 @@ static struct file *__dentry_open(struct
1087 error = f->f_op->open(inode,f);
1090 + intent_release(it);
1092 f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
1094 @@ -849,6 +886,8 @@ cleanup_all:
1099 + intent_release(it);
1102 return ERR_PTR(error);
1103 diff -rup RH_2_6_9_55.orig/fs/stat.c RH_2_6_9_55/fs/stat.c
1104 --- RH_2_6_9_55.orig/fs/stat.c
1105 +++ RH_2_6_9_55/fs/stat.c
1106 @@ -37,7 +37,7 @@ void generic_fillattr(struct inode *inod
1108 EXPORT_SYMBOL(generic_fillattr);
1110 -int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
1111 +int vfs_getattr_it(struct vfsmount *mnt, struct dentry *dentry, struct lookup_intent *it, struct kstat *stat)
1113 struct inode *inode = dentry->d_inode;
1115 @@ -46,6 +46,8 @@ int vfs_getattr(struct vfsmount *mnt, st
1119 + if (inode->i_op->getattr_it)
1120 + return inode->i_op->getattr_it(mnt, dentry, it, stat);
1121 if (inode->i_op->getattr)
1122 return inode->i_op->getattr(mnt, dentry, stat);
1124 @@ -62,7 +64,7 @@ int vfs_getattr(struct vfsmount *mnt, st
1126 EXPORT_SYMBOL(vfs_getattr);
1128 -int vfs_getattr64(struct vfsmount *mnt, struct dentry *dentry, struct kstat64 *stat)
1129 +int vfs_getattr64_it(struct vfsmount *mnt, struct dentry *dentry, struct lookup_intent *it, struct kstat64 *stat)
1131 struct inode *inode = dentry->d_inode;
1133 @@ -79,6 +81,13 @@ int vfs_getattr64(struct vfsmount *mnt,
1134 return ixop->getattr64(mnt, dentry, stat);
1137 + if (inode->i_op->getattr_it) {
1138 + retval = inode->i_op->getattr_it(mnt, dentry, it, (struct kstat *) stat);
1140 + stat->ino64 = stat->ino;
1144 if (inode->i_op->getattr) {
1145 retval = inode->i_op->getattr(mnt, dentry, (struct kstat *) stat);
1147 @@ -98,16 +107,28 @@ int vfs_getattr64(struct vfsmount *mnt,
1152 EXPORT_SYMBOL(vfs_getattr64);
1154 +int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
1156 + return vfs_getattr_it(mnt, dentry, NULL, stat);
1159 +int vfs_getattr64(struct vfsmount *mnt, struct dentry *dentry, struct kstat64 *stat)
1161 + return vfs_getattr64_it(mnt, dentry, NULL, stat);
1164 int vfs_stat(char __user *name, struct kstat *stat)
1166 struct nameidata nd;
1168 + intent_init(&nd.intent, IT_GETATTR);
1170 - error = user_path_walk(name, &nd);
1171 + error = user_path_walk_it(name, &nd);
1173 - error = vfs_getattr(nd.mnt, nd.dentry, stat);
1174 + error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
1178 @@ -119,10 +140,11 @@ int vfs_lstat(char __user *name, struct
1180 struct nameidata nd;
1182 + intent_init(&nd.intent, IT_GETATTR);
1184 - error = user_path_walk_link(name, &nd);
1185 + error = user_path_walk_link_it(name, &nd);
1187 - error = vfs_getattr(nd.mnt, nd.dentry, stat);
1188 + error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
1192 @@ -134,9 +156,12 @@ int vfs_fstat(unsigned int fd, struct ks
1194 struct file *f = fget(fd);
1196 + struct nameidata nd;
1197 + intent_init(&nd.intent, IT_GETATTR);
1200 - error = vfs_getattr(f->f_vfsmnt, f->f_dentry, stat);
1201 + error = vfs_getattr_it(f->f_vfsmnt, f->f_dentry, &nd.intent, stat);
1202 + intent_release(&nd.intent);
1206 @@ -148,10 +173,11 @@ int vfs_stat64(char __user *name, struct
1208 struct nameidata nd;
1210 + intent_init(&nd.intent, IT_GETATTR);
1212 - error = user_path_walk(name, &nd);
1213 + error = user_path_walk_it(name, &nd);
1215 - error = vfs_getattr64(nd.mnt, nd.dentry, stat);
1216 + error = vfs_getattr64_it(nd.mnt, nd.dentry, &nd.intent, stat);
1220 @@ -163,10 +189,11 @@ int vfs_lstat64(char __user *name, struc
1222 struct nameidata nd;
1224 + intent_init(&nd.intent, IT_GETATTR);
1226 - error = user_path_walk_link(name, &nd);
1227 + error = user_path_walk_link_it(name, &nd);
1229 - error = vfs_getattr64(nd.mnt, nd.dentry, stat);
1230 + error = vfs_getattr64_it(nd.mnt, nd.dentry, &nd.intent, stat);
1234 @@ -178,9 +205,11 @@ int vfs_fstat64(unsigned int fd, struct
1236 struct file *f = fget(fd);
1238 + struct nameidata nd;
1239 + intent_init(&nd.intent, IT_GETATTR);
1242 - error = vfs_getattr64(f->f_vfsmnt, f->f_dentry, stat);
1243 + error = vfs_getattr64_it(f->f_vfsmnt, f->f_dentry, &nd.intent, stat);
1247 diff -rup RH_2_6_9_55.orig/include/linux/dcache.h RH_2_6_9_55/include/linux/dcache.h
1248 --- RH_2_6_9_55.orig/include/linux/dcache.h
1249 +++ RH_2_6_9_55/include/linux/dcache.h
1253 #include <asm/atomic.h>
1254 +#include <linux/string.h>
1255 #include <linux/list.h>
1256 #include <linux/spinlock.h>
1257 #include <linux/cache.h>
1258 @@ -37,6 +38,8 @@ struct qstr {
1259 const unsigned char *name;
1262 +#include <linux/namei.h>
1264 struct dentry_stat_t {
1267 diff -rup RH_2_6_9_55.orig/include/linux/fs.h RH_2_6_9_55/include/linux/fs.h
1268 --- RH_2_6_9_55.orig/include/linux/fs.h
1269 +++ RH_2_6_9_55/include/linux/fs.h
1270 @@ -266,6 +266,8 @@ typedef void (dio_iodone_t)(struct inode
1271 #define ATTR_ATTR_FLAG 1024
1272 #define ATTR_KILL_SUID 2048
1273 #define ATTR_KILL_SGID 4096
1274 +#define ATTR_RAW 8192 /* file system, not vfs will massage attrs */
1275 +#define ATTR_FROM_OPEN 16384 /* called from open path, ie O_TRUNC */
1278 * This is the Inode Attributes structure, used for notify_change(). It
1279 @@ -464,6 +466,7 @@ struct inode {
1280 struct block_device *i_bdev;
1281 struct cdev *i_cdev;
1283 + void *i_filterdata;
1287 @@ -597,6 +600,7 @@ struct file {
1288 spinlock_t f_ep_lock;
1289 #endif /* #ifdef CONFIG_EPOLL */
1290 struct address_space *f_mapping;
1291 + struct lookup_intent *f_it;
1293 extern spinlock_t files_lock;
1294 #define file_list_lock() spin_lock(&files_lock);
1295 @@ -967,20 +971,29 @@ struct inode_operations {
1296 int (*create) (struct inode *,struct dentry *,int, struct nameidata *);
1297 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
1298 int (*link) (struct dentry *,struct inode *,struct dentry *);
1299 + int (*link_raw) (struct nameidata *,struct nameidata *);
1300 int (*unlink) (struct inode *,struct dentry *);
1301 + int (*unlink_raw) (struct nameidata *);
1302 int (*symlink) (struct inode *,struct dentry *,const char *);
1303 + int (*symlink_raw) (struct nameidata *,const char *);
1304 int (*mkdir) (struct inode *,struct dentry *,int);
1305 + int (*mkdir_raw) (struct nameidata *,int);
1306 int (*rmdir) (struct inode *,struct dentry *);
1307 + int (*rmdir_raw) (struct nameidata *);
1308 int (*mknod) (struct inode *,struct dentry *,int,dev_t);
1309 + int (*mknod_raw) (struct nameidata *,int,dev_t);
1310 int (*rename) (struct inode *, struct dentry *,
1311 struct inode *, struct dentry *);
1312 + int (*rename_raw) (struct nameidata *, struct nameidata *);
1313 int (*readlink) (struct dentry *, char __user *,int);
1314 int (*follow_link) (struct dentry *, struct nameidata *);
1315 void (*put_link) (struct dentry *, struct nameidata *);
1316 void (*truncate) (struct inode *);
1317 int (*permission) (struct inode *, int, struct nameidata *);
1318 int (*setattr) (struct dentry *, struct iattr *);
1319 + int (*setattr_raw) (struct inode *, struct iattr *);
1320 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
1321 + int (*getattr_it) (struct vfsmount *, struct dentry *, struct lookup_intent *, struct kstat *);
1322 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
1323 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
1324 ssize_t (*listxattr) (struct dentry *, char *, size_t);
1325 @@ -1025,6 +1038,7 @@ struct super_operations {
1326 int (*remount_fs) (struct super_block *, int *, char *);
1327 void (*clear_inode) (struct inode *);
1328 void (*umount_begin) (struct super_block *);
1329 + void (*umount_lustre) (struct super_block *);
1331 int (*show_options)(struct seq_file *, struct vfsmount *);
1333 @@ -1217,6 +1231,7 @@ extern int unregister_filesystem(struct
1334 extern struct vfsmount *kern_mount(struct file_system_type *);
1335 extern int may_umount_tree(struct vfsmount *);
1336 extern int may_umount(struct vfsmount *);
1337 +struct vfsmount *do_kern_mount(const char *type, int flags, const char *name, void *data);
1338 extern long do_mount(char *, char *, char *, unsigned long, void *);
1340 extern int vfs_statfs(struct super_block *, struct kstatfs *);
1341 @@ -1277,10 +1292,10 @@ static inline int break_lease(struct ino
1346 extern int do_truncate(struct dentry *, loff_t start, unsigned int);
1347 extern struct file *filp_open(const char *, int, int);
1348 extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
1349 +extern struct file * dentry_open_it(struct dentry *, struct vfsmount *, int, struct lookup_intent *);
1350 extern int filp_close(struct file *, fl_owner_t id);
1351 extern char * getname(const char __user *);
1353 diff -rup RH_2_6_9_55.orig/include/linux/mount.h RH_2_6_9_55/include/linux/mount.h
1354 --- RH_2_6_9_55.orig/include/linux/mount.h
1355 +++ RH_2_6_9_55/include/linux/mount.h
1356 @@ -34,6 +34,7 @@ struct vfsmount
1357 struct list_head mnt_list;
1358 struct list_head mnt_fslink; /* link in fs-specific expiry list */
1359 struct namespace *mnt_namespace; /* containing namespace */
1360 + unsigned long mnt_last_used; /* for GNS auto-umount (jiffies) */
1363 static inline struct vfsmount *mntget(struct vfsmount *mnt)
1364 diff -rup RH_2_6_9_55.orig/include/linux/namei.h RH_2_6_9_55/include/linux/namei.h
1365 --- RH_2_6_9_55.orig/include/linux/namei.h
1366 +++ RH_2_6_9_55/include/linux/namei.h
1368 #define _LINUX_NAMEI_H
1370 #include <linux/linkage.h>
1371 +#include <linux/string.h>
1376 -struct open_intent {
1379 +/* intent opcodes */
1380 +#define IT_OPEN (1)
1381 +#define IT_CREAT (1<<1)
1382 +#define IT_READDIR (1<<2)
1383 +#define IT_GETATTR (1<<3)
1384 +#define IT_LOOKUP (1<<4)
1385 +#define IT_UNLINK (1<<5)
1386 +#define IT_TRUNC (1<<6)
1387 +#define IT_GETXATTR (1<<7)
1389 +struct lustre_intent_data {
1390 + int it_disposition;
1392 + __u64 it_lock_handle;
1397 +#define INTENT_MAGIC 0x19620323
1398 +struct lookup_intent {
1400 + void (*it_op_release)(struct lookup_intent *);
1403 + int it_create_mode;
1405 + struct lustre_intent_data lustre;
1409 +static inline void intent_reset_fs_part(struct lookup_intent *it)
1411 + memset(&it->d, 0, sizeof(it->d));
1412 + it->it_magic = INTENT_MAGIC;
1413 + it->it_op_release = NULL;
1416 +static inline void intent_init(struct lookup_intent *it, int op)
1418 + memset(it, 0, sizeof(*it));
1419 + it->it_magic = INTENT_MAGIC;
1423 enum { MAX_NESTED_LINKS = 8 };
1426 @@ -21,10 +62,7 @@ struct nameidata {
1428 char *saved_names[MAX_NESTED_LINKS + 1];
1432 - struct open_intent open;
1434 + struct lookup_intent intent;
1438 @@ -47,6 +85,8 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
1439 #define LOOKUP_NOALT 32
1440 #define LOOKUP_ATOMIC 64
1441 #define LOOKUP_REVAL 128
1442 +#define LOOKUP_LAST (0x1000)
1443 +#define LOOKUP_LINK_NOTLAST (0x2000)
1447 @@ -56,11 +96,18 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
1448 #define LOOKUP_ACCESS (0x0400)
1450 extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *));
1451 +extern int FASTCALL(__user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd));
1452 +#define user_path_walk_it(name,nd) \
1453 + __user_walk_it(name, LOOKUP_FOLLOW, nd)
1454 +#define user_path_walk_link_it(name,nd) \
1455 + __user_walk_it(name, 0, nd)
1456 +extern void intent_release(struct lookup_intent *);
1457 #define user_path_walk(name,nd) \
1458 __user_walk(name, LOOKUP_FOLLOW, nd)
1459 #define user_path_walk_link(name,nd) \
1460 __user_walk(name, 0, nd)
1461 extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
1462 +extern int FASTCALL(path_lookup_it(const char *, unsigned, struct nameidata *));
1463 extern int FASTCALL(path_walk(const char *, struct nameidata *));
1464 extern int FASTCALL(link_path_walk(const char *, struct nameidata *));
1465 extern void path_release(struct nameidata *);