Blame source/vdo/base/vdoResize.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/base/vdoResize.h#1 $
Packit Service 75d76b
 */
Packit Service 75d76b
Packit Service 75d76b
#ifndef VDO_RESIZE_H
Packit Service 75d76b
#define VDO_RESIZE_H
Packit Service 75d76b
Packit Service 75d76b
#include "types.h"
Packit Service 75d76b
Packit Service 75d76b
/**
Packit Service 75d76b
 * Make the completion for an asynchronous resize.
Packit Service 75d76b
 *
Packit Service 75d76b
 * @param vdo                The VDO
Packit Service 75d76b
 * @param newPhysicalBlocks  The new physical size in blocks
Packit Service 75d76b
 * @param completionPtr      A pointer to hold the completion
Packit Service 75d76b
 *
Packit Service 75d76b
 * @return VDO_SUCCESS or an error
Packit Service 75d76b
 **/
Packit Service 75d76b
int makeResizeVDOCompletion(VDO            *vdo,
Packit Service 75d76b
                            BlockCount      newPhysicalBlocks,
Packit Service 75d76b
                            VDOCompletion **completionPtr)
Packit Service 75d76b
  __attribute__((warn_unused_result));
Packit Service 75d76b
Packit Service 75d76b
/**
Packit Service 75d76b
 * Free the completion for an asynchronous resize, and NULL out the
Packit Service 75d76b
 * reference to it.
Packit Service 75d76b
 *
Packit Service 75d76b
 * @param completionPtr  A reference to the completion to free
Packit Service 75d76b
 **/
Packit Service 75d76b
void freeResizeVDOCompletion(VDOCompletion **completionPtr);
Packit Service 75d76b
Packit Service 75d76b
/**
Packit Service 75d76b
 * Grow the physical size of the VDO. This method may only be called when the
Packit Service 75d76b
 * VDO has been suspended and must not be called from a base thread.
Packit Service 75d76b
 *
Packit Service 75d76b
 * @param vdo                The VDO to resize
Packit Service 75d76b
 * @param newPhysicalBlocks  The new physical size in blocks
Packit Service 75d76b
 *
Packit Service 75d76b
 * @return VDO_SUCCESS or an error
Packit Service 75d76b
 **/
Packit Service 75d76b
int performGrowPhysical(VDO *vdo, BlockCount newPhysicalBlocks);
Packit Service 75d76b
Packit Service 75d76b
/**
Packit Service 75d76b
 * Prepare to resize the VDO, allocating memory as needed.
Packit Service 75d76b
 *
Packit Service 75d76b
 * @param vdo                The VDO
Packit Service 75d76b
 * @param newPhysicalBlocks  The new physical size in blocks
Packit Service 75d76b
 **/
Packit Service 75d76b
int prepareToGrowPhysical(VDO *vdo, BlockCount newPhysicalBlocks)
Packit Service 75d76b
  __attribute__((warn_unused_result));
Packit Service 75d76b
Packit Service 75d76b
#endif /* VDO_RESIZE_H */