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


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

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

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

1.1.2.3
date	2006.10.05.17.30.46;	author jsipek;	state Exp;
branches;
next	1.1.2.4;

1.1.2.4
date	2006.10.07.02.03.25;	author jsipek;	state Exp;
branches;
next	1.1.2.5;

1.1.2.5
date	2006.10.07.04.43.42;	author jsipek;	state dead;
branches;
next	;


desc
@@


1.1
log
@file intent-pass was initially added on branch LKML-branch.
@
text
@@


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


1.1.2.2
log
@Split into 2 patches - one for intent passing, other for lookup_one_len
changes
@
text
@a0 140
diff -r 45548d27a3f5 fs/unionfs/commonfops.c
--- a/fs/unionfs/commonfops.c	Wed Oct 04 20:09:35 2006 -0400
+++ b/fs/unionfs/commonfops.c	Wed Oct 04 20:09:39 2006 -0400
@@@@ -36,7 +36,13 @@@@ static int copyup_deleted_file(struct fi
 	struct dentry *hidden_dentry = NULL;
 	struct dentry *hidden_dir_dentry = NULL;
 
+	struct nameidata nd;
+
 	hidden_dentry = dtohd_index(dentry, bstart);
+
+	nd.dentry = hidden_dentry;
+	nd.mnt = dtohm_index(dentry, bstart);
+	nd.flags = LOOKUP_OPEN | LOOKUP_CREATE;
 
 	sprintf(name, ".unionfs%*.*lx",
 			i_inosize, i_inosize, hidden_dentry->d_inode->i_ino);
@@@@ -52,8 +58,8 @@@@ static int copyup_deleted_file(struct fi
 		printk(KERN_DEBUG "unionfs: trying to rename %s to %s\n",
 				dentry->d_name.name, name);
 
-		tmp_dentry = lookup_one_len(name, hidden_dentry->d_parent,
-					    UNIONFS_TMPNAM_LEN);
+		tmp_dentry = lookup_one_len_nd(name, hidden_dentry->d_parent,
+					    UNIONFS_TMPNAM_LEN, &nd);
 		if (IS_ERR(tmp_dentry)) {
 			err = PTR_ERR(tmp_dentry);
 			goto out;
diff -r 45548d27a3f5 fs/unionfs/dentry.c
--- a/fs/unionfs/dentry.c	Wed Oct 04 20:09:35 2006 -0400
+++ b/fs/unionfs/dentry.c	Wed Oct 04 20:09:39 2006 -0400
@@@@ -38,6 +38,13 @@@@ int unionfs_d_revalidate(struct dentry *
 	int restart = 0;
 	int interpose_flag;
 
+	struct nameidata lowernd;
+
+	if (nd)
+		memcpy(&lowernd, nd, sizeof(struct nameidata));
+	else
+		memset(&lowernd, 0, sizeof(struct nameidata));
+
 restart:
 	verify_locked(dentry);
 
@@@@ -124,7 +131,7 @@@@ restart:
 			mutex_unlock(&dentry->d_inode->i_mutex);
 		}
 
-		result = unionfs_lookup_backend(dentry, interpose_flag);
+		result = unionfs_lookup_backend(dentry, &lowernd, interpose_flag);
 		if (result) {
 			if (IS_ERR(result)) {
 				valid = 0;
diff -r 45548d27a3f5 fs/unionfs/inode.c
--- a/fs/unionfs/inode.c	Wed Oct 04 20:09:35 2006 -0400
+++ b/fs/unionfs/inode.c	Wed Oct 04 20:09:39 2006 -0400
@@@@ -195,8 +195,15 @@@@ struct dentry *unionfs_lookup(struct ino
 struct dentry *unionfs_lookup(struct inode *parent, struct dentry *dentry,
 			      struct nameidata *nd)
 {
+	struct nameidata lowernd;
+
+	if (nd)
+		memcpy(&lowernd, nd, sizeof(struct nameidata));
+	else
+		memset(&lowernd, 0, sizeof(struct nameidata));
+
 	/* The locking is done by unionfs_lookup_backend. */
-	return unionfs_lookup_backend(dentry, INTERPOSE_LOOKUP);
+	return unionfs_lookup_backend(dentry, &lowernd, INTERPOSE_LOOKUP);
 }
 
 static int unionfs_link(struct dentry *old_dentry, struct inode *dir,
diff -r 45548d27a3f5 fs/unionfs/lookup.c
--- a/fs/unionfs/lookup.c	Wed Oct 04 20:09:35 2006 -0400
+++ b/fs/unionfs/lookup.c	Wed Oct 04 20:09:39 2006 -0400
@@@@ -21,7 +21,7 @@@@ static int is_opaque_dir(struct dentry *
 static int is_opaque_dir(struct dentry *dentry, int bindex);
 static int is_validname(const char *name);
 
-struct dentry *unionfs_lookup_backend(struct dentry *dentry, int lookupmode)
+struct dentry *unionfs_lookup_backend(struct dentry *dentry, struct nameidata *nd, int lookupmode)
 {
 	int err = 0;
 	struct dentry *hidden_dentry = NULL;
@@@@ -148,8 +148,12 @@@@ struct dentry *unionfs_lookup_backend(st
 		wh_hidden_dentry = NULL;
 
 		/* Now do regular lookup; lookup foo */
-		hidden_dentry = lookup_one_len(name, hidden_dir_dentry,
-					       namelen);
+		nd->dentry = dtohd_index(dentry, bindex);
+		/* FIXME: fix following line for mount point crossing */
+		nd->mnt = dtohm_index(parent_dentry, bindex);
+
+		hidden_dentry = lookup_one_len_nd(name, hidden_dir_dentry,
+					       namelen, nd);
 		if (IS_ERR(hidden_dentry)) {
 			dput(first_hidden_dentry);
 			mntput(first_hidden_mnt);
@@@@ -231,8 +235,12 @@@@ out_negative:
 	}
 	/* This should only happen if we found a whiteout. */
 	if (first_dentry_offset == -1) {
-		first_hidden_dentry = lookup_one_len(name, hidden_dir_dentry,
-						     namelen);
+		nd->dentry = dentry;
+		/* FIXME: fix following line for mount point crossing */
+		nd->mnt = dtohm_index(parent_dentry, bindex);
+
+		first_hidden_dentry = lookup_one_len_nd(name, hidden_dir_dentry,
+						     namelen, nd);
 		first_dentry_offset = bindex;
 		if (IS_ERR(first_hidden_dentry)) {
 			err = PTR_ERR(first_hidden_dentry);
@@@@ -324,8 +332,9 @@@@ int unionfs_partial_lookup(struct dentry
 int unionfs_partial_lookup(struct dentry *dentry)
 {
 	struct dentry *tmp;
-
-	tmp = unionfs_lookup_backend(dentry, INTERPOSE_PARTIAL);
+	struct nameidata nd = { .flags = 0 };
+
+	tmp = unionfs_lookup_backend(dentry, &nd, INTERPOSE_PARTIAL);
 	if (!tmp)
 		return 0;
 	if (IS_ERR(tmp))
diff -r 45548d27a3f5 fs/unionfs/union.h
--- a/fs/unionfs/union.h	Wed Oct 04 20:09:35 2006 -0400
+++ b/fs/unionfs/union.h	Wed Oct 04 20:09:39 2006 -0400
@@@@ -399,7 +399,7 @@@@ static inline void fist_copy_attr_all(st
 	dest->i_flags = src->i_flags;
 }
 
-struct dentry *unionfs_lookup_backend(struct dentry *dentry, int lookupmode);
+struct dentry *unionfs_lookup_backend(struct dentry *dentry, struct nameidata *nd, int lookupmode);
 int is_stale_inode(struct inode *inode);
 void make_stale_inode(struct inode *inode);
 
@


1.1.2.3
log
@More intent passing - the intent is wrong, but that should be easy to fix
Moved lookup_one_len_nd to be the second patch in the series
Make the patches little bit uniform
@
text
@d1 3
a3 3
diff -r d8228834b494 fs/unionfs/commonfops.c
--- a/fs/unionfs/commonfops.c	Wed Oct 04 20:32:27 2006 -0400
+++ b/fs/unionfs/commonfops.c	Wed Oct 04 20:32:27 2006 -0400
d29 3
a31 3
diff -r d8228834b494 fs/unionfs/dentry.c
--- a/fs/unionfs/dentry.c	Wed Oct 04 20:32:27 2006 -0400
+++ b/fs/unionfs/dentry.c	Wed Oct 04 20:32:27 2006 -0400
d55 3
a57 3
diff -r d8228834b494 fs/unionfs/inode.c
--- a/fs/unionfs/inode.c	Wed Oct 04 20:32:27 2006 -0400
+++ b/fs/unionfs/inode.c	Wed Oct 04 20:32:27 2006 -0400
d75 3
a77 3
diff -r d8228834b494 fs/unionfs/lookup.c
--- a/fs/unionfs/lookup.c	Wed Oct 04 20:32:27 2006 -0400
+++ b/fs/unionfs/lookup.c	Wed Oct 04 20:32:27 2006 -0400
d129 3
a131 3
diff -r d8228834b494 fs/unionfs/union.h
--- a/fs/unionfs/union.h	Wed Oct 04 20:32:27 2006 -0400
+++ b/fs/unionfs/union.h	Wed Oct 04 20:32:27 2006 -0400
a139 30
 
diff -r d8228834b494 fs/unionfs/subr.c
--- a/fs/unionfs/subr.c	Wed Oct 04 20:32:27 2006 -0400
+++ b/fs/unionfs/subr.c	Wed Oct 04 22:30:35 2006 -0400
@@@@ -31,6 +31,10 @@@@ int create_whiteout(struct dentry *dentr
 	char *name = NULL;
 	int err = -EINVAL;
 
+	struct nameidata nd;
+
+	memset(&nd, 0, sizeof(struct nameidata));
+
 	verify_locked(dentry);
 
 	bstart = dbstart(dentry);
@@@@ -61,9 +65,13 @@@@ int create_whiteout(struct dentry *dentr
 				continue;
 			}
 		}
+
+		nd.mnt = dtohm_index(dentry, bindex);
+		nd.flags = LOOKUP_CREATE;
+
 		hidden_wh_dentry =
-		    lookup_one_len(name, hidden_dentry->d_parent,
-				   dentry->d_name.len + UNIONFS_WHLEN);
+		    lookup_one_len_nd(name, hidden_dentry->d_parent,
+				   dentry->d_name.len + UNIONFS_WHLEN, &nd);
 		if (IS_ERR(hidden_wh_dentry))
 			continue;
@


1.1.2.4
log
@Undo few users of lookup_one_len_nd
@
text
@d1 31
a31 3
diff -r 185dff50fd55 fs/unionfs/dentry.c
--- a/fs/unionfs/dentry.c	Thu Oct 05 13:23:40 2006 -0400
+++ b/fs/unionfs/dentry.c	Thu Oct 05 13:23:40 2006 -0400
d55 3
a57 3
diff -r 185dff50fd55 fs/unionfs/inode.c
--- a/fs/unionfs/inode.c	Thu Oct 05 13:23:40 2006 -0400
+++ b/fs/unionfs/inode.c	Thu Oct 05 13:23:40 2006 -0400
d75 3
a77 3
diff -r 185dff50fd55 fs/unionfs/lookup.c
--- a/fs/unionfs/lookup.c	Thu Oct 05 13:23:40 2006 -0400
+++ b/fs/unionfs/lookup.c	Thu Oct 05 13:23:40 2006 -0400
d129 3
a131 14
diff -r 185dff50fd55 fs/unionfs/subr.c
--- a/fs/unionfs/subr.c	Thu Oct 05 13:23:40 2006 -0400
+++ b/fs/unionfs/subr.c	Fri Oct 06 19:47:30 2006 -0400
@@@@ -61,6 +61,7 @@@@ int create_whiteout(struct dentry *dentr
 				continue;
 			}
 		}
+
 		hidden_wh_dentry =
 		    lookup_one_len(name, hidden_dentry->d_parent,
 				   dentry->d_name.len + UNIONFS_WHLEN);
diff -r 185dff50fd55 fs/unionfs/union.h
--- a/fs/unionfs/union.h	Thu Oct 05 13:23:40 2006 -0400
+++ b/fs/unionfs/union.h	Thu Oct 05 13:23:40 2006 -0400
d140 30
@


1.1.2.5
log
@Collapse 3 feature patches
@
text
@@


