|
Packit Service |
b3514a |
/*
|
|
Packit Service |
b3514a |
* Copyright (c) 2020 Red Hat, Inc.
|
|
Packit Service |
b3514a |
*
|
|
Packit Service |
b3514a |
* This program is free software; you can redistribute it and/or
|
|
Packit Service |
b3514a |
* modify it under the terms of the GNU General Public License
|
|
Packit Service |
b3514a |
* as published by the Free Software Foundation; either version 2
|
|
Packit Service |
b3514a |
* of the License, or (at your option) any later version.
|
|
Packit Service |
b3514a |
*
|
|
Packit Service |
b3514a |
* This program is distributed in the hope that it will be useful,
|
|
Packit Service |
b3514a |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
b3514a |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
b3514a |
* GNU General Public License for more details.
|
|
Packit Service |
b3514a |
*
|
|
Packit Service |
b3514a |
* You should have received a copy of the GNU General Public License
|
|
Packit Service |
b3514a |
* along with this program; if not, write to the Free Software
|
|
Packit Service |
b3514a |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
Packit Service |
b3514a |
* 02110-1301, USA.
|
|
Packit Service |
b3514a |
*
|
|
Packit Service |
b3514a |
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/kernel/kvdoFlush.h#1 $
|
|
Packit Service |
b3514a |
*/
|
|
Packit Service |
b3514a |
|
|
Packit Service |
b3514a |
#ifndef KVDO_FLUSH_H
|
|
Packit Service |
b3514a |
#define KVDO_FLUSH_H
|
|
Packit Service |
b3514a |
|
|
Packit Service |
b3514a |
#include "flush.h"
|
|
Packit Service |
b3514a |
|
|
Packit Service |
b3514a |
#include "kernelLayer.h"
|
|
Packit Service |
b3514a |
|
|
Packit Service |
b3514a |
/**
|
|
Packit Service |
b3514a |
* Create a KVDOFlush.
|
|
Packit Service |
b3514a |
*
|
|
Packit Service |
b3514a |
* @param flushPtr A pointer to hold the new flush
|
|
Packit Service |
b3514a |
**/
|
|
Packit Service |
b3514a |
int makeKVDOFlush(KVDOFlush **flushPtr);
|
|
Packit Service |
b3514a |
|
|
Packit Service |
b3514a |
/**
|
|
Packit Service |
b3514a |
* Answer the question as to whether VDO should be processing REQ_FLUSH
|
|
Packit Service |
b3514a |
* requests or not.
|
|
Packit Service |
b3514a |
*
|
|
Packit Service |
b3514a |
* @param layer The layer
|
|
Packit Service |
b3514a |
*
|
|
Packit Service |
b3514a |
* @return true if VDO should process empty flush requests, or false if
|
|
Packit Service |
b3514a |
* they should just be forwarded to our storage device.
|
|
Packit Service |
b3514a |
**/
|
|
Packit Service |
b3514a |
bool shouldProcessFlush(KernelLayer *layer);
|
|
Packit Service |
b3514a |
|
|
Packit Service |
b3514a |
/**
|
|
Packit Service |
b3514a |
* Function called to start processing a flush request. It is called when we
|
|
Packit Service |
b3514a |
* receive an empty flush bio from the block layer, and before acknowledging a
|
|
Packit Service |
b3514a |
* non-empty bio with the FUA flag set.
|
|
Packit Service |
b3514a |
*
|
|
Packit Service |
b3514a |
* @param layer The physical layer
|
|
Packit Service |
b3514a |
* @param bio The bio containing an empty flush request
|
|
Packit Service |
b3514a |
**/
|
|
Packit Service |
b3514a |
void launchKVDOFlush(KernelLayer *layer, BIO *bio);
|
|
Packit Service |
b3514a |
|
|
Packit Service |
b3514a |
/**
|
|
Packit Service |
b3514a |
* Function called from base VDO to complete and free a flush request.
|
|
Packit Service |
b3514a |
*
|
|
Packit Service |
b3514a |
* @param kfp Pointer to the flush request
|
|
Packit Service |
b3514a |
**/
|
|
Packit Service |
b3514a |
void kvdoCompleteFlush(VDOFlush **kfp);
|
|
Packit Service |
b3514a |
|
|
Packit Service |
b3514a |
/**
|
|
Packit Service |
b3514a |
* Issue a flush request and wait for it to complete.
|
|
Packit Service |
b3514a |
*
|
|
Packit Service |
b3514a |
* @param layer The kernel layer
|
|
Packit Service |
b3514a |
*
|
|
Packit Service |
b3514a |
* @return VDO_SUCCESS or an error
|
|
Packit Service |
b3514a |
*/
|
|
Packit Service |
b3514a |
int synchronousFlush(KernelLayer *layer);
|
|
Packit Service |
b3514a |
|
|
Packit Service |
b3514a |
#endif /* KVDO_FLUSH_H */
|