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