Windows: Call CcDeferWrite rather than loop
authorRod Widdowson <rdw@steadingsoftware.com>
Mon, 18 Feb 2013 15:33:29 +0000 (10:33 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 22 Feb 2013 21:11:40 +0000 (13:11 -0800)
commit11aa3e09e591b325e80c5d4a420051923f121b82
tree2f082d8223bda0f0dd3259c40fae24a691aaa586
parent82161c478a871d959daf7f3ffb4d38d1bfabe6d6
Windows: Call CcDeferWrite rather than loop

If we are about to write into the cache and we do not have enough
memory we call CcDeferWrite and return STATUS_PENDING.  This allows
the cache to call us back when there is memory.

The write is performed on the IO queue which is shared wth paging
writes.  However this does not cause paging writes to block in a
memory shortage situation since the request will either be deferred
again (releasing a thread to service a paging write) or will complete
quickly.  Further we allocate all our resources upfront so we fail
fast and in the appropriate place.

Change-Id: I4efbc14a97d3b34236643973f1f8f85c7ea194a6
Reviewed-on: http://gerrit.openafs.org/9127
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp
src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp
src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h
src/WINNT/afsrdr/kernel/lib/Include/AFSDefines.h