mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-30 03:47:05 -05:00
Adds UUID to check to detect disk misplacement.
This commit is contained in:
parent
8810d7b05d
commit
768113c670
15 changed files with 272 additions and 34 deletions
9
elem.h
9
elem.h
|
|
@ -252,12 +252,18 @@ struct snapraid_disk {
|
|||
tommy_node node;
|
||||
};
|
||||
|
||||
/**
|
||||
* Max UUID length.
|
||||
*/
|
||||
#define UUID_MAX 128
|
||||
|
||||
/**
|
||||
* Disk mapping.
|
||||
*/
|
||||
struct snapraid_map {
|
||||
char name[PATH_MAX]; /**< Name of the disk. */
|
||||
unsigned position; /**< Position of the disk in the parity. */
|
||||
char uuid[UUID_MAX]; /**< UUID of the disk. Empty if unknown. */
|
||||
|
||||
/* nodes for data structures */
|
||||
tommy_node node;
|
||||
|
|
@ -617,8 +623,9 @@ static inline struct snapraid_block* disk_block_get(struct snapraid_disk* disk,
|
|||
|
||||
/**
|
||||
* Allocates a disk mapping.
|
||||
* Uses uuid="" if not available.
|
||||
*/
|
||||
struct snapraid_map* map_alloc(const char* name, unsigned position);
|
||||
struct snapraid_map* map_alloc(const char* name, unsigned position, const char* uuid);
|
||||
|
||||
/**
|
||||
* Deallocates a disk mapping.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue