Exemplo n.º 1
0
static
VOID
PvfsNotifyProcessEvent(
    PVOID pContext
    )
{
    NTSTATUS ntError = STATUS_SUCCESS;
    PPVFS_NOTIFY_REPORT_RECORD pReport = (PPVFS_NOTIFY_REPORT_RECORD)pContext;
    PPVFS_FCB pParentFcb = NULL;
    PPVFS_FCB pCursor = NULL;
    PPVFS_FCB pReportParentFcb = NULL;

    BAIL_ON_INVALID_PTR(pReport, ntError);

    /* Simply walk up the ancestory and process the notify filter
       record on top if there is a match */

    pCursor = PvfsReferenceFCB(pReport->pFcb);
    pReportParentFcb = PvfsGetParentFCB(pReport->pFcb);

    while ((pParentFcb = PvfsGetParentFCB(pCursor)) != NULL)
    {
        PvfsReleaseFCB(&pCursor);

        /* Process buffers before Irp so we don't doubly report
           a change on a pending Irp that has requested buffering a
           change log (which shouldn't start until the existing Irp
           has been completed). */

        PvfsNotifyFullReportBuffer(pParentFcb, pReportParentFcb, pReport);
        PvfsNotifyFullReportIrp(pParentFcb, pReportParentFcb, pReport);

        pCursor = pParentFcb;
    }


error:
    if (pCursor)
    {
        PvfsReleaseFCB(&pCursor);
    }

    if (pReportParentFcb)
    {
        PvfsReleaseFCB(&pReportParentFcb);
    }

    if (pReport)
    {
        PvfsNotifyFullReportCtxFree(&pReport);
    }

    return;
}
Exemplo n.º 2
0
NTSTATUS
PvfsCreateFileCheckPendingDelete(
    PPVFS_FCB pFcb
    )
{
    NTSTATUS ntError = STATUS_SUCCESS;
    PPVFS_FCB pParentFcb = NULL;

    if (PvfsFcbIsPendingDelete(pFcb))
    {
        ntError = STATUS_DELETE_PENDING;
        BAIL_ON_NT_STATUS(ntError);
    }

    pParentFcb = PvfsGetParentFCB(pFcb);
    if (pParentFcb && PvfsFcbIsPendingDelete(pParentFcb))
    {
        ntError = STATUS_DELETE_PENDING;
        BAIL_ON_NT_STATUS(ntError);
    }

    ntError = STATUS_SUCCESS;

cleanup:
    if (pParentFcb)
    {
        PvfsReleaseFCB(&pParentFcb);
    }


    return ntError;

error:
    goto cleanup;
}