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 @@ -61,6 +61,7 @@ struct vfsmount *alloc_vfsmnt(const char
585 INIT_LIST_HEAD(&mnt->mnt_mounts);
586 INIT_LIST_HEAD(&mnt->mnt_list);
587 INIT_LIST_HEAD(&mnt->mnt_fslink);
588 + INIT_LIST_HEAD(&mnt->mnt_lustre_list);
590 int size = strlen(name)+1;
591 char *newname = kmalloc(size, GFP_KERNEL);
592 @@ -114,6 +115,7 @@ static inline int check_mnt(struct vfsmo
594 static void detach_mnt(struct vfsmount *mnt, struct nameidata *old_nd)
596 + memset(old_nd, 0, sizeof(*old_nd));
597 old_nd->dentry = mnt->mnt_mountpoint;
598 old_nd->mnt = mnt->mnt_parent;
599 mnt->mnt_parent = mnt;
600 @@ -441,6 +442,8 @@ static int do_umount(struct vfsmount *mn
604 + if (sb->s_op->umount_lustre)
605 + sb->s_op->umount_lustre(sb);
606 if( (flags&MNT_FORCE) && sb->s_op->umount_begin)
607 sb->s_op->umount_begin(sb);
609 @@ -665,7 +668,8 @@ static int do_loopback(struct nameidata
611 if (!old_name || !*old_name)
613 - err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
614 + intent_init(&old_nd.intent, IT_LOOKUP);
615 + err = path_lookup_it(old_name, LOOKUP_FOLLOW, &old_nd);
619 @@ -739,7 +743,8 @@ static int do_move_mount(struct nameidat
621 if (!old_name || !*old_name)
623 - err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
624 + intent_init(&old_nd.intent, IT_LOOKUP);
625 + err = path_lookup_it(old_name, LOOKUP_FOLLOW, &old_nd);
629 @@ -1074,7 +1079,8 @@ long do_mount(char * dev_name, char * di
630 flags &= ~(MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_ACTIVE);
632 /* ... and get the mountpoint */
633 - retval = path_lookup(dir_name, LOOKUP_FOLLOW, &nd);
634 + intent_init(&nd.intent, IT_LOOKUP);
635 + retval = path_lookup_it(dir_name, LOOKUP_FOLLOW, &nd);
639 diff -rup RH_2_6_9_55.orig/fs/nfs/dir.c RH_2_6_9_55/fs/nfs/dir.c
640 --- RH_2_6_9_55.orig/fs/nfs/dir.c
641 +++ RH_2_6_9_55/fs/nfs/dir.c
642 @@ -839,7 +839,7 @@ int nfs_is_exclusive_create(struct inode
644 if (!nd || (nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_CREATE))
646 - return (nd->intent.open.flags & O_EXCL) != 0;
647 + return (nd->intent.it_flags & O_EXCL) != 0;
650 static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
651 @@ -915,7 +915,7 @@ static int is_atomic_open(struct inode *
652 if (nd->flags & LOOKUP_DIRECTORY)
654 /* Are we trying to write to a read only partition? */
655 - if (IS_RDONLY(dir) && (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
656 + if (IS_RDONLY(dir) && (nd->intent.it_flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
660 @@ -936,7 +936,7 @@ static struct dentry *nfs_atomic_lookup(
661 dentry->d_op = NFS_PROTO(dir)->dentry_ops;
663 /* Let vfs_create() deal with O_EXCL */
664 - if (nd->intent.open.flags & O_EXCL)
665 + if (nd->intent.it_flags & O_EXCL)
668 /* Open the file on the server */
669 @@ -948,7 +948,7 @@ static struct dentry *nfs_atomic_lookup(
673 - if (nd->intent.open.flags & O_CREAT) {
674 + if (nd->intent.it_flags & O_CREAT) {
675 nfs_begin_data_update(dir);
676 inode = nfs4_atomic_open(dir, dentry, nd);
677 nfs_end_data_update(dir);
678 @@ -967,7 +967,7 @@ static struct dentry *nfs_atomic_lookup(
682 - if (!(nd->intent.open.flags & O_NOFOLLOW))
683 + if (!(nd->intent.it_flags & O_NOFOLLOW))
687 @@ -1005,7 +1005,7 @@ static int nfs_open_revalidate(struct de
688 /* NFS only supports OPEN on regular files */
689 if (!S_ISREG(inode->i_mode))
691 - openflags = nd->intent.open.flags;
692 + openflags = nd->intent.it_flags;
693 /* We cannot do exclusive creation on a positive dentry */
694 if ((openflags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL))
696 @@ -1213,7 +1213,7 @@ static int nfs_create(struct inode *dir,
697 attr.ia_valid = ATTR_MODE;
699 if (nd && (nd->flags & LOOKUP_CREATE))
700 - open_flags = nd->intent.open.flags;
701 + open_flags = nd->intent.it_flags;
704 * The 0 argument passed into the create function should one day
705 diff -rup RH_2_6_9_55.orig/fs/nfs/nfs4proc.c RH_2_6_9_55/fs/nfs/nfs4proc.c
706 --- RH_2_6_9_55.orig/fs/nfs/nfs4proc.c
707 +++ RH_2_6_9_55/fs/nfs/nfs4proc.c
708 @@ -770,17 +770,17 @@ nfs4_atomic_open(struct inode *dir, stru
709 struct nfs4_state *state;
711 if (nd->flags & LOOKUP_CREATE) {
712 - attr.ia_mode = nd->intent.open.create_mode;
713 + attr.ia_mode = nd->intent.it_create_mode;
714 attr.ia_valid = ATTR_MODE;
715 if (!IS_POSIXACL(dir))
716 attr.ia_mode &= ~current->fs->umask;
719 - BUG_ON(nd->intent.open.flags & O_CREAT);
720 + BUG_ON(nd->intent.it_flags & O_CREAT);
723 cred = rpcauth_lookupcred(NFS_SERVER(dir)->client->cl_auth, 0);
724 - state = nfs4_do_open(dir, &dentry->d_name, nd->intent.open.flags, &attr, cred);
725 + state = nfs4_do_open(dir, &dentry->d_name, nd->intent.it_flags, &attr, cred);
728 return (struct inode *)state;
729 diff -rup RH_2_6_9_55.orig/fs/open.c RH_2_6_9_55/fs/open.c
730 --- RH_2_6_9_55.orig/fs/open.c
731 +++ RH_2_6_9_55/fs/open.c
732 @@ -195,6 +195,7 @@ out:
733 int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs)
736 + struct inode_operations *op = dentry->d_inode->i_op;
737 struct iattr newattrs;
739 /* Not pretty: "inode->i_size" shouldn't really be signed. But it is. */
740 @@ -204,8 +205,16 @@ int do_truncate(struct dentry *dentry, l
741 newattrs.ia_size = length;
742 newattrs.ia_valid = ATTR_SIZE | time_attrs;
743 down(&dentry->d_inode->i_sem);
744 - err = notify_change(dentry, &newattrs);
745 - up(&dentry->d_inode->i_sem);
746 + if (op->setattr_raw) {
747 + newattrs.ia_valid |= ATTR_RAW;
748 + newattrs.ia_ctime = CURRENT_TIME;
749 + down_write(&dentry->d_inode->i_alloc_sem);
750 + err = op->setattr_raw(dentry->d_inode, &newattrs);
751 + up_write(&dentry->d_inode->i_alloc_sem);
753 + err = notify_change(dentry, &newattrs);
754 + up(&dentry->d_inode->i_sem);
759 @@ -214,12 +223,13 @@ static inline long do_sys_truncate(const
761 struct inode * inode;
766 if (length < 0) /* sorry, but loff_t says... */
769 - error = user_path_walk(path, &nd);
771 + intent_init(&nd.intent, IT_GETATTR);
772 + error = user_path_walk_it(path, &nd);
775 inode = nd.dentry->d_inode;
776 @@ -390,9 +400,19 @@ asmlinkage long sys_utime(char __user *
777 (error = permission(inode,MAY_WRITE,&nd)) != 0)
780 - down(&inode->i_sem);
781 - error = notify_change(nd.dentry, &newattrs);
783 + if (inode->i_op->setattr_raw) {
784 + struct inode_operations *op = nd.dentry->d_inode->i_op;
786 + newattrs.ia_valid |= ATTR_RAW;
787 + error = op->setattr_raw(inode, &newattrs);
788 + /* the file system wants to use normal vfs path now */
789 + if (error != -EOPNOTSUPP)
792 + down(&inode->i_sem);
793 + error = notify_change(nd.dentry, &newattrs);
799 @@ -443,9 +463,19 @@ long do_utimes(char __user * filename, s
800 (error = permission(inode,MAY_WRITE,&nd)) != 0)
803 - down(&inode->i_sem);
804 - error = notify_change(nd.dentry, &newattrs);
806 + if (inode->i_op->setattr_raw) {
807 + struct inode_operations *op = nd.dentry->d_inode->i_op;
809 + newattrs.ia_valid |= ATTR_RAW;
810 + error = op->setattr_raw(inode, &newattrs);
811 + /* the file system wants to use normal vfs path now */
812 + if (error != -EOPNOTSUPP)
815 + down(&inode->i_sem);
816 + error = notify_change(nd.dentry, &newattrs);
822 @@ -473,6 +503,7 @@ asmlinkage long sys_access(const char __
823 int old_fsuid, old_fsgid;
824 kernel_cap_t old_cap;
826 + intent_init(&nd.intent, IT_GETATTR);
828 if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
830 @@ -497,13 +528,14 @@ asmlinkage long sys_access(const char __
832 current->cap_effective = current->cap_permitted;
834 - res = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
835 + res = __user_walk_it(filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
837 res = permission(nd.dentry->d_inode, mode, &nd);
838 /* SuS v2 requires we report a read only fs too */
839 if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
840 && !special_file(nd.dentry->d_inode->i_mode))
846 @@ -518,8 +550,9 @@ asmlinkage long sys_chdir(const char __u
850 + intent_init(&nd.intent, IT_GETATTR);
852 - error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
853 + error = __user_walk_it(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
857 @@ -571,8 +604,9 @@ asmlinkage long sys_chroot(const char __
861 + intent_init(&nd.intent, IT_GETATTR);
863 - error = __user_walk(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
864 + error = __user_walk_it(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
868 @@ -595,36 +629,52 @@ out:
870 EXPORT_SYMBOL_GPL(sys_chroot);
872 -asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
873 +int chmod_common(struct dentry *dentry, mode_t mode)
875 - struct inode * inode;
876 - struct dentry * dentry;
877 - struct file * file;
879 + struct inode * inode = dentry->d_inode;
880 struct iattr newattrs;
881 + int error = -EROFS;
885 + if (IS_RDONLY(inode))
888 + if (inode->i_op->setattr_raw) {
889 + struct inode_operations *op = dentry->d_inode->i_op;
891 - dentry = file->f_dentry;
892 - inode = dentry->d_inode;
893 + newattrs.ia_mode = mode;
894 + newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
895 + newattrs.ia_valid |= ATTR_RAW;
896 + error = op->setattr_raw(inode, &newattrs);
897 + /* the file system wants to use the normal vfs path now */
898 + if (error != -EOPNOTSUPP)
903 - if (IS_RDONLY(inode))
907 if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
912 if (mode == (mode_t) -1)
913 mode = inode->i_mode;
914 newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
915 newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
916 - err = notify_change(dentry, &newattrs);
917 + error = notify_change(dentry, &newattrs);
924 +asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
926 + struct file * file;
933 + err = chmod_common(file->f_dentry, mode);
937 @@ -633,32 +683,13 @@ out:
938 asmlinkage long sys_chmod(const char __user * filename, mode_t mode)
941 - struct inode * inode;
943 - struct iattr newattrs;
945 error = user_path_walk(filename, &nd);
948 - inode = nd.dentry->d_inode;
951 - if (IS_RDONLY(inode))
955 - if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
958 - down(&inode->i_sem);
959 - if (mode == (mode_t) -1)
960 - mode = inode->i_mode;
961 - newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
962 - newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
963 - error = notify_change(nd.dentry, &newattrs);
967 + error = chmod_common(nd.dentry, mode);
971 @@ -679,6 +710,18 @@ static int chown_common(struct dentry *
972 if (IS_RDONLY(inode))
975 + if (inode->i_op->setattr_raw) {
976 + struct inode_operations *op = dentry->d_inode->i_op;
978 + newattrs.ia_uid = user;
979 + newattrs.ia_gid = group;
980 + newattrs.ia_valid = ATTR_UID | ATTR_GID | ATTR_CTIME;
981 + newattrs.ia_valid |= ATTR_RAW;
982 + error = op->setattr_raw(inode, &newattrs);
983 + /* the file system wants to use normal vfs path now */
984 + if (error != -EOPNOTSUPP)
987 if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
989 newattrs.ia_valid = ATTR_CTIME;
990 @@ -692,6 +735,7 @@ static int chown_common(struct dentry *
992 if (!S_ISDIR(inode->i_mode))
993 newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID;
996 error = notify_change(dentry, &newattrs);
998 @@ -739,8 +783,6 @@ asmlinkage long sys_fchown(unsigned int
1002 -static struct file *__dentry_open(struct dentry *, struct vfsmount *, int, struct file *);
1005 * Note that while the flag value (low two bits) for sys_open means:
1007 @@ -758,8 +800,9 @@ static struct file *__dentry_open(struct
1008 struct file *filp_open(const char * filename, int flags, int mode)
1010 int namei_flags, error;
1011 + struct file * temp_filp;
1012 struct nameidata nd;
1014 + intent_init(&nd.intent, IT_OPEN);
1016 namei_flags = flags;
1017 if ((namei_flags+1) & O_ACCMODE)
1018 @@ -767,16 +810,11 @@ struct file *filp_open(const char * file
1019 if (namei_flags & O_TRUNC)
1023 - f = get_empty_filp();
1025 - return ERR_PTR(error);
1027 error = open_namei(filename, namei_flags, mode, &nd);
1029 - return __dentry_open(nd.dentry, nd.mnt, flags, f);
1033 + temp_filp = dentry_open_it(nd.dentry, nd.mnt, flags, &nd.intent);
1036 return ERR_PTR(error);
1039 @@ -784,29 +822,27 @@ EXPORT_SYMBOL(filp_open);
1041 struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
1045 + struct lookup_intent it;
1046 + intent_init(&it, IT_LOOKUP);
1049 - f = get_empty_filp();
1053 - return ERR_PTR(error);
1056 - return __dentry_open(dentry, mnt, flags, f);
1057 + return dentry_open_it(dentry, mnt, flags, &it);
1060 EXPORT_SYMBOL(dentry_open);
1062 -static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags, struct file *f)
1063 +struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, int flags, struct lookup_intent *it)
1066 struct inode *inode;
1070 + f = get_empty_filp();
1072 + goto cleanup_dentry;
1074 f->f_mode = ((flags+1) & O_ACCMODE) | FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
1076 inode = dentry->d_inode;
1077 if (f->f_mode & FMODE_WRITE) {
1078 error = get_write_access(inode);
1079 @@ -825,6 +861,7 @@ static struct file *__dentry_open(struct
1080 error = f->f_op->open(inode,f);
1083 + intent_release(it);
1085 f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
1087 @@ -849,6 +886,8 @@ cleanup_all:
1092 + intent_release(it);
1095 return ERR_PTR(error);
1096 diff -rup RH_2_6_9_55.orig/fs/stat.c RH_2_6_9_55/fs/stat.c
1097 --- RH_2_6_9_55.orig/fs/stat.c
1098 +++ RH_2_6_9_55/fs/stat.c
1099 @@ -37,7 +37,7 @@ void generic_fillattr(struct inode *inod
1101 EXPORT_SYMBOL(generic_fillattr);
1103 -int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
1104 +int vfs_getattr_it(struct vfsmount *mnt, struct dentry *dentry, struct lookup_intent *it, struct kstat *stat)
1106 struct inode *inode = dentry->d_inode;
1108 @@ -46,6 +46,8 @@ int vfs_getattr(struct vfsmount *mnt, st
1112 + if (inode->i_op->getattr_it)
1113 + return inode->i_op->getattr_it(mnt, dentry, it, stat);
1114 if (inode->i_op->getattr)
1115 return inode->i_op->getattr(mnt, dentry, stat);
1117 @@ -62,7 +64,7 @@ int vfs_getattr(struct vfsmount *mnt, st
1119 EXPORT_SYMBOL(vfs_getattr);
1121 -int vfs_getattr64(struct vfsmount *mnt, struct dentry *dentry, struct kstat64 *stat)
1122 +int vfs_getattr64_it(struct vfsmount *mnt, struct dentry *dentry, struct lookup_intent *it, struct kstat64 *stat)
1124 struct inode *inode = dentry->d_inode;
1126 @@ -79,6 +81,13 @@ int vfs_getattr64(struct vfsmount *mnt,
1127 return ixop->getattr64(mnt, dentry, stat);
1130 + if (inode->i_op->getattr_it) {
1131 + retval = inode->i_op->getattr_it(mnt, dentry, it, (struct kstat *) stat);
1133 + stat->ino64 = stat->ino;
1137 if (inode->i_op->getattr) {
1138 retval = inode->i_op->getattr(mnt, dentry, (struct kstat *) stat);
1140 @@ -98,16 +107,28 @@ int vfs_getattr64(struct vfsmount *mnt,
1145 EXPORT_SYMBOL(vfs_getattr64);
1147 +int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
1149 + return vfs_getattr_it(mnt, dentry, NULL, stat);
1152 +int vfs_getattr64(struct vfsmount *mnt, struct dentry *dentry, struct kstat64 *stat)
1154 + return vfs_getattr64_it(mnt, dentry, NULL, stat);
1157 int vfs_stat(char __user *name, struct kstat *stat)
1159 struct nameidata nd;
1161 + intent_init(&nd.intent, IT_GETATTR);
1163 - error = user_path_walk(name, &nd);
1164 + error = user_path_walk_it(name, &nd);
1166 - error = vfs_getattr(nd.mnt, nd.dentry, stat);
1167 + error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
1171 @@ -119,10 +140,11 @@ int vfs_lstat(char __user *name, struct
1173 struct nameidata nd;
1175 + intent_init(&nd.intent, IT_GETATTR);
1177 - error = user_path_walk_link(name, &nd);
1178 + error = user_path_walk_link_it(name, &nd);
1180 - error = vfs_getattr(nd.mnt, nd.dentry, stat);
1181 + error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
1185 @@ -134,9 +156,12 @@ int vfs_fstat(unsigned int fd, struct ks
1187 struct file *f = fget(fd);
1189 + struct nameidata nd;
1190 + intent_init(&nd.intent, IT_GETATTR);
1193 - error = vfs_getattr(f->f_vfsmnt, f->f_dentry, stat);
1194 + error = vfs_getattr_it(f->f_vfsmnt, f->f_dentry, &nd.intent, stat);
1195 + intent_release(&nd.intent);
1199 @@ -148,10 +173,11 @@ int vfs_stat64(char __user *name, struct
1201 struct nameidata nd;
1203 + intent_init(&nd.intent, IT_GETATTR);
1205 error = user_path_walk(name, &nd);
1207 - error = vfs_getattr64(nd.mnt, nd.dentry, stat);
1208 + error = vfs_getattr64_it(nd.mnt, nd.dentry, &nd.intent, stat);
1212 @@ -163,10 +189,11 @@ int vfs_lstat64(char __user *name, struc
1214 struct nameidata nd;
1216 + intent_init(&nd.intent, IT_GETATTR);
1218 error = user_path_walk_link(name, &nd);
1220 - error = vfs_getattr64(nd.mnt, nd.dentry, stat);
1221 + error = vfs_getattr64_it(nd.mnt, nd.dentry, &nd.intent, stat);
1225 @@ -178,9 +205,11 @@ int vfs_fstat64(unsigned int fd, struct
1227 struct file *f = fget(fd);
1229 + struct nameidata nd;
1230 + intent_init(&nd.intent, IT_GETATTR);
1233 - error = vfs_getattr64(f->f_vfsmnt, f->f_dentry, stat);
1234 + error = vfs_getattr64_it(f->f_vfsmnt, f->f_dentry, &nd.intent, stat);
1238 diff -rup RH_2_6_9_55.orig/include/linux/dcache.h RH_2_6_9_55/include/linux/dcache.h
1239 --- RH_2_6_9_55.orig/include/linux/dcache.h
1240 +++ RH_2_6_9_55/include/linux/dcache.h
1244 #include <asm/atomic.h>
1245 +#include <linux/string.h>
1246 #include <linux/list.h>
1247 #include <linux/spinlock.h>
1248 #include <linux/cache.h>
1249 @@ -37,6 +38,8 @@ struct qstr {
1250 const unsigned char *name;
1253 +#include <linux/namei.h>
1255 struct dentry_stat_t {
1258 diff -rup RH_2_6_9_55.orig/include/linux/fs.h RH_2_6_9_55/include/linux/fs.h
1259 --- RH_2_6_9_55.orig/include/linux/fs.h
1260 +++ RH_2_6_9_55/include/linux/fs.h
1261 @@ -266,6 +266,8 @@ typedef void (dio_iodone_t)(struct inode
1262 #define ATTR_ATTR_FLAG 1024
1263 #define ATTR_KILL_SUID 2048
1264 #define ATTR_KILL_SGID 4096
1265 +#define ATTR_RAW 8192 /* file system, not vfs will massage attrs */
1266 +#define ATTR_FROM_OPEN 16384 /* called from open path, ie O_TRUNC */
1269 * This is the Inode Attributes structure, used for notify_change(). It
1270 @@ -464,6 +466,7 @@ struct inode {
1271 struct block_device *i_bdev;
1272 struct cdev *i_cdev;
1274 + void *i_filterdata;
1278 @@ -597,6 +600,7 @@ struct file {
1279 spinlock_t f_ep_lock;
1280 #endif /* #ifdef CONFIG_EPOLL */
1281 struct address_space *f_mapping;
1282 + struct lookup_intent *f_it;
1284 extern spinlock_t files_lock;
1285 #define file_list_lock() spin_lock(&files_lock);
1286 @@ -967,20 +971,29 @@ struct inode_operations {
1287 int (*create) (struct inode *,struct dentry *,int, struct nameidata *);
1288 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
1289 int (*link) (struct dentry *,struct inode *,struct dentry *);
1290 + int (*link_raw) (struct nameidata *,struct nameidata *);
1291 int (*unlink) (struct inode *,struct dentry *);
1292 + int (*unlink_raw) (struct nameidata *);
1293 int (*symlink) (struct inode *,struct dentry *,const char *);
1294 + int (*symlink_raw) (struct nameidata *,const char *);
1295 int (*mkdir) (struct inode *,struct dentry *,int);
1296 + int (*mkdir_raw) (struct nameidata *,int);
1297 int (*rmdir) (struct inode *,struct dentry *);
1298 + int (*rmdir_raw) (struct nameidata *);
1299 int (*mknod) (struct inode *,struct dentry *,int,dev_t);
1300 + int (*mknod_raw) (struct nameidata *,int,dev_t);
1301 int (*rename) (struct inode *, struct dentry *,
1302 struct inode *, struct dentry *);
1303 + int (*rename_raw) (struct nameidata *, struct nameidata *);
1304 int (*readlink) (struct dentry *, char __user *,int);
1305 int (*follow_link) (struct dentry *, struct nameidata *);
1306 void (*put_link) (struct dentry *, struct nameidata *);
1307 void (*truncate) (struct inode *);
1308 int (*permission) (struct inode *, int, struct nameidata *);
1309 int (*setattr) (struct dentry *, struct iattr *);
1310 + int (*setattr_raw) (struct inode *, struct iattr *);
1311 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
1312 + int (*getattr_it) (struct vfsmount *, struct dentry *, struct lookup_intent *, struct kstat *);
1313 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
1314 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
1315 ssize_t (*listxattr) (struct dentry *, char *, size_t);
1316 @@ -1025,6 +1038,7 @@ struct super_operations {
1317 int (*remount_fs) (struct super_block *, int *, char *);
1318 void (*clear_inode) (struct inode *);
1319 void (*umount_begin) (struct super_block *);
1320 + void (*umount_lustre) (struct super_block *);
1322 int (*show_options)(struct seq_file *, struct vfsmount *);
1324 @@ -1217,6 +1231,7 @@ extern int unregister_filesystem(struct
1325 extern struct vfsmount *kern_mount(struct file_system_type *);
1326 extern int may_umount_tree(struct vfsmount *);
1327 extern int may_umount(struct vfsmount *);
1328 +struct vfsmount *do_kern_mount(const char *type, int flags, const char *name, void *data);
1329 extern long do_mount(char *, char *, char *, unsigned long, void *);
1331 extern int vfs_statfs(struct super_block *, struct kstatfs *);
1332 @@ -1277,10 +1292,10 @@ static inline int break_lease(struct ino
1337 extern int do_truncate(struct dentry *, loff_t start, unsigned int);
1338 extern struct file *filp_open(const char *, int, int);
1339 extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
1340 +extern struct file * dentry_open_it(struct dentry *, struct vfsmount *, int, struct lookup_intent *);
1341 extern int filp_close(struct file *, fl_owner_t id);
1342 extern char * getname(const char __user *);
1344 diff -rup RH_2_6_9_55.orig/include/linux/mount.h RH_2_6_9_55/include/linux/mount.h
1345 --- RH_2_6_9_55.orig/include/linux/mount.h
1346 +++ RH_2_6_9_55/include/linux/mount.h
1347 @@ -34,6 +34,8 @@ struct vfsmount
1348 struct list_head mnt_list;
1349 struct list_head mnt_fslink; /* link in fs-specific expiry list */
1350 struct namespace *mnt_namespace; /* containing namespace */
1351 + struct list_head mnt_lustre_list; /* GNS mount list */
1352 + unsigned long mnt_last_used; /* for GNS auto-umount (jiffies) */
1355 static inline struct vfsmount *mntget(struct vfsmount *mnt)
1356 diff -rup RH_2_6_9_55.orig/include/linux/namei.h RH_2_6_9_55/include/linux/namei.h
1357 --- RH_2_6_9_55.orig/include/linux/namei.h
1358 +++ RH_2_6_9_55/include/linux/namei.h
1360 #define _LINUX_NAMEI_H
1362 #include <linux/linkage.h>
1363 +#include <linux/string.h>
1368 -struct open_intent {
1371 +/* intent opcodes */
1372 +#define IT_OPEN (1)
1373 +#define IT_CREAT (1<<1)
1374 +#define IT_READDIR (1<<2)
1375 +#define IT_GETATTR (1<<3)
1376 +#define IT_LOOKUP (1<<4)
1377 +#define IT_UNLINK (1<<5)
1378 +#define IT_TRUNC (1<<6)
1379 +#define IT_GETXATTR (1<<7)
1381 +struct lustre_intent_data {
1382 + int it_disposition;
1384 + __u64 it_lock_handle;
1389 +#define INTENT_MAGIC 0x19620323
1390 +struct lookup_intent {
1392 + void (*it_op_release)(struct lookup_intent *);
1395 + int it_create_mode;
1397 + struct lustre_intent_data lustre;
1401 +static inline void intent_reset_fs_part(struct lookup_intent *it)
1403 + memset(&it->d, 0, sizeof(it->d));
1404 + it->it_magic = INTENT_MAGIC;
1405 + it->it_op_release = NULL;
1408 +static inline void intent_init(struct lookup_intent *it, int op)
1410 + memset(it, 0, sizeof(*it));
1411 + it->it_magic = INTENT_MAGIC;
1415 enum { MAX_NESTED_LINKS = 8 };
1418 @@ -21,10 +62,7 @@ struct nameidata {
1420 char *saved_names[MAX_NESTED_LINKS + 1];
1424 - struct open_intent open;
1426 + struct lookup_intent intent;
1430 @@ -47,6 +85,8 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
1431 #define LOOKUP_NOALT 32
1432 #define LOOKUP_ATOMIC 64
1433 #define LOOKUP_REVAL 128
1434 +#define LOOKUP_LAST (0x1000)
1435 +#define LOOKUP_LINK_NOTLAST (0x2000)
1439 @@ -56,11 +96,18 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
1440 #define LOOKUP_ACCESS (0x0400)
1442 extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *));
1443 +extern int FASTCALL(__user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd));
1444 +#define user_path_walk_it(name,nd) \
1445 + __user_walk_it(name, LOOKUP_FOLLOW, nd)
1446 +#define user_path_walk_link_it(name,nd) \
1447 + __user_walk_it(name, 0, nd)
1448 +extern void intent_release(struct lookup_intent *);
1449 #define user_path_walk(name,nd) \
1450 __user_walk(name, LOOKUP_FOLLOW, nd)
1451 #define user_path_walk_link(name,nd) \
1452 __user_walk(name, 0, nd)
1453 extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
1454 +extern int FASTCALL(path_lookup_it(const char *, unsigned, struct nameidata *));
1455 extern int FASTCALL(path_walk(const char *, struct nameidata *));
1456 extern int FASTCALL(link_path_walk(const char *, struct nameidata *));
1457 extern void path_release(struct nameidata *);