Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124740
b: refs/heads/master
c: 5584c30
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Dec 23, 2008
1 parent 594624f commit d83e841
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bd7bf9d540c001055fba796ebf146d90e4dd2eb2
refs/heads/master: 5584c30630f8a4aac557093b1603e166fe7385be
15 changes: 8 additions & 7 deletions trunk/fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ struct dentry_operations nfs4_dentry_operations = {
* Use intent information to determine whether we need to substitute
* the NFSv4-style stateful OPEN for the LOOKUP call
*/
static int is_atomic_open(struct inode *dir, struct nameidata *nd)
static int is_atomic_open(struct nameidata *nd)
{
if (nd == NULL || nfs_lookup_check_intent(nd, LOOKUP_OPEN) == 0)
return 0;
Expand All @@ -996,7 +996,7 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
dir->i_sb->s_id, dir->i_ino, dentry->d_name.name);

/* Check that we are indeed trying to open this file */
if (!is_atomic_open(dir, nd))
if (!is_atomic_open(nd))
goto no_open;

if (dentry->d_name.len > NFS_SERVER(dir)->namelen) {
Expand Down Expand Up @@ -1047,10 +1047,10 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
struct inode *dir;
int openflags, ret = 0;

if (!is_atomic_open(nd))
goto no_open;
parent = dget_parent(dentry);
dir = parent->d_inode;
if (!is_atomic_open(dir, nd))
goto no_open;
/* We can't create new files in nfs_open_revalidate(), so we
* optimize away revalidation of negative dentries.
*/
Expand All @@ -1062,11 +1062,11 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)

/* NFS only supports OPEN on regular files */
if (!S_ISREG(inode->i_mode))
goto no_open;
goto no_open_dput;
openflags = nd->intent.open.flags;
/* We cannot do exclusive creation on a positive dentry */
if ((openflags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL))
goto no_open;
goto no_open_dput;
/* We can't create new files, or truncate existing ones here */
openflags &= ~(O_CREAT|O_TRUNC);

Expand All @@ -1081,8 +1081,9 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
if (!ret)
d_drop(dentry);
return ret;
no_open:
no_open_dput:
dput(parent);
no_open:
if (inode != NULL && nfs_have_delegation(inode, FMODE_READ))
return 1;
return nfs_lookup_revalidate(dentry, nd);
Expand Down

0 comments on commit d83e841

Please sign in to comment.