|
Packit Service |
310c69 |
/*
|
|
Packit Service |
310c69 |
* Copyright (c) 2020 Red Hat, Inc.
|
|
Packit Service |
310c69 |
*
|
|
Packit Service |
310c69 |
* This program is free software; you can redistribute it and/or
|
|
Packit Service |
310c69 |
* modify it under the terms of the GNU General Public License
|
|
Packit Service |
310c69 |
* as published by the Free Software Foundation; either version 2
|
|
Packit Service |
310c69 |
* of the License, or (at your option) any later version.
|
|
Packit Service |
310c69 |
*
|
|
Packit Service |
310c69 |
* This program is distributed in the hope that it will be useful,
|
|
Packit Service |
310c69 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
310c69 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
310c69 |
* GNU General Public License for more details.
|
|
Packit Service |
310c69 |
*
|
|
Packit Service |
310c69 |
* You should have received a copy of the GNU General Public License
|
|
Packit Service |
310c69 |
* along with this program; if not, write to the Free Software
|
|
Packit Service |
310c69 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
Packit Service |
310c69 |
* 02110-1301, USA.
|
|
Packit Service |
310c69 |
*
|
|
Packit Service |
310c69 |
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/blockMapRecovery.h#1 $
|
|
Packit Service |
310c69 |
*/
|
|
Packit Service |
310c69 |
|
|
Packit Service |
310c69 |
#ifndef BLOCK_MAP_RECOVERY_H
|
|
Packit Service |
310c69 |
#define BLOCK_MAP_RECOVERY_H
|
|
Packit Service |
310c69 |
|
|
Packit Service |
310c69 |
#include "blockMap.h"
|
|
Packit Service |
310c69 |
#include "blockMappingState.h"
|
|
Packit Service |
310c69 |
#include "types.h"
|
|
Packit Service |
310c69 |
|
|
Packit Service |
310c69 |
/**
|
|
Packit Service |
310c69 |
* An explicitly numbered block mapping. Numbering the mappings allows them to
|
|
Packit Service |
310c69 |
* be sorted by logical block number during recovery while still preserving
|
|
Packit Service |
310c69 |
* the relative order of journal entries with the same logical block number.
|
|
Packit Service |
310c69 |
**/
|
|
Packit Service |
310c69 |
typedef struct {
|
|
Packit Service |
310c69 |
BlockMapSlot blockMapSlot; // Block map slot to map
|
|
Packit Service |
310c69 |
BlockMapEntry blockMapEntry; // The encoded block map entry for the LBN
|
|
Packit Service |
310c69 |
uint32_t number; // The serial number to use during replay
|
|
Packit Service |
310c69 |
} __attribute__((packed)) NumberedBlockMapping;
|
|
Packit Service |
310c69 |
|
|
Packit Service |
310c69 |
/**
|
|
Packit Service |
310c69 |
* Recover the block map (normal rebuild).
|
|
Packit Service |
310c69 |
*
|
|
Packit Service |
310c69 |
* @param vdo The VDO
|
|
Packit Service |
310c69 |
* @param entryCount The number of journal entries
|
|
Packit Service |
310c69 |
* @param journalEntries An array of journal entries to process
|
|
Packit Service |
310c69 |
* @param parent The completion to notify when the rebuild is complete
|
|
Packit Service |
310c69 |
**/
|
|
Packit Service |
310c69 |
void recoverBlockMap(VDO *vdo,
|
|
Packit Service |
310c69 |
BlockCount entryCount,
|
|
Packit Service |
310c69 |
NumberedBlockMapping *journalEntries,
|
|
Packit Service |
310c69 |
VDOCompletion *parent);
|
|
Packit Service |
310c69 |
|
|
Packit Service |
310c69 |
#endif // BLOCK_MAP_RECOVERY_H
|