Blame source/vdo/kernel/kvdoFlush.h

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