mutex_up(&lov->lov_lock);
}
+static int lov_set_osc_active(struct obd_device *obd, struct obd_uuid *uuid,
+ int activate);
+static int lov_notify(struct obd_device *obd, struct obd_device *watched,
+ enum obd_notify_event ev, void *data);
+
+
#define MAX_STRING_SIZE 128
int lov_connect_obd(struct obd_device *obd, __u32 index, int activate,
struct obd_connect_data *data)
obd->obd_name, i, rc);
continue;
}
+ /* connect to administrative disabled ost */
+ if (!lov->lov_tgts[i]->ltd_exp)
+ continue;
+
+ rc = lov_notify(obd, lov->lov_tgts[i]->ltd_exp->exp_obd,
+ OBD_NOTIFY_ACTIVE, (void *)&i);
+ if (rc) {
+ CERROR("%s error sending notify %d\n",
+ obd->obd_name, rc);
+ }
}
lov_putref(obd);
/* Error codes:
*
* -EINVAL : UUID can't be found in the LOV's target list
- * - any other is lov index
+ * -ENOTCONN: The UUID is found, but the target connection is bad (!)
+ * -EBADF : The UUID is found, but the OBD is the wrong type (!)
+ * any >= 0 : is log target index
*/
static int lov_set_osc_active(struct obd_device *obd, struct obd_uuid *uuid,
int activate)
{
int rc = 0;
ENTRY;
-
+
if (ev == OBD_NOTIFY_ACTIVE || ev == OBD_NOTIFY_INACTIVE) {
struct obd_uuid *uuid;
obd_uuid2str(uuid), rc);
RETURN(rc);
}
+ /* active event should be pass lov target index as data */
data = &rc;
}
data = &i;
tgt_obd = class_exp2obd(lov->lov_tgts[i]->ltd_exp);
+
rc = obd_notify_observer(obd, tgt_obd, ev, data);
if (rc) {
CERROR("%s: notify %s of %s failed %d\n",
if (rc)
GOTO(out, rc);
+ /* connect to administrative disabled ost */
+ if (!tgt->ltd_exp)
+ GOTO(out, rc = 0);
+
rc = lov_notify(obd, tgt->ltd_exp->exp_obd,
active ? OBD_NOTIFY_ACTIVE : OBD_NOTIFY_INACTIVE,
(void *)&index);