ReactOS  0.4.15-dev-499-g1f31905
scavengr.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _RX_SCAVENGER_ENTRY
 
struct  _RDBSS_SCAVENGER
 
struct  _PURGE_SYNCHRONIZATION_CONTEXT
 

Macros

#define RX_SCAVENGER_FINALIZATION_TIME_INTERVAL   (10 * 1000 * 1000 * 10)
 
#define RxInitializeScavengerEntry(ScavengerEntry)
 
#define RxAcquireScavengerMutex()   KeWaitForSingleObject(&RxScavengerMutex, Executive, KernelMode, FALSE, NULL)
 
#define RxReleaseScavengerMutex()   KeReleaseMutex(&RxScavengerMutex, FALSE)
 
#define DONT_ATTEMPT_FINALIZE_ON_PURGE   FALSE
 
#define ATTEMPT_FINALIZE_ON_PURGE   TRUE
 
#define RxInitializeRdbssScavenger(Scavenger, ScavengerTimeLimit)
 

Typedefs

typedef struct _RX_SCAVENGER_ENTRY RX_SCAVENGER_ENTRY
 
typedef struct _RX_SCAVENGER_ENTRYPRX_SCAVENGER_ENTRY
 
typedef enum _RDBSS_SCAVENGER_STATE RDBSS_SCAVENGER_STATE
 
typedef enum _RDBSS_SCAVENGER_STATEPRDBSS_SCAVENGER_STATE
 
typedef struct _RDBSS_SCAVENGER RDBSS_SCAVENGER
 
typedef struct _RDBSS_SCAVENGERPRDBSS_SCAVENGER
 
typedef struct _PURGE_SYNCHRONIZATION_CONTEXT PURGE_SYNCHRONIZATION_CONTEXT
 
typedef struct _PURGE_SYNCHRONIZATION_CONTEXTPPURGE_SYNCHRONIZATION_CONTEXT
 

Enumerations

enum  _RDBSS_SCAVENGER_STATE { RDBSS_SCAVENGER_INACTIVE, RDBSS_SCAVENGER_DORMANT, RDBSS_SCAVENGER_ACTIVE, RDBSS_SCAVENGER_SUSPENDED }
 

Functions

VOID RxMarkFobxOnCleanup (_In_ PFOBX pFobx, _Out_ PBOOLEAN NeedPurge)
 
VOID RxMarkFobxOnClose (_In_ PFOBX Fobx)
 
NTSTATUS RxPurgeRelatedFobxs (PNET_ROOT NetRoot, PRX_CONTEXT RxContext, BOOLEAN AttemptFinalization, PFCB PurgingFcb)
 
VOID RxInitializePurgeSyncronizationContext (_In_ PPURGE_SYNCHRONIZATION_CONTEXT PurgeSyncronizationContext)
 
BOOLEAN RxScavengeRelatedFobxs (_In_ PFCB Fcb)
 
VOID RxScavengeFobxsForNetRoot (PNET_ROOT NetRoot, PFCB PurgingFcb, BOOLEAN SynchronizeWithScavenger)
 
VOID RxpMarkInstanceForScavengedFinalization (PVOID Instance)
 
VOID RxpUndoScavengerFinalizationMarking (_In_ PVOID Instance)
 
BOOLEAN RxScavengeVNetRoots (_In_ PRDBSS_DEVICE_OBJECT RxDeviceObject)
 
VOID RxSynchronizeWithScavenger (_In_ PRX_CONTEXT RxContext)
 

Variables

KMUTEX RxScavengerMutex
 

Macro Definition Documentation

◆ ATTEMPT_FINALIZE_ON_PURGE

#define ATTEMPT_FINALIZE_ON_PURGE   TRUE

Definition at line 46 of file scavengr.h.

◆ DONT_ATTEMPT_FINALIZE_ON_PURGE

#define DONT_ATTEMPT_FINALIZE_ON_PURGE   FALSE

Definition at line 45 of file scavengr.h.

◆ RX_SCAVENGER_FINALIZATION_TIME_INTERVAL

#define RX_SCAVENGER_FINALIZATION_TIME_INTERVAL   (10 * 1000 * 1000 * 10)

Definition at line 6 of file scavengr.h.

◆ RxAcquireScavengerMutex

#define RxAcquireScavengerMutex ( )    KeWaitForSingleObject(&RxScavengerMutex, Executive, KernelMode, FALSE, NULL)

Definition at line 26 of file scavengr.h.

◆ RxInitializeRdbssScavenger

#define RxInitializeRdbssScavenger (   Scavenger,
  ScavengerTimeLimit 
)
Value:
(Scavenger)->SrvCallsToBeFinalized = 0; \
(Scavenger)->NetRootsToBeFinalized = 0; \
(Scavenger)->VNetRootsToBeFinalized = 0; \
(Scavenger)->FcbsToBeFinalized = 0; \
(Scavenger)->SrvOpensToBeFinalized = 0; \
(Scavenger)->FobxsToBeFinalized = 0; \
(Scavenger)->NumberOfDormantFiles = 0; \
(Scavenger)->MaximumNumberOfDormantFiles = 50; \
(Scavenger)->CurrentFcbForClosePendingProcessing = NULL; \
(Scavenger)->CurrentNetRootForClosePendingProcessing = NULL; \
if ((ScavengerTimeLimit).QuadPart == 0) \
{ \
(Scavenger)->TimeLimit.QuadPart = RX_SCAVENGER_FINALIZATION_TIME_INTERVAL; \
} \
else \
{ \
(Scavenger)->TimeLimit.QuadPart = (ScavengerTimeLimit).QuadPart; \
} \
KeInitializeEvent(&((Scavenger)->SyncEvent), NotificationEvent, FALSE); \
KeInitializeEvent(&((Scavenger)->ScavengeEvent), SynchronizationEvent, TRUE); \
KeInitializeEvent(&((Scavenger)->ClosePendingProcessingSyncEvent), NotificationEvent, FALSE); \
InitializeListHead(&(Scavenger)->SrvCallFinalizationList); \
InitializeListHead(&(Scavenger)->NetRootFinalizationList); \
InitializeListHead(&(Scavenger)->VNetRootFinalizationList); \
InitializeListHead(&(Scavenger)->SrvOpenFinalizationList); \
InitializeListHead(&(Scavenger)->FcbFinalizationList); \
InitializeListHead(&(Scavenger)->FobxFinalizationList); \
InitializeListHead(&(Scavenger)->ClosePendingFobxsList)
#define TRUE
Definition: types.h:120
#define RX_SCAVENGER_FINALIZATION_TIME_INTERVAL
Definition: scavengr.h:6
smooth NULL
Definition: ftsmooth.c:416
ret QuadPart
Definition: rtlfuncs.h:3091

Definition at line 84 of file scavengr.h.

◆ RxInitializeScavengerEntry

#define RxInitializeScavengerEntry (   ScavengerEntry)
Value:
(ScavengerEntry)->State = 0; \
(ScavengerEntry)->Flags = 0; \
(ScavengerEntry)->Type = 0; \
(ScavengerEntry)->Operation = 0; \
InitializeListHead(&(ScavengerEntry)->List); \
(ScavengerEntry)->pContinuationEntry = NULL
Type
Definition: Type.h:6
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
smooth NULL
Definition: ftsmooth.c:416
LIST_ENTRY List
Definition: psmgr.c:57
_In_ FLT_SET_CONTEXT_OPERATION Operation
Definition: fltkernel.h:1468

Definition at line 18 of file scavengr.h.

◆ RxReleaseScavengerMutex

#define RxReleaseScavengerMutex ( )    KeReleaseMutex(&RxScavengerMutex, FALSE)

Definition at line 27 of file scavengr.h.

Typedef Documentation

◆ PPURGE_SYNCHRONIZATION_CONTEXT

◆ PRDBSS_SCAVENGER

◆ PRDBSS_SCAVENGER_STATE

◆ PRX_SCAVENGER_ENTRY

◆ PURGE_SYNCHRONIZATION_CONTEXT

◆ RDBSS_SCAVENGER

◆ RDBSS_SCAVENGER_STATE

◆ RX_SCAVENGER_ENTRY

Enumeration Type Documentation

◆ _RDBSS_SCAVENGER_STATE

Enumerator
RDBSS_SCAVENGER_INACTIVE 
RDBSS_SCAVENGER_DORMANT 
RDBSS_SCAVENGER_ACTIVE 
RDBSS_SCAVENGER_SUSPENDED 

Definition at line 48 of file scavengr.h.

Function Documentation

◆ RxInitializePurgeSyncronizationContext()

VOID RxInitializePurgeSyncronizationContext ( _In_ PPURGE_SYNCHRONIZATION_CONTEXT  PurgeSyncronizationContext)

◆ RxMarkFobxOnCleanup()

VOID RxMarkFobxOnCleanup ( _In_ PFOBX  pFobx,
_Out_ PBOOLEAN  NeedPurge 
)

Referenced by RxCommonCleanup().

◆ RxMarkFobxOnClose()

VOID RxMarkFobxOnClose ( _In_ PFOBX  Fobx)

◆ RxpMarkInstanceForScavengedFinalization()

VOID RxpMarkInstanceForScavengedFinalization ( PVOID  Instance)

Definition at line 6277 of file rxce.c.

6279 {
6282  PRDBSS_SCAVENGER Scavenger;
6284  PLIST_ENTRY ScavengerHead, InstEntry;
6285 
6286  PAGED_CODE();
6287 
6288  /* If still referenced, don't mark it (broken caller) */
6290  if (Node->NodeReferenceCount > 1)
6291  {
6292  return;
6293  }
6294 
6296  Scavenger = DeviceObject->pRdbssScavenger;
6297 
6298  /* Mark the node */
6301  DPRINT("Node %p has now the scavenger mark!\n", Instance);
6302 
6303  /* Increase the count in the scavenger, and queue it */
6304  ScavengerHead = NULL;
6305  switch (NodeType)
6306  {
6307  case RDBSS_NTC_FOBX:
6308  ++Scavenger->FobxsToBeFinalized;
6309  ScavengerHead = &Scavenger->FobxFinalizationList;
6310  InstEntry = &((PFOBX)Instance)->ScavengerFinalizationList;
6311  break;
6312 
6313  case RDBSS_NTC_SRVCALL:
6314  ++Scavenger->SrvCallsToBeFinalized;
6315  ScavengerHead = &Scavenger->SrvCallFinalizationList;
6316  InstEntry = &((PSRV_CALL)Instance)->ScavengerFinalizationList;
6317  break;
6318 
6319  case RDBSS_NTC_NETROOT:
6320  ++Scavenger->NetRootsToBeFinalized;
6321  ScavengerHead = &Scavenger->NetRootFinalizationList;
6322  InstEntry = &((PNET_ROOT)Instance)->ScavengerFinalizationList;
6323  break;
6324 
6325  case RDBSS_NTC_V_NETROOT:
6326  ++Scavenger->VNetRootsToBeFinalized;
6327  ScavengerHead = &Scavenger->VNetRootFinalizationList;
6328  InstEntry = &((PV_NET_ROOT)Instance)->ScavengerFinalizationList;
6329  break;
6330 
6331  case RDBSS_NTC_SRVOPEN:
6332  ++Scavenger->SrvOpensToBeFinalized;
6333  ScavengerHead = &Scavenger->SrvOpenFinalizationList;
6334  InstEntry = &((PSRV_OPEN)Instance)->ScavengerFinalizationList;
6335  break;
6336  }
6337 
6338  /* Extra ref for scavenger */
6339  InterlockedIncrement((volatile long *)&Node->NodeReferenceCount);
6340 
6341  /* If matching type */
6342  if (ScavengerHead != NULL)
6343  {
6344  /* Insert in the scavenger list */
6345  InsertTailList(ScavengerHead, InstEntry);
6346 
6347  /* And if it wasn't started, start it */
6348  if (Scavenger->State == RDBSS_SCAVENGER_INACTIVE)
6349  {
6350  Scavenger->State = RDBSS_SCAVENGER_DORMANT;
6353  }
6354  }
6355 }
LIST_ENTRY SrvCallFinalizationList
Definition: scavengr.h:68
struct _SRV_CALL * PSRV_CALL
VOID NTAPI RxScavengerTimerRoutine(PVOID Context)
Definition: rxce.c:7964
#define RDBSS_NTC_SRVOPEN
Definition: nodetype.h:52
ULONG VNetRootsToBeFinalized
Definition: scavengr.h:64
#define InsertTailList(ListHead, Entry)
struct _FOBX * PFOBX
LIST_ENTRY VNetRootFinalizationList
Definition: scavengr.h:70
PRDBSS_DEVICE_OBJECT RxFileSystemDeviceObject
Definition: rdbss.c:573
union node Node
Definition: types.h:1255
ULONG FobxsToBeFinalized
Definition: scavengr.h:67
smooth NULL
Definition: ftsmooth.c:416
ULONG SrvCallsToBeFinalized
Definition: scavengr.h:62
void DPRINT(...)
Definition: polytest.cpp:61
NTSTATUS NTAPI RxPostOneShotTimerRequest(IN PRDBSS_DEVICE_OBJECT pDeviceObject, IN PRX_WORK_ITEM pWorkItem, IN PRX_WORKERTHREAD_ROUTINE Routine, IN PVOID pContext, IN LARGE_INTEGER TimeInterval)
Definition: rxce.c:6362
NodeType
Definition: Node.h:5
RDBSS_SCAVENGER_STATE State
Definition: scavengr.h:58
struct _V_NET_ROOT * PV_NET_ROOT
RX_WORK_ITEM WorkItem
Definition: scavengr.h:75
struct _NODE_TYPE_CODE_AND_SIZE * PNODE_TYPE_AND_SIZE
#define RDBSS_NTC_V_NETROOT
Definition: nodetype.h:50
ULONG SrvOpensToBeFinalized
Definition: scavengr.h:66
Definition: typedefs.h:118
struct _NET_ROOT * PNET_ROOT
#define RDBSS_NTC_SRVCALL
Definition: nodetype.h:48
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
#define RDBSS_NTC_FOBX
Definition: nodetype.h:57
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define InterlockedIncrement
Definition: armddk.h:53
#define RDBSS_NTC_NETROOT
Definition: nodetype.h:49
LIST_ENTRY FobxFinalizationList
Definition: scavengr.h:73
IN PVOID Instance
Definition: pci.h:361
struct _SRV_OPEN * PSRV_OPEN
#define RX_SCAVENGER_MASK
Definition: nodetype.h:70
USHORT NODE_TYPE_CODE
Definition: nodetype.h:22
LIST_ENTRY NetRootFinalizationList
Definition: scavengr.h:69
PRDBSS_DEVICE_OBJECT RxGetDeviceObjectOfInstance(PVOID Instance)
Definition: rxce.c:4409
ULONG NetRootsToBeFinalized
Definition: scavengr.h:63
LARGE_INTEGER TimeLimit
Definition: scavengr.h:61
LIST_ENTRY SrvOpenFinalizationList
Definition: scavengr.h:72
Definition: dlist.c:348
#define PAGED_CODE()

Referenced by RxDereference().

◆ RxpUndoScavengerFinalizationMarking()

VOID RxpUndoScavengerFinalizationMarking ( _In_ PVOID  Instance)

◆ RxPurgeRelatedFobxs()

NTSTATUS RxPurgeRelatedFobxs ( PNET_ROOT  NetRoot,
PRX_CONTEXT  RxContext,
BOOLEAN  AttemptFinalization,
PFCB  PurgingFcb 
)

Definition at line 7133 of file rxce.c.

7138 {
7140  ULONG SuccessfullPurge;
7141  PRDBSS_SCAVENGER Scavenger;
7142  PRDBSS_DEVICE_OBJECT RxDeviceObject;
7143  PPURGE_SYNCHRONIZATION_CONTEXT PurgeSyncCtx;
7144 
7145  PAGED_CODE();
7146 
7147  RxDeviceObject = RxContext->RxDeviceObject;
7148  Scavenger = RxDeviceObject->pRdbssScavenger;
7149  PurgeSyncCtx = &NetRoot->PurgeSyncronizationContext;
7150 
7152 
7153  /* If there's already a purge in progress */
7154  if (PurgeSyncCtx->PurgeInProgress)
7155  {
7156  /* Add our RX_CONTEXT to the current run */
7158  &RxContext->RxContextSerializationQLinks);
7159 
7160  /* And wait until it's done */
7162  RxWaitSync(RxContext);
7164  }
7165 
7166  /* Start the purge */
7167  PurgeSyncCtx->PurgeInProgress = TRUE;
7168 
7169  /* While the purge is still handling our NET_ROOT, do nothing but wait */
7170  while (Scavenger->CurrentNetRootForClosePendingProcessing == NetRoot)
7171  {
7174  KernelMode, TRUE, NULL);
7176  }
7177 
7178  /* Now, for all the entries */
7179  SuccessfullPurge = 0;
7180  Entry = Scavenger->ClosePendingFobxsList.Flink;
7181  while (Entry != &Scavenger->ClosePendingFobxsList)
7182  {
7183  PFCB Fcb;
7184  PFOBX Fobx;
7185  BOOLEAN Success;
7186 
7187  Fobx = CONTAINING_RECORD(Entry, FOBX, ClosePendingList);
7188  DPRINT("Dealing with FOBX: %p\n", Fobx);
7189 
7190  Entry = Entry->Flink;
7191 
7192  /* If it's not matching our NET_ROOT, ignore */
7193  if (Fobx->pSrvOpen == NULL ||
7194  Fobx->pSrvOpen->pFcb == NULL ||
7195  ((PFCB)Fobx->pSrvOpen->pFcb)->VNetRoot == NULL ||
7196  (PNET_ROOT)((PFCB)Fobx->pSrvOpen->pFcb)->VNetRoot->pNetRoot != NetRoot)
7197  {
7198  continue;
7199  }
7200 
7201  /* Determine if it matches our FCB */
7202  Fcb = (PFCB)Fobx->pSrvOpen->pFcb;
7203  if (PurgingFcb != NULL && NodeType(PurgingFcb) != RDBSS_NTC_STORAGE_TYPE_DIRECTORY &&
7204  PurgingFcb != Fcb)
7205  {
7206  NTSTATUS Status;
7207 
7208  MINIRDR_CALL_THROUGH(Status, RxDeviceObject->Dispatch, MRxAreFilesAliased, (Fcb, PurgingFcb));
7209  if (Status == STATUS_SUCCESS)
7210  {
7211  continue;
7212  }
7213  }
7214 
7215  /* Matching, we'll purge it */
7217 
7218  /* Reference it so that it doesn't disappear */
7219  RxReferenceNetFobx(Fobx);
7220 
7222 
7223  /* And purge */
7224  Success = RxPurgeFobx(Fobx);
7225  if (Success)
7226  {
7227  ++SuccessfullPurge;
7228  }
7229 
7230  /* If we don't have to finalize it (or if we cannot acquire lock exclusively
7231  * Just normally dereference
7232  */
7233  if ((AttemptFinalization == DONT_ATTEMPT_FINALIZE_ON_PURGE) ||
7235  {
7237  }
7238  /* Otherwise, finalize */
7239  else
7240  {
7244  {
7245  RxReleaseFcb(NULL, Fcb);
7246  }
7247  }
7248 
7249  if (!Success)
7250  {
7251  DPRINT1("Failed purging %p (%p)\n", Fcb, Fobx);
7252  }
7253 
7255  }
7256 
7257  /* If no contexts left, purge is not running */
7258  if (IsListEmpty(&PurgeSyncCtx->ContextsAwaitingPurgeCompletion))
7259  {
7260  PurgeSyncCtx->PurgeInProgress = FALSE;
7261  }
7262  /* Otherwise, notify a waiter it can start */
7263  else
7264  {
7266 
7268  Context = CONTAINING_RECORD(Entry, RX_CONTEXT, RxContextSerializationQLinks);
7269 
7271  }
7272 
7274 
7275  return (SuccessfullPurge > 0 ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL);
7276 }
LIST_ENTRY ContextsAwaitingPurgeCompletion
Definition: scavengr.h:117
#define RxReferenceNetFcb(Fcb)
Definition: fcb.h:431
#define RxAcquireExclusiveFcb(R, F)
Definition: rxprocs.h:154
#define TRUE
Definition: types.h:120
LIST_ENTRY RxContextSerializationQLinks
Definition: rxcontx.h:154
PMINIRDR_DISPATCH Dispatch
Definition: rxstruc.h:89
struct _Entry Entry
Definition: kefuncs.h:627
Definition: cdstruc.h:908
PURGE_SYNCHRONIZATION_CONTEXT PurgeSyncronizationContext
Definition: fcb.h:48
BOOLEAN RxPurgeFobx(PFOBX pFobx)
Definition: rxce.c:7051
LONG NTSTATUS
Definition: precomp.h:26
#define RxSignalSynchronousWaiter(RxContext)
Definition: rxcontx.h:417
Definition: fcb.h:33
PNET_ROOT CurrentNetRootForClosePendingProcessing
Definition: scavengr.h:79
Definition: fcb.h:304
#define InsertTailList(ListHead, Entry)
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
#define RxDereferenceNetFobx(Fobx, LockHoldingState)
Definition: fcb.h:419
KEVENT ClosePendingProcessingSyncEvent
Definition: scavengr.h:81
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
#define RxReleaseFcb(R, F)
Definition: rxprocs.h:186
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
void DPRINT(...)
Definition: polytest.cpp:61
NodeType
Definition: Node.h:5
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define RxReferenceNetFobx(Fobx)
Definition: fcb.h:415
struct _LIST_ENTRY * Flink
Definition: typedefs.h:120
if(!(yy_init))
Definition: macro.lex.yy.c:714
FCB * PFCB
Definition: cdstruc.h:1046
#define RxWaitSync(RxContext)
Definition: rxcontx.h:412
LIST_ENTRY ClosePendingFobxsList
Definition: scavengr.h:74
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
LIST_ENTRY ClosePendingList
Definition: fcb.h:318
#define RxAcquireScavengerMutex()
Definition: scavengr.h:26
#define RDBSS_NTC_STORAGE_TYPE_DIRECTORY
Definition: nodetype.h:42
#define RxDereferenceAndFinalizeNetFcb(Fcb, RxContext, RecursiveFinalize, ForceFinalize)
Definition: fcb.h:439
Definition: typedefs.h:118
PRDBSS_SCAVENGER pRdbssScavenger
Definition: rxstruc.h:129
PRDBSS_DEVICE_OBJECT RxDeviceObject
Definition: rxcontx.h:116
Status
Definition: gdiplustypes.h:24
#define RxReleaseScavengerMutex()
Definition: scavengr.h:27
#define DPRINT1
Definition: precomp.h:8
#define DONT_ATTEMPT_FINALIZE_ON_PURGE
Definition: scavengr.h:45
struct tagContext Context
Definition: acpixf.h:1034
unsigned int ULONG
Definition: retypes.h:1
#define MINIRDR_CALL_THROUGH(STATUS, DISPATCH, FUNC, ARGLIST)
Definition: rxcontx.h:375
_In_ PFCB Fcb
Definition: cdprocs.h:159
return STATUS_SUCCESS
Definition: btrfs.c:3014
base of all file and directory entries
Definition: entries.h:82
#define PAGED_CODE()

Referenced by RxCommonCreate(), RxCommonSetInformation(), and RxCreateFromNetRoot().

◆ RxScavengeFobxsForNetRoot()

VOID RxScavengeFobxsForNetRoot ( PNET_ROOT  NetRoot,
PFCB  PurgingFcb,
BOOLEAN  SynchronizeWithScavenger 
)

Definition at line 7798 of file rxce.c.

7802 {
7803  PRDBSS_SCAVENGER Scavenger;
7804  PRDBSS_DEVICE_OBJECT RxDeviceObject;
7805 
7806  PAGED_CODE();
7807 
7808  RxDeviceObject = NetRoot->pSrvCall->RxDeviceObject;
7809  Scavenger = RxDeviceObject->pRdbssScavenger;
7810 
7811  /* Wait for the scavenger, if asked to */
7812  if (SynchronizeWithScavenger)
7813  {
7815  }
7816 
7818 
7819  /* If there's nothing left to do... */
7820  if (Scavenger->FobxsToBeFinalized <= 0)
7821  {
7823  }
7824  else
7825  {
7827  LIST_ENTRY FobxToScavenge;
7828 
7829  InitializeListHead(&FobxToScavenge);
7830 
7831  /* Browse all the FOBXs to finalize */
7832  Entry = Scavenger->FobxFinalizationList.Flink;
7833  while (Entry != &Scavenger->FobxFinalizationList)
7834  {
7835  PFOBX Fobx;
7836 
7837  Fobx = CONTAINING_RECORD(Entry, FOBX, ScavengerFinalizationList);
7838  Entry = Entry->Flink;
7839 
7840  if (Fobx->SrvOpen != NULL)
7841  {
7842  PFCB Fcb;
7843 
7844  Fcb = (PFCB)Fobx->SrvOpen->pFcb;
7845 
7846  /* If it matches our NET_ROOT */
7847  if ((PNET_ROOT)Fcb->pNetRoot == NetRoot)
7848  {
7849  NTSTATUS Status;
7850 
7851  /* Check whether it matches our FCB */
7853  if (PurgingFcb != NULL && PurgingFcb != Fcb)
7854  {
7855  MINIRDR_CALL_THROUGH(Status, RxDeviceObject->Dispatch, MRxAreFilesAliased, (Fcb, PurgingFcb));
7856  }
7857 
7858  /* If so, add it to the list of the FOBXs to scavenge */
7859  if (Status != STATUS_SUCCESS)
7860  {
7861  RxReferenceNetFobx(Fobx);
7862  ASSERT(NodeType(Fobx) == RDBSS_NTC_FOBX);
7863 
7865  InsertTailList(&FobxToScavenge, &Fobx->ScavengerFinalizationList);
7866  }
7867  }
7868  }
7869  }
7870 
7872 
7873  /* Now, scavenge all the extracted FOBX */
7874  RxpScavengeFobxs(Scavenger, &FobxToScavenge);
7875  }
7876 
7877  if (SynchronizeWithScavenger)
7878  {
7880  }
7881 }
PMINIRDR_DISPATCH Dispatch
Definition: rxstruc.h:89
struct _Entry Entry
Definition: kefuncs.h:627
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
Definition: cdstruc.h:908
VOID RxpScavengeFobxs(PRDBSS_SCAVENGER Scavenger, PLIST_ENTRY FobxToScavenge)
Definition: rxce.c:6695
LONG NTSTATUS
Definition: precomp.h:26
LIST_ENTRY ScavengerFinalizationList
Definition: fcb.h:317
Definition: fcb.h:33
PSRV_OPEN SrvOpen
Definition: fcb.h:312
Definition: fcb.h:304
#define InsertTailList(ListHead, Entry)
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
ULONG FobxsToBeFinalized
Definition: scavengr.h:67
smooth NULL
Definition: ftsmooth.c:416
NodeType
Definition: Node.h:5
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define RxReferenceNetFobx(Fobx)
Definition: fcb.h:415
struct _LIST_ENTRY * Flink
Definition: typedefs.h:120
if(!(yy_init))
Definition: macro.lex.yy.c:714
FCB * PFCB
Definition: cdstruc.h:1046
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define RxAcquireScavengerMutex()
Definition: scavengr.h:26
Definition: typedefs.h:118
PRDBSS_SCAVENGER pRdbssScavenger
Definition: rxstruc.h:129
Status
Definition: gdiplustypes.h:24
#define RDBSS_NTC_FOBX
Definition: nodetype.h:57
#define RxReleaseScavengerMutex()
Definition: scavengr.h:27
LIST_ENTRY FobxFinalizationList
Definition: scavengr.h:73
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define IO_NO_INCREMENT
Definition: iotypes.h:568
#define MINIRDR_CALL_THROUGH(STATUS, DISPATCH, FUNC, ARGLIST)
Definition: rxcontx.h:375
_In_ PFCB Fcb
Definition: cdprocs.h:159
return STATUS_SUCCESS
Definition: btrfs.c:3014
base of all file and directory entries
Definition: entries.h:82
KEVENT ScavengeEvent
Definition: scavengr.h:77
#define PAGED_CODE()

Referenced by RxCommonCreate(), and RxCommonSetInformation().

◆ RxScavengeRelatedFobxs()

BOOLEAN RxScavengeRelatedFobxs ( _In_ PFCB  Fcb)

◆ RxScavengeVNetRoots()

BOOLEAN RxScavengeVNetRoots ( _In_ PRDBSS_DEVICE_OBJECT  RxDeviceObject)

Referenced by RxCreateTreeConnect().

◆ RxSynchronizeWithScavenger()

VOID RxSynchronizeWithScavenger ( _In_ PRX_CONTEXT  RxContext)

Referenced by RxCommonClose().

Variable Documentation

◆ RxScavengerMutex

KMUTEX RxScavengerMutex

Definition at line 608 of file rdbss.c.

Referenced by RxDriverEntry().