static inline int
afs_linux_dopartialwrite(struct vcache *avc, cred_t *credp) {
struct vrequest treq;
- int code;
+ int code = 0;
if (!afs_InitReq(&treq, credp))
code = afs_DoPartialWrite(avc, &treq);
unsigned long offset, unsigned int count)
{
int code;
+ int code1 = 0;
struct vcache *vcp = VTOAFS(ip);
cred_t *credp;
afs_maybe_lock_kernel();
AFS_GLOCK();
ObtainWriteLock(&vcp->lock, 533);
- if (code == 0)
- code = afs_linux_dopartialwrite(vcp, credp);
+ if (code > 0)
+ code1 = afs_linux_dopartialwrite(vcp, credp);
afs_linux_complete_writeback(vcp);
ReleaseWriteLock(&vcp->lock);
AFS_GUNLOCK();
afs_maybe_unlock_kernel();
crfree(credp);
+ if (code1)
+ return code1;
+
return code;
}