mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
Windows: Enforce free space checks every 1MB
Instead of performing a free space (or quota) check on every extending write, perform the check only when the file length is increased beyond the next 1MB boundary. The file server permits 1MB quota over runs and issuing the volume status rpc to the file server is extremely expensive. Especially for append only applications that write just a few bytes at a time. Change-Id: I74ff17ba5a95adb41350add24bc09a74c950a4fb Reviewed-on: http://gerrit.openafs.org/9555 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
parent
8b76110e23
commit
eecf7a1372
@ -2909,9 +2909,22 @@ long cm_SetLength(cm_scache_t *scp, osi_hyper_t *sizep, cm_user_t *userp,
|
|||||||
* Dropping it is ok because we are holding scp->bufCreateLock
|
* Dropping it is ok because we are holding scp->bufCreateLock
|
||||||
* which prevents the size of the file from changing.
|
* which prevents the size of the file from changing.
|
||||||
*/
|
*/
|
||||||
lock_ReleaseWrite(&scp->rw);
|
afs_uint64 nextChunk = scp->length.QuadPart;
|
||||||
available = cm_IsSpaceAvailable(&scp->fid, sizep, userp, reqp);
|
|
||||||
lock_ObtainWrite(&scp->rw);
|
nextChunk -= (nextChunk & 0xFFFFF);
|
||||||
|
nextChunk += 0x100000;
|
||||||
|
|
||||||
|
if (sizep->QuadPart > nextChunk) {
|
||||||
|
lock_ReleaseWrite(&scp->rw);
|
||||||
|
available = cm_IsSpaceAvailable(&scp->fid, sizep, userp, reqp);
|
||||||
|
lock_ObtainWrite(&scp->rw);
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
* The file server permits 1MB quota overruns so only check
|
||||||
|
* when the file size increases by at least that much.
|
||||||
|
*/
|
||||||
|
available = 1;
|
||||||
|
}
|
||||||
if (available) {
|
if (available) {
|
||||||
scp->length = *sizep;
|
scp->length = *sizep;
|
||||||
scp->mask |= CM_SCACHEMASK_LENGTH;
|
scp->mask |= CM_SCACHEMASK_LENGTH;
|
||||||
|
Loading…
Reference in New Issue
Block a user