mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-01 20:36:38 -05:00
New extra config option for additional disks to monitor
This commit is contained in:
parent
c6f6e7e448
commit
60c7b6baa3
15 changed files with 329 additions and 279 deletions
|
|
@ -824,6 +824,35 @@ void disk_free(struct snapraid_disk* disk)
|
|||
free(disk);
|
||||
}
|
||||
|
||||
struct snapraid_extra* extra_alloc(const char* name, const char* dir, uint64_t dev, const char* uuid)
|
||||
{
|
||||
struct snapraid_extra* extra;
|
||||
unsigned i;
|
||||
|
||||
extra = malloc_nofail(sizeof(struct snapraid_extra));
|
||||
pathcpy(extra->name, sizeof(extra->name), name);
|
||||
pathimport(extra->dir, sizeof(extra->dir), dir);
|
||||
pathcpy(extra->uuid, sizeof(extra->uuid), uuid);
|
||||
|
||||
/* ensure that the dir terminate with "/" if it isn't empty */
|
||||
pathslash(extra->dir, sizeof(extra->dir));
|
||||
|
||||
extra->smartctl[0] = 0;
|
||||
for (i = 0; i < SMART_IGNORE_MAX; ++i)
|
||||
extra->smartignore[i] = 0;
|
||||
extra->fstype[0] = 0;
|
||||
extra->fslabel[0] = 0;
|
||||
extra->device = dev;
|
||||
|
||||
return extra;
|
||||
}
|
||||
|
||||
void extra_free(struct snapraid_extra* extra)
|
||||
{
|
||||
free(extra);
|
||||
}
|
||||
|
||||
|
||||
static inline void fs_lock(struct snapraid_disk* disk)
|
||||
{
|
||||
#if HAVE_THREAD
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue