public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [8/9] Lustre VFS patches for 2.6
@ 2004-07-07 12:47 Oleg Drokin
  0 siblings, 0 replies; only message in thread
From: Oleg Drokin @ 2004-07-07 12:47 UTC (permalink / raw)
  To: linux-kernel, braam

Mark lookup of last path element so that filesystems can distinguish it
and e.g. perform some actions based on information in intent.

 fs/namei.c            |    8 ++++++++
 include/linux/namei.h |    3 +++
 2 files changed, 11 insertions(+)

Index: linux-2.6.6/fs/namei.c
===================================================================
--- linux-2.6.6.orig/fs/namei.c	2004-05-27 21:24:45.151896688 +0300
+++ linux-2.6.6/fs/namei.c	2004-05-27 22:48:34.155371952 +0300
@@ -677,7 +677,9 @@
 
 		if (inode->i_op->follow_link) {
 			mntget(next.mnt);
+			nd->flags |= LOOKUP_LINK_NOTLAST;
 			err = do_follow_link(next.dentry, nd);
+			nd->flags &= ~LOOKUP_LINK_NOTLAST;
 			dput(next.dentry);
 			mntput(next.mnt);
 			if (err)
@@ -723,7 +725,9 @@
 			if (err < 0)
 				break;
 		}
+		nd->flags |= LOOKUP_LAST;
 		err = do_lookup(nd, &this, &next);
+		nd->flags &= ~LOOKUP_LAST;
 		if (err)
 			break;
 		follow_mount(&next.mnt, &next.dentry);
@@ -1344,7 +1348,9 @@
 	dir = nd->dentry;
 	nd->flags &= ~LOOKUP_PARENT;
 	down(&dir->d_inode->i_sem);
+	nd->flags |= LOOKUP_LAST;
 	dentry = __lookup_hash(&nd->last, nd->dentry, nd);
+	nd->flags &= ~LOOKUP_LAST;
 
 do_last:
 	error = PTR_ERR(dentry);
@@ -1449,7 +1455,9 @@
 	}
 	dir = nd->dentry;
 	down(&dir->d_inode->i_sem);
+	nd->flags |= LOOKUP_LAST;
 	dentry = __lookup_hash(&nd->last, nd->dentry, nd);
+	nd->flags &= ~LOOKUP_LAST;
 	putname(nd->last.name);
 	goto do_last;
 }
Index: linux-2.6.6/include/linux/namei.h
===================================================================
--- linux-2.6.6.orig/include/linux/namei.h	2004-05-27 21:24:45.078907784 +0300
+++ linux-2.6.6/include/linux/namei.h	2004-05-27 22:47:58.870736032 +0300
@@ -70,6 +70,9 @@
 #define LOOKUP_CONTINUE		 4
 #define LOOKUP_PARENT		16
 #define LOOKUP_NOALT		32
+#define LOOKUP_LAST		64
+#define LOOKUP_LINK_NOTLAST	128
+
 /*
  * Intent data
  */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-07-07 12:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-07 12:47 [8/9] Lustre VFS patches for 2.6 Oleg Drokin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox