Remove the unused data parameter from obd_notify() and related
functions.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I1ae72de176ae71441cf486ad6a10c45d57b32aad
Reviewed-on: https://review.whamcloud.com/24428
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Steve Guminski <stephenx.guminski@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
* and liblustre being main examples).
*/
struct obd_notify_upcall {
* and liblustre being main examples).
*/
struct obd_notify_upcall {
- int (*onu_upcall)(struct obd_device *host, struct obd_device *watched,
- enum obd_notify_event ev, void *owner, void *data);
+ int (*onu_upcall)(struct obd_device *host, struct obd_device *watched,
+ enum obd_notify_event ev, void *owner);
/* Opaque datum supplied by upper layer listener */
void *onu_owner;
};
/* Opaque datum supplied by upper layer listener */
void *onu_owner;
};
enum obd_import_event);
int (*o_notify)(struct obd_device *obd, struct obd_device *watched,
enum obd_import_event);
int (*o_notify)(struct obd_device *obd, struct obd_device *watched,
- enum obd_notify_event ev, void *data);
+ enum obd_notify_event ev);
int (*o_health_check)(const struct lu_env *env, struct obd_device *);
struct obd_uuid *(*o_get_uuid) (struct obd_export *exp);
int (*o_health_check)(const struct lu_env *env, struct obd_device *);
struct obd_uuid *(*o_get_uuid) (struct obd_export *exp);
}
static inline int obd_notify(struct obd_device *obd,
}
static inline int obd_notify(struct obd_device *obd,
- struct obd_device *watched,
- enum obd_notify_event ev,
- void *data)
+ struct obd_device *watched,
+ enum obd_notify_event ev)
- int rc;
- ENTRY;
- OBD_CHECK_DEV(obd);
+ int rc;
+ ENTRY;
+ OBD_CHECK_DEV(obd);
- CDEBUG(D_HA, "obd %s not set up\n", obd->obd_name);
- RETURN(-EINVAL);
- }
+ CDEBUG(D_HA, "obd %s not set up\n", obd->obd_name);
+ RETURN(-EINVAL);
+ }
- if (!OBP(obd, notify)) {
- CDEBUG(D_HA, "obd %s has no notify handler\n", obd->obd_name);
- RETURN(-ENOSYS);
- }
+ if (!OBP(obd, notify)) {
+ CDEBUG(D_HA, "obd %s has no notify handler\n", obd->obd_name);
+ RETURN(-ENOSYS);
+ }
- OBD_COUNTER_INCREMENT(obd, notify);
- rc = OBP(obd, notify)(obd, watched, ev, data);
- RETURN(rc);
+ OBD_COUNTER_INCREMENT(obd, notify);
+ rc = OBP(obd, notify)(obd, watched, ev);
+
+ RETURN(rc);
}
static inline int obd_notify_observer(struct obd_device *observer,
}
static inline int obd_notify_observer(struct obd_device *observer,
- struct obd_device *observed,
- enum obd_notify_event ev,
- void *data)
+ struct obd_device *observed,
+ enum obd_notify_event ev)
+ int rc = 0;
+ int rc2 = 0;
+ struct obd_notify_upcall *onu;
- struct obd_notify_upcall *onu;
+ if (observer->obd_observer)
+ rc = obd_notify(observer->obd_observer, observed, ev);
- if (observer->obd_observer)
- rc1 = obd_notify(observer->obd_observer, observed, ev, data);
- else
- rc1 = 0;
- /*
- * Also, call non-obd listener, if any
- */
- onu = &observer->obd_upcall;
- if (onu->onu_upcall != NULL)
- rc2 = onu->onu_upcall(observer, observed, ev,
- onu->onu_owner, NULL);
- else
- rc2 = 0;
-
- return rc1 ? rc1 : rc2;
+ /*
+ * Also, call non-obd listener, if any
+ */
+ onu = &observer->obd_upcall;
+ if (onu->onu_upcall != NULL)
+ rc2 = onu->onu_upcall(observer, observed, ev, onu->onu_owner);
+
+ return rc ? rc : rc2;
}
static inline int obd_quotactl(struct obd_export *exp,
}
static inline int obd_quotactl(struct obd_export *exp,
- * This function is used as an upcall-callback hooked by liblustre and llite
- * clients into obd_notify() listeners chain to handle notifications about
- * change of import connect_flags. See llu_fsswop_mount() and
- * lustre_common_fill_super().
+ * This function is used as an upcall-callback hooked llite clients
+ * into obd_notify() listeners chain to handle notifications about
+ * change of import connect_flags. See lustre_common_fill_super().
-int cl_ocd_update(struct obd_device *host,
- struct obd_device *watched,
- enum obd_notify_event ev, void *owner, void *data)
+int cl_ocd_update(struct obd_device *host, struct obd_device *watched,
+ enum obd_notify_event ev, void *owner)
{
struct lustre_client_ocd *lco;
struct client_obd *cli;
{
struct lustre_client_ocd *lco;
struct client_obd *cli;
/* llite/lcommon_misc.c */
int cl_ocd_update(struct obd_device *host, struct obd_device *watched,
/* llite/lcommon_misc.c */
int cl_ocd_update(struct obd_device *host, struct obd_device *watched,
- enum obd_notify_event ev, void *owner, void *data);
+ enum obd_notify_event ev, void *owner);
int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
struct ll_grouplock *lg);
void cl_put_grouplock(struct ll_grouplock *lg);
int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
struct ll_grouplock *lg);
void cl_put_grouplock(struct ll_grouplock *lg);
}
static int lmv_notify(struct obd_device *obd, struct obd_device *watched,
}
static int lmv_notify(struct obd_device *obd, struct obd_device *watched,
- enum obd_notify_event ev, void *data)
+ enum obd_notify_event ev)
{
struct obd_connect_data *conn_data;
struct lmv_obd *lmv = &obd->u.lmv;
{
struct obd_connect_data *conn_data;
struct lmv_obd *lmv = &obd->u.lmv;
obd->obd_self_export->exp_connect_data = *conn_data;
}
obd->obd_self_export->exp_connect_data = *conn_data;
}
- /*
- * Pass the notification up the chain.
- */
- if (obd->obd_observer)
- rc = obd_notify(obd->obd_observer, watched, ev, data);
+ /*
+ * Pass the notification up the chain.
+ */
+ if (obd->obd_observer)
+ rc = obd_notify(obd->obd_observer, watched, ev);
}
static int lmv_connect(const struct lu_env *env,
}
static int lmv_connect(const struct lu_env *env,
- if (obd->obd_observer) {
- /*
- * Tell the observer about the new target.
- */
+ if (obd->obd_observer) {
+ /*
+ * Tell the observer about the new target.
+ */
rc = obd_notify(obd->obd_observer, mdc_exp->exp_obd,
rc = obd_notify(obd->obd_observer, mdc_exp->exp_obd,
- OBD_NOTIFY_ACTIVE,
- (void *)(tgt - lmv->tgts[0]));
if (rc) {
obd_disconnect(mdc_exp);
RETURN(rc);
}
if (rc) {
obd_disconnect(mdc_exp);
RETURN(rc);
}
tgt->ltd_active = 1;
tgt->ltd_exp = mdc_exp;
tgt->ltd_active = 1;
tgt->ltd_exp = mdc_exp;
static int lov_set_osc_active(struct obd_device *obd, struct obd_uuid *uuid,
enum obd_notify_event ev);
static int lov_notify(struct obd_device *obd, struct obd_device *watched,
static int lov_set_osc_active(struct obd_device *obd, struct obd_uuid *uuid,
enum obd_notify_event ev);
static int lov_notify(struct obd_device *obd, struct obd_device *watched,
- enum obd_notify_event ev, void *data);
+ enum obd_notify_event ev);
int lov_connect_obd(struct obd_device *obd, __u32 index, int activate,
struct obd_connect_data *data)
int lov_connect_obd(struct obd_device *obd, __u32 index, int activate,
struct obd_connect_data *data)
if (!lov->lov_tgts[i]->ltd_exp)
continue;
if (!lov->lov_tgts[i]->ltd_exp)
continue;
- rc = lov_notify(obd, lov->lov_tgts[i]->ltd_exp->exp_obd,
- OBD_NOTIFY_CONNECT, (void *)&i);
+ rc = lov_notify(obd, lov->lov_tgts[i]->ltd_exp->exp_obd,
+ OBD_NOTIFY_CONNECT);
if (rc) {
CERROR("%s error sending notify %d\n",
obd->obd_name, rc);
if (rc) {
CERROR("%s error sending notify %d\n",
obd->obd_name, rc);
}
static int lov_notify(struct obd_device *obd, struct obd_device *watched,
}
static int lov_notify(struct obd_device *obd, struct obd_device *watched,
- enum obd_notify_event ev, void *data)
+ enum obd_notify_event ev)
{
int rc = 0;
struct lov_obd *lov = &obd->u.lov;
{
int rc = 0;
struct lov_obd *lov = &obd->u.lov;
ev, rc);
GOTO(out_notify_lock, rc);
}
ev, rc);
GOTO(out_notify_lock, rc);
}
-
- /* active event should be pass lov target index as data */
- data = &rc;
}
/* Pass the notification up the chain. */
}
/* Pass the notification up the chain. */
- rc = obd_notify_observer(obd, watched, ev, data);
+ rc = obd_notify_observer(obd, watched, ev);
out_notify_lock:
up_read(&lov->lov_notify_lock);
out_notify_lock:
up_read(&lov->lov_notify_lock);
- rc = lov_notify(obd, tgt->ltd_exp->exp_obd,
- active ? OBD_NOTIFY_CONNECT : OBD_NOTIFY_INACTIVE,
- (void *)&index);
+ rc = lov_notify(obd, tgt->ltd_exp->exp_obd,
+ active ? OBD_NOTIFY_CONNECT : OBD_NOTIFY_INACTIVE);
if (cli->cl_seq != NULL)
seq_client_flush(cli->cl_seq);
if (cli->cl_seq != NULL)
seq_client_flush(cli->cl_seq);
- rc = obd_notify_observer(obd, obd, OBD_NOTIFY_INACTIVE, NULL);
+ rc = obd_notify_observer(obd, obd, OBD_NOTIFY_INACTIVE);
break;
}
case IMP_EVENT_INVALIDATE: {
break;
}
case IMP_EVENT_INVALIDATE: {
break;
}
case IMP_EVENT_ACTIVE:
break;
}
case IMP_EVENT_ACTIVE:
- rc = obd_notify_observer(obd, obd, OBD_NOTIFY_ACTIVE, NULL);
+ rc = obd_notify_observer(obd, obd, OBD_NOTIFY_ACTIVE);
/* redo the kuc registration after reconnecting */
if (rc == 0)
rc = mdc_kuc_reregister(imp);
break;
case IMP_EVENT_OCD:
/* redo the kuc registration after reconnecting */
if (rc == 0)
rc = mdc_kuc_reregister(imp);
break;
case IMP_EVENT_OCD:
- rc = obd_notify_observer(obd, obd, OBD_NOTIFY_OCD, NULL);
+ rc = obd_notify_observer(obd, obd, OBD_NOTIFY_OCD);
break;
case IMP_EVENT_DISCON:
case IMP_EVENT_DEACTIVATE:
break;
case IMP_EVENT_DISCON:
case IMP_EVENT_DEACTIVATE:
break;
}
case IMP_EVENT_INACTIVE: {
break;
}
case IMP_EVENT_INACTIVE: {
- rc = obd_notify_observer(obd, obd, OBD_NOTIFY_INACTIVE, NULL);
+ rc = obd_notify_observer(obd, obd, OBD_NOTIFY_INACTIVE);
break;
}
case IMP_EVENT_INVALIDATE: {
break;
}
case IMP_EVENT_INVALIDATE: {
break;
}
case IMP_EVENT_ACTIVE: {
break;
}
case IMP_EVENT_ACTIVE: {
- rc = obd_notify_observer(obd, obd, OBD_NOTIFY_ACTIVE, NULL);
+ rc = obd_notify_observer(obd, obd, OBD_NOTIFY_ACTIVE);
break;
}
case IMP_EVENT_OCD: {
break;
}
case IMP_EVENT_OCD: {
if (ocd->ocd_connect_flags & OBD_CONNECT_REQPORTAL)
imp->imp_client->cli_request_portal =OST_REQUEST_PORTAL;
if (ocd->ocd_connect_flags & OBD_CONNECT_REQPORTAL)
imp->imp_client->cli_request_portal =OST_REQUEST_PORTAL;
- rc = obd_notify_observer(obd, obd, OBD_NOTIFY_OCD, NULL);
+ rc = obd_notify_observer(obd, obd, OBD_NOTIFY_OCD);
break;
}
case IMP_EVENT_DEACTIVATE: {
break;
}
case IMP_EVENT_DEACTIVATE: {
- rc = obd_notify_observer(obd, obd, OBD_NOTIFY_DEACTIVATE, NULL);
+ rc = obd_notify_observer(obd, obd, OBD_NOTIFY_DEACTIVATE);
break;
}
case IMP_EVENT_ACTIVATE: {
break;
}
case IMP_EVENT_ACTIVATE: {
- rc = obd_notify_observer(obd, obd, OBD_NOTIFY_ACTIVATE, NULL);
+ rc = obd_notify_observer(obd, obd, OBD_NOTIFY_ACTIVATE);