Skip to content

Commit

Permalink
Merge branch 'bareos-16.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco van Wieringen committed Aug 12, 2016
2 parents ba0e963 + 5a4c362 commit f4784a7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/dird/stats.c
Expand Up @@ -370,7 +370,7 @@ void stats_job_started()
/*
* A new Job was started so we need to flush any pending statistics the next run.
*/
if (!statistics_initialized) {
if (statistics_initialized) {
need_flush = true;
}
}
2 changes: 1 addition & 1 deletion src/stored/Makefile.in
Expand Up @@ -41,7 +41,7 @@ CEPHFS_LIBS = @CEPHFS_LIBS@
ELASTO_LIBS = @ELASTO_LIBS@
DROPLET_LIBS = @DROPLET_LIBS@
GLUSTER_LIBS = @GLUSTER_LIBS@
RADOS_LIBS = @RADOS_LIBS@
RADOS_LIBS = @RADOS_STRIPER_LIBS@ @RADOS_LIBS@
AVAILABLE_BACKEND_LIBS = $(CEPHFS_LIBS) $(ELASTO_LIBS) $(DROPLET_LIBS) $(GLUSTER_LIBS) $(RADOS_LIBS)
LIBS += @NEEDED_BACKEND_LIBS@

Expand Down
50 changes: 28 additions & 22 deletions src/stored/status.c
Expand Up @@ -188,6 +188,32 @@ static bool need_to_list_device(const char *devicenames, const char *devicename)
return false;
}

static bool need_to_list_device(const char *devicenames, DEVRES *device)
{
/*
* See if we are requested to list an explicit device name.
* e.g. this happens when people address one particular device in
* a autochanger via its own storage definition or an non autochanger device.
*/
if (!need_to_list_device(devicenames, device->name())) {
/*
* See if this device is part of an autochanger.
*/
if (device->changer_res) {
/*
* See if we need to list this particular device part of the given autochanger.
*/
if (!need_to_list_device(devicenames, device->changer_res->name())) {
return false;
}
} else {
return false;
}
}

return true;
}

static void list_devices(JCR *jcr, STATUS_PKT *sp, const char *devicenames)
{
int len;
Expand Down Expand Up @@ -226,28 +252,8 @@ static void list_devices(JCR *jcr, STATUS_PKT *sp, const char *devicenames)
}

foreach_res(device, R_DEVICE) {
/*
* See if we need to check for devicenames at all.
*/
if (devicenames) {
/*
* See if this device is part of an autochanger.
*/
if (device->changer_res) {
/*
* See if we need to list this particular device part of the given autochanger.
*/
if (!need_to_list_device(devicenames, device->changer_res->name())) {
continue;
}
} else {
/*
* Try matching a non autochanger device.
*/
if (!need_to_list_device(devicenames, device->name())) {
continue;
}
}
if (devicenames && !need_to_list_device(devicenames, device)) {
continue;
}

dev = device->dev;
Expand Down

0 comments on commit f4784a7

Please sign in to comment.