Blame source/vdo/kernel/kvdoFlush.h

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