4 fs/namei.c | 99 +++++++++++++++++++++++++++++++++++++++++++++----
5 fs/namespace.c | 10 ++++
6 fs/open.c | 70 +++++++++++++++++++++-------------
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, 241 insertions(+), 53 deletions(-)
14 --- linux-2.6.12.6.orig/fs/exec.c
15 +++ linux-2.6.12.6/fs/exec.c
16 @@ -122,9 +122,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 @@ -136,7 +137,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 @@ -492,8 +493,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 @@ -506,7 +508,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.12.6.orig/fs/namei.c
60 +++ linux-2.6.12.6/fs/namei.c
61 @@ -301,8 +301,19 @@ int deny_write_access(struct file * file
65 +void intent_release(struct lookup_intent *it)
69 + if (it->it_magic != INTENT_MAGIC)
71 + if (it->it_op_release)
72 + it->it_op_release(it);
75 void path_release(struct nameidata *nd)
77 + intent_release(&nd->intent);
81 @@ -392,8 +403,11 @@ static struct dentry * real_lookup(struc
83 struct dentry * result;
84 struct inode *dir = parent->d_inode;
91 * First re-do the cached lookup just in case it was created
92 * while we waited for the directory semaphore..
93 @@ -427,13 +441,16 @@ static struct dentry * real_lookup(struc
94 * Uhhuh! Nasty case: the cache was re-populated while
95 * we waited on the semaphore. Need to revalidate.
98 if (result->d_op && result->d_op->d_revalidate) {
99 if (!result->d_op->d_revalidate(result, nd) && !d_invalidate(result)) {
101 - result = ERR_PTR(-ENOENT);
103 + result = ERR_PTR(-ESTALE);
104 + if (!IS_ERR(result))
112 @@ -462,6 +479,7 @@ static inline int __vfs_follow_link(stru
120 @@ -471,6 +489,7 @@ static inline int __vfs_follow_link(stru
121 /* weird __emul_prefix() stuff did it */
124 + intent_reset_fs_part(&nd->intent);
125 res = link_path_walk(link, nd);
127 if (nd->depth || res || nd->last_type!=LAST_NORM)
128 @@ -703,6 +722,33 @@ fail:
129 return PTR_ERR(dentry);
132 +static int revalidate_special(struct nameidata *nd)
134 + struct dentry *dentry = nd->dentry;
135 + int err, counter = 0;
138 + if (!dentry->d_op || !dentry->d_op->d_revalidate)
140 + if (!dentry->d_op->d_revalidate(dentry, nd)) {
141 + struct dentry *new;
142 + if ((err = permission(dentry->d_parent->d_inode, MAY_EXEC, nd)))
144 + new = real_lookup(dentry->d_parent, &dentry->d_name, nd);
146 + return PTR_ERR(new);
147 + d_invalidate(dentry);
149 + nd->dentry = dentry = new;
152 + goto revalidate_again;
153 + printk("excessive revalidate_it loops\n");
161 * This is the basic name resolution function, turning a pathname into
162 @@ -800,7 +846,11 @@ static fastcall int __link_path_walk(con
165 if (inode->i_op->follow_link) {
166 + int save_flags = nd->flags;
167 + nd->flags |= LOOKUP_LINK_NOTLAST;
168 err = do_follow_link(&next, nd);
169 + if (!(save_flags & LOOKUP_LINK_NOTLAST))
170 + nd->flags &= ~LOOKUP_LINK_NOTLAST;
174 @@ -839,6 +889,23 @@ last_component:
175 inode = nd->dentry->d_inode;
178 + nd->flags |= LOOKUP_LAST;
179 + err = revalidate_special(nd);
180 + nd->flags &= ~LOOKUP_LAST;
181 + if (!nd->dentry->d_inode)
187 + if (lookup_flags & LOOKUP_DIRECTORY) {
189 + if(!nd->dentry->d_inode->i_op ||
190 + !nd->dentry->d_inode->i_op->lookup) {
197 if (nd->dentry->d_op && nd->dentry->d_op->d_hash) {
198 @@ -846,7 +913,9 @@ last_component:
202 + nd->flags |= LOOKUP_LAST;
203 err = do_lookup(nd, &this, &next);
204 + nd->flags &= ~LOOKUP_LAST;
207 inode = next.dentry->d_inode;
208 @@ -1097,7 +1166,7 @@ struct dentry * lookup_hash(struct qstr
212 -struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
213 +struct dentry * lookup_one_len_it(const char * name, struct dentry * base, int len, struct nameidata *nd)
217 @@ -1117,11 +1186,16 @@ struct dentry * lookup_one_len(const cha
219 this.hash = end_name_hash(hash);
221 - return lookup_hash(&this, base);
222 + return __lookup_hash(&this, base, nd);
224 return ERR_PTR(-EACCES);
227 +struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
229 + return lookup_one_len_it(name, base, len, NULL);
235 @@ -1133,7 +1207,7 @@ access:
236 * that namei follows links, while lnamei does not.
239 -int fastcall __user_walk(const char __user *name, unsigned flags, struct nameidata *nd)
240 +int fastcall __user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd)
242 char *tmp = getname(name);
243 int err = PTR_ERR(tmp);
244 @@ -1145,6 +1219,12 @@ int fastcall __user_walk(const char __us
248 +int fastcall __user_walk(const char __user *name, unsigned flags, struct nameidata *nd)
250 + intent_init(&nd->intent, IT_LOOKUP);
251 + return __user_walk_it(name, flags, nd);
255 * It's inline, so penalty for filesystems that don't use sticky bit is
257 @@ -1426,8 +1506,8 @@ int open_namei(const char * pathname, in
258 acc_mode |= MAY_APPEND;
260 /* Fill in the open() intent data */
261 - nd->intent.open.flags = flag;
262 - nd->intent.open.create_mode = mode;
263 + nd->intent.it_flags = flag;
264 + nd->intent.it_create_mode = mode;
267 * The simplest case - just a plain lookup.
268 @@ -1442,6 +1522,7 @@ int open_namei(const char * pathname, in
270 * Create - we need to know the parent.
272 + nd->intent.it_op |= IT_CREAT;
273 error = path_lookup(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd);
276 @@ -1458,7 +1539,9 @@ int open_namei(const char * pathname, in
278 nd->flags &= ~LOOKUP_PARENT;
279 down(&dir->d_inode->i_sem);
280 + nd->flags |= LOOKUP_LAST;
281 path.dentry = __lookup_hash(&nd->last, nd->dentry, nd);
282 + nd->flags &= ~LOOKUP_LAST;
286 @@ -1564,7 +1647,9 @@ do_link:
289 down(&dir->d_inode->i_sem);
290 + nd->flags |= LOOKUP_LAST;
291 path.dentry = __lookup_hash(&nd->last, nd->dentry, nd);
292 + nd->flags &= ~LOOKUP_LAST;
294 putname(nd->last.name);
296 --- linux-2.6.12.6.orig/fs/namespace.c
297 +++ linux-2.6.12.6/fs/namespace.c
298 @@ -62,6 +62,7 @@ struct vfsmount *alloc_vfsmnt(const char
299 INIT_LIST_HEAD(&mnt->mnt_mounts);
300 INIT_LIST_HEAD(&mnt->mnt_list);
301 INIT_LIST_HEAD(&mnt->mnt_fslink);
302 + INIT_LIST_HEAD(&mnt->mnt_lustre_list);
304 int size = strlen(name)+1;
305 char *newname = kmalloc(size, GFP_KERNEL);
306 @@ -113,6 +114,7 @@ static inline int check_mnt(struct vfsmo
308 static void detach_mnt(struct vfsmount *mnt, struct nameidata *old_nd)
310 + memset(old_nd, 0, sizeof(*old_nd));
311 old_nd->dentry = mnt->mnt_mountpoint;
312 old_nd->mnt = mnt->mnt_parent;
313 mnt->mnt_parent = mnt;
314 @@ -176,6 +178,9 @@ void __mntput(struct vfsmount *mnt)
316 struct super_block *sb = mnt->mnt_sb;
318 + spin_lock(&dcache_lock);
319 + list_del(&mnt->mnt_lustre_list);
320 + spin_unlock(&dcache_lock);
322 deactivate_super(sb);
324 @@ -402,6 +407,8 @@ static int do_umount(struct vfsmount *mn
328 + if (sb->s_op->umount_lustre)
329 + sb->s_op->umount_lustre(sb);
330 if( (flags&MNT_FORCE) && sb->s_op->umount_begin)
331 sb->s_op->umount_begin(sb);
333 @@ -627,6 +634,7 @@ static int do_loopback(struct nameidata
335 if (!old_name || !*old_name)
337 + intent_init(&old_nd.intent, IT_LOOKUP);
338 err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
341 @@ -701,6 +709,7 @@ static int do_move_mount(struct nameidat
343 if (!old_name || !*old_name)
345 + intent_init(&old_nd.intent, IT_LOOKUP);
346 err = path_lookup(old_name, LOOKUP_FOLLOW, &old_nd);
349 @@ -1012,6 +1021,7 @@ long do_mount(char * dev_name, char * di
353 + intent_init(&nd.intent, IT_LOOKUP);
355 if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
356 flags &= ~MS_MGC_MSK;
357 --- linux-2.6.12.6.orig/fs/open.c
358 +++ linux-2.6.12.6/fs/open.c
359 @@ -215,12 +215,12 @@ static inline long do_sys_truncate(const
361 struct inode * inode;
364 + intent_init(&nd.intent, IT_GETATTR);
366 if (length < 0) /* sorry, but loff_t says... */
369 - error = user_path_walk(path, &nd);
370 + error = user_path_walk_it(path, &nd);
373 inode = nd.dentry->d_inode;
374 @@ -474,6 +474,7 @@ asmlinkage long sys_access(const char __
375 int old_fsuid, old_fsgid;
376 kernel_cap_t old_cap;
378 + intent_init(&nd.intent, IT_GETATTR);
380 if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
382 @@ -498,13 +499,14 @@ asmlinkage long sys_access(const char __
384 current->cap_effective = current->cap_permitted;
386 - res = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
387 + res = __user_walk_it(filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd);
389 res = permission(nd.dentry->d_inode, mode, &nd);
390 /* SuS v2 requires we report a read only fs too */
391 if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
392 && !special_file(nd.dentry->d_inode->i_mode))
398 @@ -519,8 +521,9 @@ asmlinkage long sys_chdir(const char __u
402 + intent_init(&nd.intent, IT_GETATTR);
404 - error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
405 + error = __user_walk_it(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
409 @@ -570,8 +573,9 @@ asmlinkage long sys_chroot(const char __
413 + intent_init(&nd.intent, IT_GETATTR);
415 - error = __user_walk(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
416 + error = __user_walk_it(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
420 @@ -750,27 +754,8 @@ asmlinkage long sys_fchown(unsigned int
421 * for the internal routines (ie open_namei()/follow_link() etc). 00 is
424 -struct file *filp_open(const char * filename, int flags, int mode)
426 - int namei_flags, error;
427 - struct nameidata nd;
429 - namei_flags = flags;
430 - if ((namei_flags+1) & O_ACCMODE)
432 - if (namei_flags & O_TRUNC)
435 - error = open_namei(filename, namei_flags, mode, &nd);
437 - return dentry_open(nd.dentry, nd.mnt, flags);
439 - return ERR_PTR(error);
442 -EXPORT_SYMBOL(filp_open);
444 -struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
445 +struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, int flags,
446 + struct lookup_intent *it)
450 @@ -782,6 +767,7 @@ struct file *dentry_open(struct dentry *
453 f->f_mode = ((flags+1) & O_ACCMODE) | FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
455 inode = dentry->d_inode;
456 if (f->f_mode & FMODE_WRITE) {
457 error = get_write_access(inode);
458 @@ -800,6 +786,7 @@ struct file *dentry_open(struct dentry *
459 error = f->f_op->open(inode,f);
462 + intent_release(it);
464 f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
466 @@ -825,6 +812,7 @@ cleanup_all:
470 + intent_release(it);
473 return ERR_PTR(error);
474 @@ -832,6 +820,36 @@ cleanup_dentry:
476 EXPORT_SYMBOL(dentry_open);
478 +struct file *filp_open(const char * filename, int flags, int mode)
480 + int namei_flags, error;
481 + struct file * temp_filp;
482 + struct nameidata nd;
483 + intent_init(&nd.intent, IT_OPEN);
485 + namei_flags = flags;
486 + if ((namei_flags+1) & O_ACCMODE)
488 + if (namei_flags & O_TRUNC)
491 + error = open_namei(filename, namei_flags, mode, &nd);
493 + temp_filp = dentry_open_it(nd.dentry, nd.mnt, flags, &nd.intent);
496 + return ERR_PTR(error);
500 +struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
502 + struct lookup_intent it;
503 + intent_init(&it, IT_LOOKUP);
505 + return dentry_open_it(dentry, mnt, flags, &it);
509 * Find an empty file descriptor entry, and mark it busy.
511 --- linux-2.6.12.6.orig/fs/stat.c
512 +++ linux-2.6.12.6/fs/stat.c
513 @@ -38,7 +38,7 @@ void generic_fillattr(struct inode *inod
515 EXPORT_SYMBOL(generic_fillattr);
517 -int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
518 +int vfs_getattr_it(struct vfsmount *mnt, struct dentry *dentry, struct lookup_intent *it, struct kstat *stat)
520 struct inode *inode = dentry->d_inode;
522 @@ -47,6 +47,8 @@ int vfs_getattr(struct vfsmount *mnt, st
526 + if (inode->i_op->getattr_it)
527 + return inode->i_op->getattr_it(mnt, dentry, it, stat);
528 if (inode->i_op->getattr)
529 return inode->i_op->getattr(mnt, dentry, stat);
531 @@ -63,14 +65,20 @@ int vfs_getattr(struct vfsmount *mnt, st
533 EXPORT_SYMBOL(vfs_getattr);
535 +int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
537 + return vfs_getattr_it(mnt, dentry, NULL, stat);
540 int vfs_stat(char __user *name, struct kstat *stat)
544 + intent_init(&nd.intent, IT_GETATTR);
546 - error = user_path_walk(name, &nd);
547 + error = user_path_walk_it(name, &nd);
549 - error = vfs_getattr(nd.mnt, nd.dentry, stat);
550 + error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
554 @@ -82,10 +90,11 @@ int vfs_lstat(char __user *name, struct
558 + intent_init(&nd.intent, IT_GETATTR);
560 - error = user_path_walk_link(name, &nd);
561 + error = user_path_walk_link_it(name, &nd);
563 - error = vfs_getattr(nd.mnt, nd.dentry, stat);
564 + error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
568 @@ -97,9 +106,12 @@ int vfs_fstat(unsigned int fd, struct ks
570 struct file *f = fget(fd);
572 + struct nameidata nd;
573 + intent_init(&nd.intent, IT_GETATTR);
576 - error = vfs_getattr(f->f_vfsmnt, f->f_dentry, stat);
577 + error = vfs_getattr_it(f->f_vfsmnt, f->f_dentry, &nd.intent, stat);
578 + intent_release(&nd.intent);
582 --- linux-2.6.12.6.orig/fs/inode.c
583 +++ linux-2.6.12.6/fs/inode.c
584 @@ -230,6 +230,7 @@ void __iget(struct inode * inode)
585 inodes_stat.nr_unused--;
588 +EXPORT_SYMBOL(__iget);
590 * clear_inode - clear an inode
591 * @inode: inode to clear
592 --- linux-2.6.12.6.orig/include/linux/dcache.h
593 +++ linux-2.6.12.6/include/linux/dcache.h
597 #include <asm/atomic.h>
598 +#include <linux/string.h>
599 #include <linux/list.h>
600 #include <linux/spinlock.h>
601 #include <linux/cache.h>
602 @@ -37,6 +38,8 @@ struct qstr {
603 const unsigned char *name;
606 +#include <linux/namei.h>
608 struct dentry_stat_t {
611 --- linux-2.6.12.6.orig/include/linux/fs.h
612 +++ linux-2.6.12.6/include/linux/fs.h
613 @@ -58,6 +58,7 @@ extern int dir_notify_enable;
616 #define FMODE_WRITE 2
617 +#define FMODE_EXEC 4
619 /* Internal kernel extensions */
620 #define FMODE_LSEEK 4
621 @@ -260,6 +261,8 @@ typedef void (dio_iodone_t)(struct inode
622 #define ATTR_ATTR_FLAG 1024
623 #define ATTR_KILL_SUID 2048
624 #define ATTR_KILL_SGID 4096
625 +#define ATTR_RAW 8192 /* file system, not vfs will massage attrs */
626 +#define ATTR_FROM_OPEN 16384 /* called from open path, ie O_TRUNC */
629 * This is the Inode Attributes structure, used for notify_change(). It
630 @@ -463,6 +466,7 @@ struct inode {
631 struct block_device *i_bdev;
634 + void *i_filterdata;
638 @@ -600,6 +604,7 @@ struct file {
639 spinlock_t f_ep_lock;
640 #endif /* #ifdef CONFIG_EPOLL */
641 struct address_space *f_mapping;
642 + struct lookup_intent *f_it;
644 extern spinlock_t files_lock;
645 #define file_list_lock() spin_lock(&files_lock);
646 @@ -968,7 +973,9 @@ struct inode_operations {
647 void (*truncate) (struct inode *);
648 int (*permission) (struct inode *, int, struct nameidata *);
649 int (*setattr) (struct dentry *, struct iattr *);
650 + int (*setattr_raw) (struct inode *, struct iattr *);
651 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
652 + int (*getattr_it) (struct vfsmount *, struct dentry *, struct lookup_intent *, struct kstat *);
653 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
654 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
655 ssize_t (*listxattr) (struct dentry *, char *, size_t);
656 @@ -1008,6 +1015,7 @@ struct super_operations {
657 int (*remount_fs) (struct super_block *, int *, char *);
658 void (*clear_inode) (struct inode *);
659 void (*umount_begin) (struct super_block *);
660 + void (*umount_lustre) (struct super_block *);
662 int (*show_options)(struct seq_file *, struct vfsmount *);
664 @@ -1210,6 +1218,7 @@ extern int unregister_filesystem(struct
665 extern struct vfsmount *kern_mount(struct file_system_type *);
666 extern int may_umount_tree(struct vfsmount *);
667 extern int may_umount(struct vfsmount *);
668 +struct vfsmount *do_kern_mount(const char *type, int flags, const char *name, void *data);
669 extern long do_mount(char *, char *, char *, unsigned long, void *);
671 extern int vfs_statfs(struct super_block *, struct kstatfs *);
672 @@ -1262,6 +1271,7 @@ static inline int break_lease(struct ino
673 extern int do_truncate(struct dentry *, loff_t start);
674 extern struct file *filp_open(const char *, int, int);
675 extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
676 +extern struct file * dentry_open_it(struct dentry *, struct vfsmount *, int, struct lookup_intent *);
677 extern int filp_close(struct file *, fl_owner_t id);
678 extern char * getname(const char __user *);
680 --- linux-2.6.12.6.orig/include/linux/namei.h
681 +++ linux-2.6.12.6/include/linux/namei.h
683 #define _LINUX_NAMEI_H
685 #include <linux/linkage.h>
686 +#include <linux/string.h>
691 -struct open_intent {
694 +/* intent opcodes */
696 +#define IT_CREAT (1<<1)
697 +#define IT_READDIR (1<<2)
698 +#define IT_GETATTR (1<<3)
699 +#define IT_LOOKUP (1<<4)
700 +#define IT_UNLINK (1<<5)
701 +#define IT_TRUNC (1<<6)
702 +#define IT_GETXATTR (1<<7)
704 +struct lustre_intent_data {
705 + int it_disposition;
707 + __u64 it_lock_handle;
712 +#define INTENT_MAGIC 0x19620323
713 +struct lookup_intent {
715 + void (*it_op_release)(struct lookup_intent *);
718 + int it_create_mode;
720 + struct lustre_intent_data lustre;
724 +static inline void intent_reset_fs_part(struct lookup_intent *it)
726 + memset(&it->d, 0, sizeof(it->d));
727 + it->it_magic = INTENT_MAGIC;
728 + it->it_op_release = NULL;
731 +static inline void intent_init(struct lookup_intent *it, int op)
733 + memset(it, 0, sizeof(*it));
734 + it->it_magic = INTENT_MAGIC;
738 enum { MAX_NESTED_LINKS = 5 };
741 @@ -21,10 +62,7 @@ struct nameidata {
743 char *saved_names[MAX_NESTED_LINKS + 1];
747 - struct open_intent open;
749 + struct lookup_intent intent;
753 @@ -47,6 +85,8 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
754 #define LOOKUP_PARENT 16
755 #define LOOKUP_NOALT 32
756 #define LOOKUP_REVAL 64
757 +#define LOOKUP_LAST (0x1000)
758 +#define LOOKUP_LINK_NOTLAST (0x2000)
762 @@ -55,6 +95,12 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
763 #define LOOKUP_ACCESS (0x0400)
765 extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *));
766 +extern int FASTCALL(__user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd));
767 +#define user_path_walk_it(name,nd) \
768 + __user_walk_it(name, LOOKUP_FOLLOW, nd)
769 +#define user_path_walk_link_it(name,nd) \
770 + __user_walk_it(name, 0, nd)
771 +extern void intent_release(struct lookup_intent *);
772 #define user_path_walk(name,nd) \
773 __user_walk(name, LOOKUP_FOLLOW, nd)
774 #define user_path_walk_link(name,nd) \
775 @@ -67,7 +113,6 @@ extern void path_release_on_umount(struc
777 extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
778 extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
780 extern int follow_down(struct vfsmount **, struct dentry **);
781 extern int follow_up(struct vfsmount **, struct dentry **);
783 --- linux-2.6.12.6.orig/include/linux/mount.h
784 +++ linux-2.6.12.6/include/linux/mount.h
785 @@ -36,6 +36,8 @@ struct vfsmount
786 struct list_head mnt_list;
787 struct list_head mnt_fslink; /* link in fs-specific expiry list */
788 struct namespace *mnt_namespace; /* containing namespace */
789 + struct list_head mnt_lustre_list; /* GNS mount list */
790 + unsigned long mnt_last_used; /* for GNS auto-umount (jiffies) */
793 static inline struct vfsmount *mntget(struct vfsmount *mnt)