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


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

1.1.2.1
date	2006.10.12.07.27.08;	author jsipek;	state Exp;
branches;
next	;


desc
@@


1.1
log
@file 02-lookup-one-len-changes was initially added on branch LKML-branch.
@
text
@@


1.1.2.1
log
@Try3, sent to akpm for inclusion in -mm
@
text
@a0 85
From jsipek@@cs.sunysb.edu Thu Oct 12 02:18:40 2006
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [PATCH 02 of 23][-mm] lookup_one_len_nd - lookup_one_len with nameidata
	argument
Message-Id: <35c7100f2106ea293cac.1160633919@@thor.fsl.cs.sunysb.edu>
In-Reply-To: <patchbomb.1160633917@@thor.fsl.cs.sunysb.edu>
Date: Thu, 12 Oct 2006 02:18:39 -0400
From: Josef "Jeff" Sipek <jsipek@@cs.sunysb.edu>
To: akpm@@osdl.org

From: Josef "Jeff" Sipek <jsipek@@cs.sunysb.edu>

This patch renames lookup_one_len to lookup_one_len_nd, and adds a nameidata
argument. An inline function, lookup_one_len (which calls lookup_one_len_nd
with nd == NULL) preserves original behavior.

This patch allows a stackable filesystem to pass down the lookup intent by
setting the flags in the nameidata structure passed to the lookup function.

The following Unionfs patches depend on this one.

Signed-off-by: Josef "Jeff" Sipek <jsipek@@cs.sunysb.edu>

---

2 files changed, 13 insertions(+), 5 deletions(-)
fs/namei.c            |    8 ++++----
include/linux/namei.h |   10 +++++++++-

diff --git a/fs/namei.c b/fs/namei.c
--- a/fs/namei.c
+++ b/fs/namei.c
@@@@ -1297,8 +1297,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;
@@@@ -1318,7 +1318,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);
 }
@@@@ -2763,7 +2763,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 --git a/include/linux/namei.h b/include/linux/namei.h
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@@@ -76,7 +76,15 @@@@ 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 *);
+
+/* SMP-safe */
+static inline struct dentry *lookup_one_len(const char *name,
+			struct dentry *dir, int len)
+{
+	return lookup_one_len_nd(name, dir, len, NULL);
+}
 
 extern int follow_down(struct vfsmount **, struct dentry **);
 extern int follow_up(struct vfsmount **, struct dentry **);


@

