mirror of
https://git.openafs.org/openafs.git
synced 2025-02-01 14:07:39 +00:00
Windows: consoldiate NextExtent() implementations
Both AFSExtentsSupport.cpp and AFSIoSupport.cpp provided NextExtent() implementations. The AFSExtentsSupport version was more general. Use that one for both modules. Change-Id: I19d17c989b4eadd40dcbb3d6d4186c316c26577e Reviewed-on: http://gerrit.openafs.org/7517 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com> Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
This commit is contained in:
parent
e94b233869
commit
c5f32b3159
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
#define AFS_MAX_FCBS_TO_DROP 10
|
#define AFS_MAX_FCBS_TO_DROP 10
|
||||||
|
|
||||||
static AFSExtent *NextExtent( AFSExtent *Extent, ULONG SkipList );
|
|
||||||
static ULONG ExtentsMasks[AFS_NUM_EXTENT_LISTS] = AFS_EXTENTS_MASKS;
|
static ULONG ExtentsMasks[AFS_NUM_EXTENT_LISTS] = AFS_EXTENTS_MASKS;
|
||||||
static VOID VerifyExtentsLists(AFSFcb *Fcb);
|
static VOID VerifyExtentsLists(AFSFcb *Fcb);
|
||||||
static AFSExtent *DirtyExtentFor(PLIST_ENTRY le);
|
static AFSExtent *DirtyExtentFor(PLIST_ENTRY le);
|
||||||
@ -3637,16 +3636,20 @@ AFSMarkDirty( IN AFSFcb *Fcb,
|
|||||||
AFSExtent *
|
AFSExtent *
|
||||||
ExtentFor(PLIST_ENTRY le, ULONG SkipList)
|
ExtentFor(PLIST_ENTRY le, ULONG SkipList)
|
||||||
{
|
{
|
||||||
|
|
||||||
return CONTAINING_RECORD( le, AFSExtent, Lists[SkipList] );
|
return CONTAINING_RECORD( le, AFSExtent, Lists[SkipList] );
|
||||||
}
|
}
|
||||||
|
|
||||||
static AFSExtent *NextExtent(AFSExtent *Extent, ULONG SkipList)
|
AFSExtent *
|
||||||
|
NextExtent(AFSExtent *Extent, ULONG SkipList)
|
||||||
{
|
{
|
||||||
|
|
||||||
return ExtentFor(Extent->Lists[SkipList].Flink, SkipList);
|
return ExtentFor(Extent->Lists[SkipList].Flink, SkipList);
|
||||||
}
|
}
|
||||||
|
|
||||||
static AFSExtent *DirtyExtentFor(PLIST_ENTRY le)
|
static AFSExtent *DirtyExtentFor(PLIST_ENTRY le)
|
||||||
{
|
{
|
||||||
|
|
||||||
return CONTAINING_RECORD( le, AFSExtent, DirtyList );
|
return CONTAINING_RECORD( le, AFSExtent, DirtyList );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,8 +38,6 @@
|
|||||||
|
|
||||||
#include "AFSCommon.h"
|
#include "AFSCommon.h"
|
||||||
|
|
||||||
static AFSExtent *NextExtent(AFSExtent *Extent);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Called in the paging or non cached read and write paths to get the
|
// Called in the paging or non cached read and write paths to get the
|
||||||
// first and last extent in a span. We also the count of how many
|
// first and last extent in a span. We also the count of how many
|
||||||
@ -73,7 +71,7 @@ AFSGetExtents( IN AFSFcb *Fcb,
|
|||||||
while ((Offset->QuadPart + Length) >
|
while ((Offset->QuadPart + Length) >
|
||||||
pEndExtent->FileOffset.QuadPart + pEndExtent->Size) {
|
pEndExtent->FileOffset.QuadPart + pEndExtent->Size) {
|
||||||
|
|
||||||
pEndExtent = NextExtent(pEndExtent);
|
pEndExtent = NextExtent(pEndExtent, AFS_EXTENTS_LIST);
|
||||||
|
|
||||||
if (liLastCacheOffset.QuadPart != pEndExtent->CacheOffset.QuadPart) {
|
if (liLastCacheOffset.QuadPart != pEndExtent->CacheOffset.QuadPart) {
|
||||||
//
|
//
|
||||||
@ -143,7 +141,7 @@ AFSSetupIoRun( IN PDEVICE_OBJECT CacheDevice,
|
|||||||
//
|
//
|
||||||
// Collapse the read if we can
|
// Collapse the read if we can
|
||||||
//
|
//
|
||||||
pNextExtent = NextExtent( pExtent );
|
pNextExtent = NextExtent( pExtent, AFS_EXTENTS_LIST);
|
||||||
|
|
||||||
if (pNextExtent->CacheOffset.QuadPart !=
|
if (pNextExtent->CacheOffset.QuadPart !=
|
||||||
(pExtent->CacheOffset.QuadPart + pExtent->Size))
|
(pExtent->CacheOffset.QuadPart + pExtent->Size))
|
||||||
@ -389,16 +387,6 @@ AFSCompleteIo( IN AFSGatherIo *Gather,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static AFSExtent *ExtentFor(PLIST_ENTRY le)
|
|
||||||
{
|
|
||||||
return CONTAINING_RECORD( le, AFSExtent, Lists[AFS_EXTENTS_LIST] );
|
|
||||||
}
|
|
||||||
|
|
||||||
static AFSExtent *NextExtent(AFSExtent *Extent)
|
|
||||||
{
|
|
||||||
return ExtentFor(Extent->Lists[AFS_EXTENTS_LIST].Flink);
|
|
||||||
}
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
AFSProcessExtentRun( IN PVOID SystemBuffer,
|
AFSProcessExtentRun( IN PVOID SystemBuffer,
|
||||||
IN PLARGE_INTEGER Start,
|
IN PLARGE_INTEGER Start,
|
||||||
@ -440,7 +428,7 @@ AFSProcessExtentRun( IN PVOID SystemBuffer,
|
|||||||
//
|
//
|
||||||
// Collapse the read if we can
|
// Collapse the read if we can
|
||||||
//
|
//
|
||||||
pNextExtent = NextExtent( pExtent );
|
pNextExtent = NextExtent( pExtent, AFS_EXTENTS_LIST);
|
||||||
|
|
||||||
if (pNextExtent->CacheOffset.QuadPart !=
|
if (pNextExtent->CacheOffset.QuadPart !=
|
||||||
(pExtent->CacheOffset.QuadPart + pExtent->Size))
|
(pExtent->CacheOffset.QuadPart + pExtent->Size))
|
||||||
|
@ -436,6 +436,9 @@ AFSRemoveEntryDirtyList( IN AFSFcb *Fcb,
|
|||||||
AFSExtent *
|
AFSExtent *
|
||||||
ExtentFor( PLIST_ENTRY le, ULONG SkipList );
|
ExtentFor( PLIST_ENTRY le, ULONG SkipList );
|
||||||
|
|
||||||
|
AFSExtent *
|
||||||
|
NextExtent( AFSExtent *Extent, ULONG SkipList );
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
AFSConstructCleanByteRangeList( AFSFcb * pFcb,
|
AFSConstructCleanByteRangeList( AFSFcb * pFcb,
|
||||||
AFSByteRange ** pByteRangeList);
|
AFSByteRange ** pByteRangeList);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user