mirror of
https://git.openafs.org/openafs.git
synced 2025-01-22 08:50:17 +00:00
Clean up partial write support on Linux by calling afs_DoPartialWrite
from afs_linux_writepage_sync.
This commit is contained in:
parent
9e06544249
commit
14dc5dfa08
@ -1502,13 +1502,24 @@ int afs_linux_writepage_sync(struct inode *ip, struct page *pp,
|
|||||||
ICL_TYPE_POINTER, pp,
|
ICL_TYPE_POINTER, pp,
|
||||||
ICL_TYPE_INT32, atomic_read(&pp->count),
|
ICL_TYPE_INT32, atomic_read(&pp->count),
|
||||||
ICL_TYPE_INT32, 99999);
|
ICL_TYPE_INT32, 99999);
|
||||||
|
|
||||||
setup_uio(&tuio, &iovec, buffer, base, count, UIO_WRITE, AFS_UIOSYS);
|
setup_uio(&tuio, &iovec, buffer, base, count, UIO_WRITE, AFS_UIOSYS);
|
||||||
|
|
||||||
code = afs_write(vcp, &tuio, f_flags, credp, 0);
|
code = afs_write(vcp, &tuio, f_flags, credp, 0);
|
||||||
|
|
||||||
vcache2inode(vcp);
|
vcache2inode(vcp);
|
||||||
|
|
||||||
|
if (!code && afs_stats_cmperf.cacheCurrDirtyChunks >
|
||||||
|
afs_stats_cmperf.cacheMaxDirtyChunks) {
|
||||||
|
struct vrequest treq;
|
||||||
|
|
||||||
|
ObtainWriteLock(&vcp->lock, 533);
|
||||||
|
if (!afs_InitReq(&treq, credp))
|
||||||
|
code = afs_DoPartialWrite(vcp, &treq);
|
||||||
|
ReleaseWriteLock(&vcp->lock);
|
||||||
|
}
|
||||||
code = code ? -code : count - tuio.uio_resid;
|
code = code ? -code : count - tuio.uio_resid;
|
||||||
|
|
||||||
afs_Trace4(afs_iclSetp, CM_TRACE_UPDATEPAGE, ICL_TYPE_POINTER, vcp,
|
afs_Trace4(afs_iclSetp, CM_TRACE_UPDATEPAGE, ICL_TYPE_POINTER, vcp,
|
||||||
ICL_TYPE_POINTER, pp,
|
ICL_TYPE_POINTER, pp,
|
||||||
ICL_TYPE_INT32, atomic_read(&pp->count),
|
ICL_TYPE_INT32, atomic_read(&pp->count),
|
||||||
|
@ -299,7 +299,7 @@ afs_MemWrite(avc, auio, aio, acred, noLock)
|
|||||||
#endif
|
#endif
|
||||||
ReleaseWriteLock(&tdc->lock);
|
ReleaseWriteLock(&tdc->lock);
|
||||||
afs_PutDCache(tdc);
|
afs_PutDCache(tdc);
|
||||||
#if !defined(AFS_VM_RDWR_ENV) || defined(AFS_LINUX22_ENV)
|
#if !defined(AFS_VM_RDWR_ENV)
|
||||||
/*
|
/*
|
||||||
* If write is implemented via VM, afs_DoPartialWrite() is called from
|
* If write is implemented via VM, afs_DoPartialWrite() is called from
|
||||||
* the high-level write op.
|
* the high-level write op.
|
||||||
@ -618,7 +618,7 @@ afs_UFSWrite(avc, auio, aio, acred, noLock)
|
|||||||
osi_UFSClose(tfile);
|
osi_UFSClose(tfile);
|
||||||
ReleaseWriteLock(&tdc->lock);
|
ReleaseWriteLock(&tdc->lock);
|
||||||
afs_PutDCache(tdc);
|
afs_PutDCache(tdc);
|
||||||
#if !defined(AFS_VM_RDWR_ENV) || defined(AFS_LINUX22_ENV)
|
#if !defined(AFS_VM_RDWR_ENV)
|
||||||
/*
|
/*
|
||||||
* If write is implemented via VM, afs_DoPartialWrite() is called from
|
* If write is implemented via VM, afs_DoPartialWrite() is called from
|
||||||
* the high-level write op.
|
* the high-level write op.
|
||||||
|
Loading…
Reference in New Issue
Block a user