Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 229069
b: refs/heads/master
c: af7542f
h: refs/heads/master
i:
  229067: 305f080
v: v3
  • Loading branch information
Aneesh Kumar K.V authored and Eric Van Hensbergen committed Jan 11, 2011
1 parent 07fb7f3 commit 371f24f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 48 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: 53c06f4e0a4621bb40c8be6ff701e07f6226143d
refs/heads/master: af7542fc8ac678ce69dbd5c9643c52897b47c66f
75 changes: 28 additions & 47 deletions trunk/fs/9p/vfs_inode_dotl.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,60 +196,41 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode,
err);
goto error;
}
/* instantiate inode and assign the unopened fid to the dentry */
if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE ||
(nd && nd->flags & LOOKUP_OPEN)) {
fid = p9_client_walk(dfid, 1, &name, 1);
if (IS_ERR(fid)) {
err = PTR_ERR(fid);
P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
err);
fid = NULL;
goto error;
}

inode = v9fs_inode_from_fid(v9ses, fid, dir->i_sb);
if (IS_ERR(inode)) {
err = PTR_ERR(inode);
P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n",
err);
goto error;
}
d_set_d_op(dentry, &v9fs_cached_dentry_operations);
d_instantiate(dentry, inode);
err = v9fs_fid_add(dentry, fid);
if (err < 0)
goto error;
/* The fid would get clunked via a dput */
/* instantiate inode and assign the unopened fid to the dentry */
fid = p9_client_walk(dfid, 1, &name, 1);
if (IS_ERR(fid)) {
err = PTR_ERR(fid);
P9_DPRINTK(P9_DEBUG_VFS, "p9_clinet_walk failed %d\n", err);
fid = NULL;
} else {
/*
* Not in cached mode. No need to populate
* inode with stat. We need to get an inode
* so that we can set the acl with dentry
*/
inode = v9fs_get_inode(dir->i_sb, mode);
if (IS_ERR(inode)) {
err = PTR_ERR(inode);
goto error;
}
d_set_d_op(dentry, &v9fs_dentry_operations);
d_instantiate(dentry, inode);
goto error;
}
inode = v9fs_inode_from_fid(v9ses, fid, dir->i_sb);
if (IS_ERR(inode)) {
err = PTR_ERR(inode);
P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", err);
goto error;
}
if (v9ses->cache)
dentry->d_op = &v9fs_cached_dentry_operations;
else
dentry->d_op = &v9fs_dentry_operations;

d_instantiate(dentry, inode);
err = v9fs_fid_add(dentry, fid);
if (err < 0)
goto error;

/* Now set the ACL based on the default value */
v9fs_set_create_acl(dentry, dacl, pacl);

/* if we are opening a file, assign the open fid to the file */
if (nd && nd->flags & LOOKUP_OPEN) {
filp = lookup_instantiate_filp(nd, dentry, generic_file_open);
if (IS_ERR(filp)) {
p9_client_clunk(ofid);
return PTR_ERR(filp);
}
filp->private_data = ofid;
} else
/* Since we are opening a file, assign the open fid to the file */
filp = lookup_instantiate_filp(nd, dentry, generic_file_open);
if (IS_ERR(filp)) {
p9_client_clunk(ofid);

return PTR_ERR(filp);
}
filp->private_data = ofid;
return 0;

error:
Expand Down

0 comments on commit 371f24f

Please sign in to comment.