/usr/include/libstoragemgmt/libstoragemgmt_blockrange.h is in libstoragemgmt-dev 1.2.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | /*
* Copyright (C) 2011-2014 Red Hat, Inc.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; If not, see <http://www.gnu.org/licenses/>.
*
* Author: tasleson
*/
#ifndef LSM_BLOCKRANGE_H
#define LSM_BLOCKRANGE_H
#include "libstoragemgmt_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Creates memory for opaque data type to store a block range
* @param source_start Source block number to replicate from
* @param dest_start Dest block number to replicate to
* @param block_count Number of blocks to replicate
* @return Valid block range ptr, otherwise NULL
*/
lsm_block_range LSM_DLL_EXPORT *
lsm_block_range_record_alloc(uint64_t source_start, uint64_t dest_start,
uint64_t block_count);
/**
* Frees a block range record.
* @param br Block range to free
* @return LSM_ERR_OK on success, else error reason.
*/
int LSM_DLL_EXPORT lsm_block_range_record_free(lsm_block_range * br);
/**
* Copies a block range.
* @param source Source of the copy
* @return copy of source
*/
lsm_block_range LSM_DLL_EXPORT *
lsm_block_range_record_copy(lsm_block_range * source);
/**
* Allocates storage for an array of block ranges.
* @param size Number of elements to store.
* @return Pointer to memory for array of block ranges.
*/
lsm_block_range LSM_DLL_EXPORT **
lsm_block_range_record_array_alloc(uint32_t size);
/**
* Frees the memory for the array and all records contained in it.
* @param br Array of block ranges to free
* @param size Number of elements in array.
* @return LSM_ERR_OK on success, else error reason.
*/
int LSM_DLL_EXPORT lsm_block_range_record_array_free(lsm_block_range *br[],
uint32_t size);
/**
* Retrieves the source block address.
* @param br Valid block range pointer
* @return value of source start.
*/
uint64_t LSM_DLL_EXPORT
lsm_block_range_source_start_get(lsm_block_range *br);
/**
* Retrieves the dest block address.
* @param br Valid block range pointer
* @return value of dest start.
*/
uint64_t LSM_DLL_EXPORT lsm_block_range_dest_start_get(lsm_block_range *br);
/**
* Retrieves the number of blocks to replicate.
* @param br Valid block range pointer
* @return value of number of blocks
*/
uint64_t LSM_DLL_EXPORT lsm_block_range_block_count_get(lsm_block_range *br);
#ifdef __cplusplus
}
#endif
#endif
|