*/
static struct dentry *get_dentry_from_fid(cred_t *credp, struct VenusFid *afid)
{
- struct vrequest treq;
+ struct vrequest *treq = NULL;
struct vcache *vcp;
struct vattr vattr;
struct inode *ip;
struct dentry *dp;
afs_int32 code;
- code = afs_InitReq(&treq, credp);
+ code = afs_CreateReq(&treq, credp);
if (code) {
#ifdef OSI_EXPORT_DEBUG
- printk("afs: get_dentry_from_fid(0x%08x/%d/%d.%d): afs_InitReq: %d\n",
+ printk("afs: get_dentry_from_fid(0x%08x/%d/%d.%d): afs_CreateReq: %d\n",
afid->Cell, afid->Fid.Volume, afid->Fid.Vnode, afid->Fid.Unique,
code);
#endif
- return ERR_PTR(-afs_CheckCode(code, &treq, 101));
+ return ERR_PTR(-afs_CheckCode(code, NULL, 101));
}
- vcp = afs_GetVCache(afid, &treq, NULL, NULL);
+ vcp = afs_GetVCache(afid, treq, NULL, NULL);
if (vcp == NULL) {
#ifdef OSI_EXPORT_DEBUG
printk("afs: get_dentry_from_fid(0x%08x/%d/%d.%d): no vcache\n",
afid->Cell, afid->Fid.Volume, afid->Fid.Vnode, afid->Fid.Unique);
#endif
+ afs_DestroyReq(treq);
return NULL;
}
* So, if this fails, we don't really care very much.
*/
if (vType(vcp) == VDIR && vcp->mvstat != 2 && !vcp->f.parent.vnode)
- update_dir_parent(&treq, vcp);
+ update_dir_parent(treq, vcp);
/*
* If this is a volume root directory and fakestat is enabled,
* we might need to replace the directory by a mount point.
*/
- code = UnEvalFakeStat(&treq, &vcp);
+ code = UnEvalFakeStat(treq, &vcp);
if (code) {
#ifdef OSI_EXPORT_DEBUG
printk("afs: get_dentry_from_fid(0x%08x/%d/%d.%d): UnEvalFakeStat: %d\n",
code);
#endif
afs_PutVCache(vcp);
- return ERR_PTR(-afs_CheckCode(code, &treq, 103));
+ code = afs_CheckCode(code, treq, 103);
+ afs_DestroyReq(treq);
+ return ERR_PTR(-code);
}
ip = AFSTOV(vcp);
printk("afs: get_dentry_from_fid(0x%08x/%d/%d.%d): out of memory\n",
afid->Cell, afid->Fid.Volume, afid->Fid.Vnode, afid->Fid.Unique);
#endif
+ afs_DestroyReq(treq);
return ERR_PTR(-ENOMEM);
}
dp->d_op = &afs_dentry_operations;
+ afs_DestroyReq(treq);
return dp;
}
{
struct afs_fakestat_state fakestate;
struct get_name_data data;
- struct vrequest treq;
+ struct vrequest *treq = NULL;
struct volume *tvp;
struct vcache *vcp;
struct dcache *tdc;
vcp->f.fid.Cell, vcp->f.fid.Fid.Volume,
vcp->f.fid.Fid.Vnode, vcp->f.fid.Fid.Unique);
#endif
-
- code = afs_InitReq(&treq, credp);
+ code = afs_CreateReq(&treq, credp);
if (code) {
#ifdef OSI_EXPORT_DEBUG
- printk("afs: get_name(%s, 0x%08x/%d/%d.%d): afs_InitReq: %d\n",
+ printk("afs: get_name(%s, 0x%08x/%d/%d.%d): afs_CreateReq: %d\n",
parent->d_name.name ? (char *)parent->d_name.name : "?",
data.fid.Cell, data.fid.Fid.Volume,
data.fid.Fid.Vnode, data.fid.Fid.Unique, code);
data.fid.Cell, data.fid.Fid.Volume,
data.fid.Fid.Vnode, data.fid.Fid.Unique);
#endif
- vcp = afs_GetVCache(&data.fid, &treq, NULL, NULL);
+ vcp = afs_GetVCache(&data.fid, treq, NULL, NULL);
if (vcp) {
ObtainReadLock(&vcp->lock);
if (strlen(vcp->linkData + 1) <= NAME_MAX)
goto done;
}
- code = afs_EvalFakeStat(&vcp, &fakestate, &treq);
+ code = afs_EvalFakeStat(&vcp, &fakestate, treq);
if (code)
goto done;
redo:
if (!(vcp->f.states & CStatd)) {
- if ((code = afs_VerifyVCache2(vcp, &treq))) {
+ if ((code = afs_VerifyVCache2(vcp, treq))) {
#ifdef OSI_EXPORT_DEBUG
printk("afs: get_name(%s, 0x%08x/%d/%d.%d): VerifyVCache2(0x%08x/%d/%d.%d): %d\n",
parent->d_name.name ? (char *)parent->d_name.name : "?",
}
}
- tdc = afs_GetDCache(vcp, (afs_size_t) 0, &treq, &dirOffset, &dirLen, 1);
+ tdc = afs_GetDCache(vcp, (afs_size_t) 0, treq, &dirOffset, &dirLen, 1);
if (!tdc) {
#ifdef OSI_EXPORT_DEBUG
printk("afs: get_name(%s, 0x%08x/%d/%d.%d): GetDCache(0x%08x/%d/%d.%d): %d\n",
data.fid.Fid.Vnode, data.fid.Fid.Unique, name);
}
afs_PutFakeStat(&fakestate);
+ code = afs_CheckCode(code, treq, 102);
+ afs_DestroyReq(treq);
AFS_GUNLOCK();
crfree(credp);
- code = afs_CheckCode(code, &treq, 102);
return -code;
}
static struct dentry *afs_export_get_parent(struct dentry *child)
{
struct VenusFid tfid;
- struct vrequest treq;
+ struct vrequest *treq = NULL;
struct cell *tcell;
struct vcache *vcp;
struct dentry *dp = NULL;
} else {
/* any other vnode */
if (vType(vcp) == VDIR && !vcp->f.parent.vnode && vcp->mvstat != 1) {
- code = afs_InitReq(&treq, credp);
+ code = afs_CreateReq(&treq, credp);
if (code) {
#ifdef OSI_EXPORT_DEBUG
- printk("afs: get_parent(0x%08x/%d/%d.%d): InitReq: %d\n",
+ printk("afs: get_parent(0x%08x/%d/%d.%d): afs_CreateReq: %d\n",
vcp->f.fid.Cell, vcp->f.fid.Fid.Volume,
vcp->f.fid.Fid.Vnode, vcp->f.fid.Fid.Unique, code);
#endif
dp = ERR_PTR(-ENOENT);
goto done;
} else {
- code = update_dir_parent(&treq, vcp);
+ code = update_dir_parent(treq, vcp);
if (code) {
#ifdef OSI_EXPORT_DEBUG
printk("afs: get_parent(0x%08x/%d/%d.%d): update_dir_parent: %d\n",
}
done:
+ afs_DestroyReq(treq);
AFS_GUNLOCK();
crfree(credp);