Blame source/vdo/base/vdoResize.h

Packit Service 7e342f
/*
Packit Service 7e342f
 * Copyright (c) 2020 Red Hat, Inc.
Packit Service 7e342f
 *
Packit Service 7e342f
 * This program is free software; you can redistribute it and/or
Packit Service 7e342f
 * modify it under the terms of the GNU General Public License
Packit Service 7e342f
 * as published by the Free Software Foundation; either version 2
Packit Service 7e342f
 * of the License, or (at your option) any later version.
Packit Service 7e342f
 * 
Packit Service 7e342f
 * This program is distributed in the hope that it will be useful,
Packit Service 7e342f
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 7e342f
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 7e342f
 * GNU General Public License for more details.
Packit Service 7e342f
 * 
Packit Service 7e342f
 * You should have received a copy of the GNU General Public License
Packit Service 7e342f
 * along with this program; if not, write to the Free Software
Packit Service 7e342f
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
Packit Service 7e342f
 * 02110-1301, USA. 
Packit Service 7e342f
 *
Packit Service 7e342f
 * $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/vdoResize.h#1 $
Packit Service 7e342f
 */
Packit Service 7e342f
Packit Service 7e342f
#ifndef VDO_RESIZE_H
Packit Service 7e342f
#define VDO_RESIZE_H
Packit Service 7e342f
Packit Service 7e342f
#include "types.h"
Packit Service 7e342f
Packit Service 7e342f
/**
Packit Service 7e342f
 * Make the completion for an asynchronous resize.
Packit Service 7e342f
 *
Packit Service 7e342f
 * @param vdo                The VDO
Packit Service 7e342f
 * @param newPhysicalBlocks  The new physical size in blocks
Packit Service 7e342f
 * @param completionPtr      A pointer to hold the completion
Packit Service 7e342f
 *
Packit Service 7e342f
 * @return VDO_SUCCESS or an error
Packit Service 7e342f
 **/
Packit Service 7e342f
int makeResizeVDOCompletion(VDO            *vdo,
Packit Service 7e342f
                            BlockCount      newPhysicalBlocks,
Packit Service 7e342f
                            VDOCompletion **completionPtr)
Packit Service 7e342f
  __attribute__((warn_unused_result));
Packit Service 7e342f
Packit Service 7e342f
/**
Packit Service 7e342f
 * Free the completion for an asynchronous resize, and NULL out the
Packit Service 7e342f
 * reference to it.
Packit Service 7e342f
 *
Packit Service 7e342f
 * @param completionPtr  A reference to the completion to free
Packit Service 7e342f
 **/
Packit Service 7e342f
void freeResizeVDOCompletion(VDOCompletion **completionPtr);
Packit Service 7e342f
Packit Service 7e342f
/**
Packit Service 7e342f
 * Grow the physical size of the VDO. This method may only be called when the
Packit Service 7e342f
 * VDO has been suspended and must not be called from a base thread.
Packit Service 7e342f
 *
Packit Service 7e342f
 * @param vdo                The VDO to resize
Packit Service 7e342f
 * @param newPhysicalBlocks  The new physical size in blocks
Packit Service 7e342f
 *
Packit Service 7e342f
 * @return VDO_SUCCESS or an error
Packit Service 7e342f
 **/
Packit Service 7e342f
int performGrowPhysical(VDO *vdo, BlockCount newPhysicalBlocks);
Packit Service 7e342f
Packit Service 7e342f
/**
Packit Service 7e342f
 * Prepare to resize the VDO, allocating memory as needed.
Packit Service 7e342f
 *
Packit Service 7e342f
 * @param vdo                The VDO
Packit Service 7e342f
 * @param newPhysicalBlocks  The new physical size in blocks
Packit Service 7e342f
 **/
Packit Service 7e342f
int prepareToGrowPhysical(VDO *vdo, BlockCount newPhysicalBlocks)
Packit Service 7e342f
  __attribute__((warn_unused_result));
Packit Service 7e342f
Packit Service 7e342f
#endif /* VDO_RESIZE_H */