main: report is-detached for damaged resources

This commit is contained in:
Thomas Schoebel-Theuer 2017-08-09 06:46:07 +02:00 committed by Thomas Schoebel-Theuer
parent 34d7ebbd71
commit 68016194bc

View File

@ -3687,7 +3687,6 @@ int make_log_finalize(struct mars_global *global, struct mars_dent *dent)
struct mars_rotate *rot;
struct trans_logger_brick *trans_brick;
struct copy_brick *fetch_brick;
bool is_attached;
bool is_stopped;
int status = -EINVAL;
@ -3926,9 +3925,6 @@ done:
}
// remove trans_logger (when possible) upon detach
is_attached = !!rot->trans_brick;
_show_actual(rot->parent_path, "is-attached", is_attached);
if (rot->trans_brick && rot->trans_brick->power.led_off && !rot->trans_brick->outputs[0]->nr_connected) {
bool do_attach = _check_allow(global, parent, "attach");
MARS_DBG("do_attach = %d\n", do_attach);
@ -3985,6 +3981,7 @@ int make_bio(void *buf, struct mars_dent *dent)
struct mars_rotate *rot;
struct mars_brick *brick;
bool switch_on;
bool is_attached;
int status = 0;
if (!global || !dent->d_parent) {
@ -3994,6 +3991,9 @@ int make_bio(void *buf, struct mars_dent *dent)
if (!rot)
goto done;
is_attached = !!rot->trans_brick;
_show_actual(rot->parent_path, "is-attached", is_attached);
rot->has_symlinks = true;
switch_on = _check_allow(global, dent->d_parent, "attach");