4 fs/namei.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++---
5 fs/namespace.c | 10 +++++
6 fs/open.c | 57 ++++++++++++++--------------
7 fs/stat.c | 24 +++++++++---
8 include/linux/dcache.h | 3 +
9 include/linux/fs.h | 10 +++++
10 include/linux/mount.h | 2 +
11 include/linux/namei.h | 61 ++++++++++++++++++++++++++----
12 10 files changed, 225 insertions(+), 55 deletions(-)
14 --- linux-2.6.9.orig/fs/exec.c
15 +++ linux-2.6.9/fs/exec.c
16 @@ -126,9 +126,10 @@ asmlinkage long sys_uselib(const char __
20 + intent_init(&nd.intent, IT_OPEN);
22 - nd.intent.open.flags = FMODE_READ;
23 - error = __user_walk(library, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
24 + nd.intent.it_flags = FMODE_READ|FMODE_EXEC;
25 + error = __user_walk_it(library, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
29 @@ -140,7 +141,7 @@ asmlinkage long sys_uselib(const char __
33 - file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
34 + file = dentry_open_it(nd.dentry, nd.mnt, O_RDONLY, &nd.intent);
35 error = PTR_ERR(file);
38 @@ -489,8 +490,9 @@ struct file *open_exec(const char *name)
42 - nd.intent.open.flags = FMODE_READ;
43 - err = path_lookup(name, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
44 + intent_init(&nd.intent, IT_OPEN);
45 + nd.intent.it_flags = FMODE_READ|FMODE_EXEC;
46 + err = path_lookup(name, LOOKUP_FOLLOW, &nd);
50 @@ -503,7 +505,7 @@ struct file *open_exec(const char *name)
54 - file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
55 + file = dentry_open_it(nd.dentry, nd.mnt, O_RDONLY, &nd.intent);
57 err = deny_write_access(file);
59 --- linux-2.6.9.orig/fs/inode.c
60 +++ linux-2.6.9/fs/inode.c
61 @@ -235,6 +235,7 @@ void __iget(struct inode * inode)
62 inodes_stat.nr_unused--;
65 +EXPORT_SYMBOL(__iget);
67 * clear_inode - clear an inode
68 * @inode: inode to clear
69 --- linux-2.6.9.orig/fs/namei.c
70 +++ linux-2.6.9/fs/namei.c
71 @@ -274,8 +274,19 @@ int deny_write_access(struct file * file
75 +void intent_release(struct lookup_intent *it)
79 + if (it->it_magic != INTENT_MAGIC)
81 + if (it->it_op_release)
82 + it->it_op_release(it);
85 void path_release(struct nameidata *nd)
87 + intent_release(&nd->intent);
91 @@ -367,7 +378,10 @@ static struct dentry * real_lookup(struc
93 struct dentry * result;
94 struct inode *dir = parent->d_inode;
101 * First re-do the cached lookup just in case it was created
102 @@ -406,7 +420,10 @@ static struct dentry * real_lookup(struc
103 if (result->d_op && result->d_op->d_revalidate) {
104 if (!result->d_op->d_revalidate(result, nd) && !d_invalidate(result)) {
106 - result = ERR_PTR(-ENOENT);
108 + result = ERR_PTR(-ESTALE);
109 + if (!IS_ERR(result))
114 @@ -437,6 +454,7 @@ static inline int __vfs_follow_link(stru
122 @@ -446,6 +464,7 @@ static inline int __vfs_follow_link(stru
123 /* weird __emul_prefix() stuff did it */
126 + intent_reset_fs_part(&nd->intent);
127 res = link_path_walk(link, nd);
129 if (nd->depth || res || nd->last_type!=LAST_NORM)
130 @@ -654,6 +673,33 @@ fail:
131 return PTR_ERR(dentry);
134 +static int revalidate_special(struct nameidata *nd)
136 + struct dentry *dentry = nd->dentry;
137 + int err, counter = 0;
140 + if (!dentry->d_op || !dentry->d_op->d_revalidate)
142 + if (!dentry->d_op->d_revalidate(dentry, nd)) {
143 + struct dentry *new;
144 + if ((err = permission(dentry->d_parent->d_inode, MAY_EXEC, nd)))
146 + new = real_lookup(dentry->d_parent, &dentry->d_name, nd);
148 + return PTR_ERR(new);
149 + d_invalidate(dentry);
151 + nd->dentry = dentry = new;
154 + goto revalidate_again;
155 + printk("excessive revalidate_it loops\n");
163 * This is the basic name resolution function, turning a pathname into
164 @@ -755,8 +801,12 @@ static fastcall int __link_path_walk(con
167 if (inode->i_op->follow_link) {
168 + int save_flags = nd->flags;
170 + nd->flags |= LOOKUP_LINK_NOTLAST;
171 err = do_follow_link(next.dentry, nd);
172 + if (!(save_flags & LOOKUP_LINK_NOTLAST))
173 + nd->flags &= ~LOOKUP_LINK_NOTLAST;
177 @@ -795,14 +845,34 @@ last_component:
178 inode = nd->dentry->d_inode;
181 + nd->flags |= LOOKUP_LAST;
182 + err = revalidate_special(nd);
183 + nd->flags &= ~LOOKUP_LAST;
184 + if (!nd->dentry->d_inode)
190 + if (lookup_flags & LOOKUP_DIRECTORY) {
192 + if (!nd->dentry->d_inode->i_op ||
193 + !nd->dentry->d_inode->i_op->lookup){
201 if (nd->dentry->d_op && nd->dentry->d_op->d_hash) {
202 err = nd->dentry->d_op->d_hash(nd->dentry, &this);
206 + nd->flags |= LOOKUP_LAST;
207 err = do_lookup(nd, &this, &next, atomic);
208 + nd->flags &= ~LOOKUP_LAST;
211 follow_mount(&next.mnt, &next.dentry);
212 @@ -1053,7 +1123,7 @@ struct dentry * lookup_hash(struct qstr
216 -struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
217 +struct dentry * lookup_one_len_it(const char * name, struct dentry * base, int len, struct nameidata *nd)
221 @@ -1073,11 +1143,16 @@ struct dentry * lookup_one_len(const cha
223 this.hash = end_name_hash(hash);
225 - return lookup_hash(&this, base);
226 + return __lookup_hash(&this, base, nd);
228 return ERR_PTR(-EACCES);
231 +struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
233 + return lookup_one_len_it(name, base, len, NULL);
239 @@ -1089,7 +1164,7 @@ access:
240 * that namei follows links, while lnamei does not.
243 -int fastcall __user_walk(const char __user *name, unsigned flags, struct nameidata *nd)
244 +int fastcall __user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd)
246 char *tmp = getname(name);
247 int err = PTR_ERR(tmp);
248 @@ -1101,6 +1176,12 @@ int fastcall __user_walk(const char __us
252 +int fastcall __user_walk(const char __user *name, unsigned flags, struct nameidata *nd)
254 + intent_init(&nd->intent, IT_LOOKUP);
255 + return __user_walk_it(name, flags, nd);
259 * It's inline, so penalty for filesystems that don't use sticky bit is
261 @@ -1387,8 +1468,8 @@ int open_namei(const char * pathname, in
262 acc_mode |= MAY_APPEND;
264 /* Fill in the open() intent data */
265 - nd->intent.open.flags = flag;
266 - nd->intent.open.create_mode = mode;
267 + nd->intent.it_flags = flag;
268 + nd->intent.it_create_mode = mode;
271 * The simplest case - just a plain lookup.
272 @@ -1403,6 +1484,7 @@ int open_namei(const char * pathname, in
274 * Create - we need to know the parent.
276 + nd->intent.it_op |= IT_CREAT;
277 error = path_lookup(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd);
280 @@ -1419,7 +1501,9 @@ int open_namei(const char * pathname, in
282 nd->flags &= ~LOOKUP_PARENT;
283 down(&dir->d_inode->i_sem);
284 + nd->flags |= LOOKUP_LAST;
285 dentry = __lookup_hash(&nd->last, nd->dentry, nd);
286 + nd->flags &= ~LOOKUP_LAST;
289 error = PTR_ERR(dentry);
290 @@ -1532,7 +1616,9 @@ do_link:
293 down(&dir->d_inode->i_sem);
294 + nd->flags |= LOOKUP_LAST;
295 dentry = __lookup_hash(&nd->last, nd->dentry, nd);
296 + nd->flags &= ~LOOKUP_LAST;
297 __putname(nd->last.name);
300 --- linux-2.6.9.orig/fs/namespace.c
301 +++ linux-2.6.9/fs/namespace.c
302 @@ -61,6 +61,7 @@ struct vfsmount *alloc_vfsmnt(const char
303 INIT_LIST_HEAD(&mnt->mnt_mounts);
304 INIT_LIST_HEAD(&mnt->mnt_list);
305 INIT_LIST_HEAD(&mnt->mnt_fslink);
306 + INIT_LIST_HEAD(&mnt->mnt_lustre_list);
308 int size = strlen(name)+1;
309 char *newname = kmalloc(size, GFP_KERNEL);
310 @@ -114,6 +115,7 @@ static inline int check_mnt(struct vfsmo
312 static void detach_mnt(struct vfsmount *mnt, struct nameidata *old_nd)
314 + memset(old_nd, 0, sizeof(*old_nd));
315 old_nd->dentry = mnt->mnt_mountpoint;
316 old_nd->mnt = mnt->mnt_parent;
317 mnt->mnt_parent = mnt;
318 @@ -177,6 +179,9 @@ void __mntput(struct vfsmount *mnt)
320 struct super_block *sb = mnt->mnt_sb;
322 + spin_lock(&dcache_lock);
323 + list_del(&mnt->mnt_lustre_list);
324 + spin_unlock(&dcache_lock);
326 deactivate_super(sb);
328 @@ -403,6 +408,8 @@ static int do_umount(struct vfsmount *mn
332 + if (sb->s_op->umount_lustre)
333 + sb->s_op->umount_lustre(sb);
334 if( (flags&MNT_FORCE) && sb->s_op->umount_begin)
335 sb->s_op->umount_begin(sb);
337 @@ -627,6 +634,7 @@ static int do_loopback(struct nameidata
339 if (!old_name || !*old_name)
341 + intent_init(&old_nd.intent, IT_LOOKUP);
342 err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
345 @@ -701,6 +709,7 @@ static int do_move_mount(struct nameidat
347 if (!old_name || !*old_name)
349 + intent_init(&old_nd.intent, IT_LOOKUP);
350 err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
353 @@ -1012,6 +1021,7 @@ long do_mount(char * dev_name, char * di
357 + intent_init(&nd.intent, IT_LOOKUP);
359 if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
360 flags &= ~MS_MGC_MSK;
361 --- linux-2.6.9.orig/fs/open.c
362 +++ linux-2.6.9/fs/open.c
363 @@ -216,12 +216,12 @@ static inline long do_sys_truncate(const
365 struct inode * inode;
368 + intent_init(&nd.intent, IT_GETATTR);
370 if (length < 0) /* sorry, but loff_t says... */
373 - error = user_path_walk(path, &nd);
374 + error = user_path_walk_it(path, &nd);
377 inode = nd.dentry->d_inode;
378 @@ -475,6 +475,7 @@ asmlinkage long sys_access(const char __
379 int old_fsuid, old_fsgid;
380 kernel_cap_t old_cap;
382 + intent_init(&nd.intent, IT_GETATTR);
384 if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
386 @@ -499,13 +500,14 @@ asmlinkage long sys_access(const char __
388 current->cap_effective = current->cap_permitted;
390 - res = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
391 + res = __user_walk_it(filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
393 res = permission(nd.dentry->d_inode, mode, &nd);
394 /* SuS v2 requires we report a read only fs too */
395 if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
396 && !special_file(nd.dentry->d_inode->i_mode))
402 @@ -520,8 +522,9 @@ asmlinkage long sys_chdir(const char __u
406 + intent_init(&nd.intent, IT_GETATTR);
408 - error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
409 + error = __user_walk_it(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
413 @@ -573,8 +576,9 @@ asmlinkage long sys_chroot(const char __
417 + intent_init(&nd.intent, IT_GETATTR);
419 - error = __user_walk(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
420 + error = __user_walk_it(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
424 @@ -741,8 +745,6 @@ asmlinkage long sys_fchown(unsigned int
428 -static struct file *__dentry_open(struct dentry *, struct vfsmount *, int, struct file *);
431 * Note that while the flag value (low two bits) for sys_open means:
433 @@ -760,8 +762,9 @@ static struct file *__dentry_open(struct
434 struct file *filp_open(const char * filename, int flags, int mode)
436 int namei_flags, error;
437 + struct file * temp_filp;
440 + intent_init(&nd.intent, IT_OPEN);
443 if ((namei_flags+1) & O_ACCMODE)
444 @@ -769,16 +772,11 @@ struct file *filp_open(const char * file
445 if (namei_flags & O_TRUNC)
449 - f = get_empty_filp();
451 - return ERR_PTR(error);
453 error = open_namei(filename, namei_flags, mode, &nd);
455 - return __dentry_open(nd.dentry, nd.mnt, flags, f);
459 + temp_filp = dentry_open_it(nd.dentry, nd.mnt, flags, &nd.intent);
462 return ERR_PTR(error);
465 @@ -786,29 +784,27 @@ EXPORT_SYMBOL(filp_open);
467 struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
473 - f = get_empty_filp();
477 - return ERR_PTR(error);
479 + struct lookup_intent it;
480 + intent_init(&it, IT_LOOKUP);
482 - return __dentry_open(dentry, mnt, flags, f);
483 + return dentry_open_it(dentry, mnt, flags, &it);
486 EXPORT_SYMBOL(dentry_open);
488 -static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags, struct file *f)
489 +struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, int flags, struct lookup_intent *it)
496 + f = get_empty_filp();
498 + goto cleanup_dentry;
500 f->f_mode = ((flags+1) & O_ACCMODE) | FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
502 inode = dentry->d_inode;
503 if (f->f_mode & FMODE_WRITE) {
504 error = get_write_access(inode);
505 @@ -827,6 +823,7 @@ static struct file *__dentry_open(struct
506 error = f->f_op->open(inode,f);
509 + intent_release(it);
511 f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
513 @@ -851,6 +848,8 @@ cleanup_all:
518 + intent_release(it);
521 return ERR_PTR(error);
522 --- linux-2.6.9.orig/fs/stat.c
523 +++ linux-2.6.9/fs/stat.c
524 @@ -37,7 +37,7 @@ void generic_fillattr(struct inode *inod
526 EXPORT_SYMBOL(generic_fillattr);
528 -int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
529 +int vfs_getattr_it(struct vfsmount *mnt, struct dentry *dentry, struct lookup_intent *it, struct kstat *stat)
531 struct inode *inode = dentry->d_inode;
533 @@ -46,6 +46,8 @@ int vfs_getattr(struct vfsmount *mnt, st
537 + if (inode->i_op->getattr_it)
538 + return inode->i_op->getattr_it(mnt, dentry, it, stat);
539 if (inode->i_op->getattr)
540 return inode->i_op->getattr(mnt, dentry, stat);
542 @@ -62,14 +64,20 @@ int vfs_getattr(struct vfsmount *mnt, st
544 EXPORT_SYMBOL(vfs_getattr);
546 +int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
548 + return vfs_getattr_it(mnt, dentry, NULL, stat);
551 int vfs_stat(char __user *name, struct kstat *stat)
555 + intent_init(&nd.intent, IT_GETATTR);
557 - error = user_path_walk(name, &nd);
558 + error = user_path_walk_it(name, &nd);
560 - error = vfs_getattr(nd.mnt, nd.dentry, stat);
561 + error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
565 @@ -81,10 +89,11 @@ int vfs_lstat(char __user *name, struct
569 + intent_init(&nd.intent, IT_GETATTR);
571 - error = user_path_walk_link(name, &nd);
572 + error = user_path_walk_link_it(name, &nd);
574 - error = vfs_getattr(nd.mnt, nd.dentry, stat);
575 + error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
579 @@ -96,9 +105,12 @@ int vfs_fstat(unsigned int fd, struct ks
581 struct file *f = fget(fd);
583 + struct nameidata nd;
584 + intent_init(&nd.intent, IT_GETATTR);
587 - error = vfs_getattr(f->f_vfsmnt, f->f_dentry, stat);
588 + error = vfs_getattr_it(f->f_vfsmnt, f->f_dentry, &nd.intent, stat);
589 + intent_release(&nd.intent);
593 --- linux-2.6.9.orig/include/linux/dcache.h
594 +++ linux-2.6.9/include/linux/dcache.h
598 #include <asm/atomic.h>
599 +#include <linux/string.h>
600 #include <linux/list.h>
601 #include <linux/spinlock.h>
602 #include <linux/cache.h>
603 @@ -37,6 +38,8 @@ struct qstr {
604 const unsigned char *name;
607 +#include <linux/namei.h>
609 struct dentry_stat_t {
612 --- linux-2.6.9.orig/include/linux/fs.h
613 +++ linux-2.6.9/include/linux/fs.h
614 @@ -81,6 +81,11 @@ extern int leases_enable, dir_notify_ena
615 #define FMODE_PREAD 8
616 #define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */
618 +/* File is being opened for execution. Primary users of this flag are
619 + distributed filesystems that can use it to achieve correct ETXTBUSY
620 + behavior for cross-node execution/opening_for_writing of files */
621 +#define FMODE_EXEC 16
626 @@ -259,6 +260,8 @@ typedef void (dio_iodone_t)(struct inode
627 #define ATTR_ATTR_FLAG 1024
628 #define ATTR_KILL_SUID 2048
629 #define ATTR_KILL_SGID 4096
630 +#define ATTR_RAW 8192 /* file system, not vfs will massage attrs */
631 +#define ATTR_FROM_OPEN 16384 /* called from open path, ie O_TRUNC */
634 * This is the Inode Attributes structure, used for notify_change(). It
635 @@ -457,6 +460,7 @@ struct inode {
636 struct block_device *i_bdev;
639 + void *i_filterdata;
643 @@ -590,6 +594,7 @@ struct file {
644 spinlock_t f_ep_lock;
645 #endif /* #ifdef CONFIG_EPOLL */
646 struct address_space *f_mapping;
647 + struct lookup_intent *f_it;
649 extern spinlock_t files_lock;
650 #define file_list_lock() spin_lock(&files_lock);
651 @@ -962,7 +967,9 @@ struct inode_operations {
652 void (*truncate) (struct inode *);
653 int (*permission) (struct inode *, int, struct nameidata *);
654 int (*setattr) (struct dentry *, struct iattr *);
655 + int (*setattr_raw) (struct inode *, struct iattr *);
656 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
657 + int (*getattr_it) (struct vfsmount *, struct dentry *, struct lookup_intent *, struct kstat *);
658 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
659 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
660 ssize_t (*listxattr) (struct dentry *, char *, size_t);
661 @@ -1002,6 +1009,7 @@ struct super_operations {
662 int (*remount_fs) (struct super_block *, int *, char *);
663 void (*clear_inode) (struct inode *);
664 void (*umount_begin) (struct super_block *);
665 + void (*umount_lustre) (struct super_block *);
667 int (*show_options)(struct seq_file *, struct vfsmount *);
669 @@ -1194,6 +1202,7 @@ extern int unregister_filesystem(struct
670 extern struct vfsmount *kern_mount(struct file_system_type *);
671 extern int may_umount_tree(struct vfsmount *);
672 extern int may_umount(struct vfsmount *);
673 +struct vfsmount *do_kern_mount(const char *type, int flags, const char *name, void *data);
674 extern long do_mount(char *, char *, char *, unsigned long, void *);
676 extern int vfs_statfs(struct super_block *, struct kstatfs *);
677 @@ -1258,6 +1267,7 @@ static inline int break_lease(struct ino
678 extern int do_truncate(struct dentry *, loff_t start);
679 extern struct file *filp_open(const char *, int, int);
680 extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
681 +extern struct file * dentry_open_it(struct dentry *, struct vfsmount *, int, struct lookup_intent *);
682 extern int filp_close(struct file *, fl_owner_t id);
683 extern char * getname(const char __user *);
685 --- linux-2.6.9.orig/include/linux/mount.h
686 +++ linux-2.6.9/include/linux/mount.h
687 @@ -34,6 +34,8 @@ struct vfsmount
688 struct list_head mnt_list;
689 struct list_head mnt_fslink; /* link in fs-specific expiry list */
690 struct namespace *mnt_namespace; /* containing namespace */
691 + struct list_head mnt_lustre_list; /* GNS mount list */
692 + unsigned long mnt_last_used; /* for GNS auto-umount (jiffies) */
695 static inline struct vfsmount *mntget(struct vfsmount *mnt)
696 --- linux-2.6.9.orig/include/linux/namei.h
697 +++ linux-2.6.9/include/linux/namei.h
699 #define _LINUX_NAMEI_H
701 #include <linux/linkage.h>
702 +#include <linux/string.h>
707 -struct open_intent {
710 +/* intent opcodes */
712 +#define IT_CREAT (1<<1)
713 +#define IT_READDIR (1<<2)
714 +#define IT_GETATTR (1<<3)
715 +#define IT_LOOKUP (1<<4)
716 +#define IT_UNLINK (1<<5)
717 +#define IT_TRUNC (1<<6)
718 +#define IT_GETXATTR (1<<7)
720 +struct lustre_intent_data {
721 + int it_disposition;
723 + __u64 it_lock_handle;
728 +#define INTENT_MAGIC 0x19620323
729 +struct lookup_intent {
731 + void (*it_op_release)(struct lookup_intent *);
734 + int it_create_mode;
736 + struct lustre_intent_data lustre;
740 +static inline void intent_reset_fs_part(struct lookup_intent *it)
742 + memset(&it->d, 0, sizeof(it->d));
743 + it->it_magic = INTENT_MAGIC;
744 + it->it_op_release = NULL;
747 +static inline void intent_init(struct lookup_intent *it, int op)
749 + memset(it, 0, sizeof(*it));
750 + it->it_magic = INTENT_MAGIC;
754 enum { MAX_NESTED_LINKS = 8 };
757 @@ -21,10 +62,7 @@ struct nameidata {
759 char *saved_names[MAX_NESTED_LINKS + 1];
763 - struct open_intent open;
765 + struct lookup_intent intent;
769 @@ -47,6 +85,8 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
770 #define LOOKUP_NOALT 32
771 #define LOOKUP_ATOMIC 64
772 #define LOOKUP_REVAL 128
773 +#define LOOKUP_LAST (0x1000)
774 +#define LOOKUP_LINK_NOTLAST (0x2000)
778 @@ -56,6 +96,12 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
779 #define LOOKUP_ACCESS (0x0400)
781 extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *));
782 +extern int FASTCALL(__user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd));
783 +#define user_path_walk_it(name,nd) \
784 + __user_walk_it(name, LOOKUP_FOLLOW, nd)
785 +#define user_path_walk_link_it(name,nd) \
786 + __user_walk_it(name, 0, nd)
787 +extern void intent_release(struct lookup_intent *);
788 #define user_path_walk(name,nd) \
789 __user_walk(name, LOOKUP_FOLLOW, nd)
790 #define user_path_walk_link(name,nd) \
791 @@ -68,7 +114,6 @@ extern void path_release_on_umount(struc
793 extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
794 extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
796 extern int follow_down(struct vfsmount **, struct dentry **);
797 extern int follow_up(struct vfsmount **, struct dentry **);