head	1.1;
access;
symbols
	LKML-branch:1.1.0.2;
locks; strict;
comment	@# @;


1.1
date	2006.09.27.06.09.23;	author jsipek;	state dead;
branches
	1.1.2.1;
next	;

1.1.2.1
date	2006.09.27.06.09.23;	author jsipek;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2006.09.30.22.47.00;	author jsipek;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2006.10.04.23.03.46;	author jsipek;	state dead;
branches;
next	;


desc
@@


1.1
log
@file lookup-rewrite was initially added on branch LKML-branch.
@
text
@@


1.1.2.1
log
@Few things here and there to make mount point crossing possible
@
text
@a0 55
diff -r b718f77187b7 fs/namei.c
--- a/fs/namei.c	Sat Sep 23 02:53:41 2006 -0400
+++ b/fs/namei.c	Sun Sep 24 18:58:24 2006 -0400
@@@@ -1267,8 +1267,8 @@@@ static struct dentry *lookup_hash(struct
 	return __lookup_hash(&nd->last, nd->dentry, nd);
 }
 
-/* SMP-safe */
-struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
+struct dentry * lookup_one_len_nd(const char *name, struct dentry * base,
+				  int len, struct nameidata * nd)
 {
 	unsigned long hash;
 	struct qstr this;
@@@@ -1288,7 +1288,7 @@@@ struct dentry * lookup_one_len(const cha
 	}
 	this.hash = end_name_hash(hash);
 
-	return __lookup_hash(&this, base, NULL);
+	return __lookup_hash(&this, base, nd);
 access:
 	return ERR_PTR(-EACCES);
 }
@@@@ -2716,7 +2716,7 @@@@ EXPORT_SYMBOL(get_write_access); /* binf
 EXPORT_SYMBOL(get_write_access); /* binfmt_aout */
 EXPORT_SYMBOL(getname);
 EXPORT_SYMBOL(lock_rename);
-EXPORT_SYMBOL(lookup_one_len);
+EXPORT_SYMBOL(lookup_one_len_nd);
 EXPORT_SYMBOL(page_follow_link_light);
 EXPORT_SYMBOL(page_put_link);
 EXPORT_SYMBOL(page_readlink);
diff -r b718f77187b7 include/linux/namei.h
--- a/include/linux/namei.h	Sat Sep 23 02:53:41 2006 -0400
+++ b/include/linux/namei.h	Sun Sep 24 18:58:27 2006 -0400
@@@@ -74,7 +74,7 @@@@ extern struct file *nameidata_to_filp(st
 extern struct file *nameidata_to_filp(struct nameidata *nd, int flags);
 extern void release_open_intent(struct nameidata *);
 
-extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
+extern struct dentry * lookup_one_len_nd(const char *, struct dentry *, int, struct nameidata *);
 
 extern int follow_down(struct vfsmount **, struct dentry **);
 extern int follow_up(struct vfsmount **, struct dentry **);
@@@@ -92,4 +92,10 @@@@ static inline char *nd_get_link(struct n
 	return nd->saved_names[nd->depth];
 }
 
+/* SMP-safe */
+static inline struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
+{
+	return lookup_one_len_nd(name, base, len, NULL);
+}
+
 #endif /* _LINUX_NAMEI_H */
@


1.1.2.2
log
@Nice, hopefully working lookup_one_len replacement that allows crossing
mountpoints
@
text
@d1 5
a5 6
diff -r e9a6970edf33 fs/namei.c
--- a/fs/namei.c	Wed Sep 27 11:15:01 2006 -0400
+++ b/fs/namei.c	Sat Sep 30 18:30:51 2006 -0400
@@@@ -547,11 +547,6 @@@@ fail:
 	path_release(nd);
 	return PTR_ERR(link);
a6 5
-
-struct path {
-	struct vfsmount *mnt;
-	struct dentry *dentry;
-};
d8 1
a8 6
 static inline void dput_path(struct path *path, struct nameidata *nd)
 {
@@@@ -1268,7 +1263,7 @@@@ static struct dentry *lookup_hash(struct
 }
 
 /* SMP-safe */
d10 2
a11 1
+struct dentry * lookup_one_len(const char *name, struct dentry * base, int len)
d15 6
a20 2
@@@@ -1291,6 +1286,27 @@@@ struct dentry * lookup_one_len(const cha
 	return __lookup_hash(&this, base, NULL);
a22 21
+}
+
+/*
+ * name - path component to look up
+ * dir  - directory to look in
+ * len  - length of 'name'
+ * path - struct containing the vfsmount pointer
+ */
+struct dentry *lookup_one_len_path(const char *name, struct dentry *dir, int len, struct path *path)
+{
+	struct dentry *d;
+
+	d = lookup_one_len(name, dir, len);
+	if (IS_ERR(d))
+		return d;
+
+	path->dentry = d;
+
+	follow_mount(&path->mnt, &path->dentry);
+	
+	return path->dentry;
d24 2
a25 3
 
 /*
@@@@ -2717,6 +2733,7 @@@@ EXPORT_SYMBOL(getname);
d28 2
a29 2
 EXPORT_SYMBOL(lookup_one_len);
+EXPORT_SYMBOL(lookup_one_len_path);
d33 5
a37 16
diff -r e9a6970edf33 include/linux/namei.h
--- a/include/linux/namei.h	Wed Sep 27 11:15:01 2006 -0400
+++ b/include/linux/namei.h	Sat Sep 30 18:31:12 2006 -0400
@@@@ -26,6 +26,11 @@@@ struct nameidata {
 	union {
 		struct open_intent open;
 	} intent;
+};
+
+struct path {
+	struct vfsmount *mnt;
+	struct dentry *dentry;
 };
 
 /*
@@@@ -75,6 +80,7 @@@@ extern void release_open_intent(struct n
d40 2
a41 2
 extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
+extern struct dentry * lookup_one_len_path(const char *, struct dentry *, int, struct path *);
d45 11
@


1.1.2.3
log
@lookup_one_len{,_nd} code
@
text
@@


