Loading fs/9p/vfs_inode.c +9 −18 Original line number Original line Diff line number Diff line Loading @@ -788,7 +788,6 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, struct p9_fid *dfid, *fid; struct p9_fid *dfid, *fid; struct inode *inode; struct inode *inode; char *name; char *name; int result = 0; p9_debug(P9_DEBUG_VFS, "dir: %p dentry: (%s) %p flags: %x\n", p9_debug(P9_DEBUG_VFS, "dir: %p dentry: (%s) %p flags: %x\n", dir, dentry->d_name.name, dentry, flags); dir, dentry->d_name.name, dentry, flags); Loading @@ -806,13 +805,11 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, name = (char *) dentry->d_name.name; name = (char *) dentry->d_name.name; fid = p9_client_walk(dfid, 1, &name, 1); fid = p9_client_walk(dfid, 1, &name, 1); if (IS_ERR(fid)) { if (IS_ERR(fid)) { result = PTR_ERR(fid); if (fid == ERR_PTR(-ENOENT)) { if (result == -ENOENT) { d_add(dentry, NULL); inode = NULL; return NULL; goto inst_out; } } return ERR_CAST(fid); return ERR_PTR(result); } } /* /* * Make sure we don't use a wrong inode due to parallel * Make sure we don't use a wrong inode due to parallel Loading @@ -824,12 +821,10 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, else else inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); if (IS_ERR(inode)) { if (IS_ERR(inode)) { result = PTR_ERR(inode); p9_client_clunk(fid); inode = NULL; return ERR_CAST(inode); goto error; } } v9fs_fid_add(dentry, fid); v9fs_fid_add(dentry, fid); inst_out: /* /* * If we had a rename on the server and a parallel lookup * If we had a rename on the server and a parallel lookup * for the new name, then make sure we instantiate with * for the new name, then make sure we instantiate with Loading @@ -838,13 +833,9 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, * k/b. * k/b. */ */ res = d_materialise_unique(dentry, inode); res = d_materialise_unique(dentry, inode); if (!IS_ERR(res)) if (IS_ERR(res)) return res; result = PTR_ERR(res); error: p9_client_clunk(fid); p9_client_clunk(fid); return res; return ERR_PTR(result); } } static int static int Loading Loading
fs/9p/vfs_inode.c +9 −18 Original line number Original line Diff line number Diff line Loading @@ -788,7 +788,6 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, struct p9_fid *dfid, *fid; struct p9_fid *dfid, *fid; struct inode *inode; struct inode *inode; char *name; char *name; int result = 0; p9_debug(P9_DEBUG_VFS, "dir: %p dentry: (%s) %p flags: %x\n", p9_debug(P9_DEBUG_VFS, "dir: %p dentry: (%s) %p flags: %x\n", dir, dentry->d_name.name, dentry, flags); dir, dentry->d_name.name, dentry, flags); Loading @@ -806,13 +805,11 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, name = (char *) dentry->d_name.name; name = (char *) dentry->d_name.name; fid = p9_client_walk(dfid, 1, &name, 1); fid = p9_client_walk(dfid, 1, &name, 1); if (IS_ERR(fid)) { if (IS_ERR(fid)) { result = PTR_ERR(fid); if (fid == ERR_PTR(-ENOENT)) { if (result == -ENOENT) { d_add(dentry, NULL); inode = NULL; return NULL; goto inst_out; } } return ERR_CAST(fid); return ERR_PTR(result); } } /* /* * Make sure we don't use a wrong inode due to parallel * Make sure we don't use a wrong inode due to parallel Loading @@ -824,12 +821,10 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, else else inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); if (IS_ERR(inode)) { if (IS_ERR(inode)) { result = PTR_ERR(inode); p9_client_clunk(fid); inode = NULL; return ERR_CAST(inode); goto error; } } v9fs_fid_add(dentry, fid); v9fs_fid_add(dentry, fid); inst_out: /* /* * If we had a rename on the server and a parallel lookup * If we had a rename on the server and a parallel lookup * for the new name, then make sure we instantiate with * for the new name, then make sure we instantiate with Loading @@ -838,13 +833,9 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, * k/b. * k/b. */ */ res = d_materialise_unique(dentry, inode); res = d_materialise_unique(dentry, inode); if (!IS_ERR(res)) if (IS_ERR(res)) return res; result = PTR_ERR(res); error: p9_client_clunk(fid); p9_client_clunk(fid); return res; return ERR_PTR(result); } } static int static int Loading