[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1333637940-31884-22-git-send-email-miklos@szeredi.hu>
Date: Thu, 5 Apr 2012 16:58:47 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: viro@...IV.linux.org.uk
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
hch@...radead.org, mszeredi@...e.cz
Subject: [PATCH 21/34] vfs: lookup_open(): expand lookup_hash()
From: Miklos Szeredi <mszeredi@...e.cz>
Copy __lookup_hash() into lookup_open(). The next patch will insert the atomic
open call just before the real lookup.
Signed-off-by: Miklos Szeredi <mszeredi@...e.cz>
---
fs/namei.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index 426b544..4815607 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2231,14 +2231,24 @@ static struct file *lookup_open(struct nameidata *nd, struct path *path,
int *want_write, bool *created)
{
struct dentry *dir = nd->path.dentry;
+ struct inode *dir_inode = dir->d_inode;
struct dentry *dentry;
int error;
+ bool need_lookup;
*created = false;
- dentry = lookup_hash(nd);
+ dentry = lookup_dcache(&nd->last, dir, nd, &need_lookup);
if (IS_ERR(dentry))
return ERR_CAST(dentry);
+ if (need_lookup) {
+ BUG_ON(dentry->d_inode);
+
+ dentry = lookup_real(dir_inode, dentry, nd);
+ if (IS_ERR(dentry))
+ return ERR_CAST(dentry);
+ }
+
/* Negative dentry, just create the file */
if (!dentry->d_inode && (op->open_flag & O_CREAT)) {
umode_t mode = op->mode;
--
1.7.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists