From: John L. Hammond Date: Mon, 19 Dec 2016 16:42:44 +0000 (-0600) Subject: LU-8403 obd: remove unused data parameter from obd_notify() X-Git-Tag: 2.9.55~21 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f519ec213874cedc3a07f8a47d87eac3a6279a82 LU-8403 obd: remove unused data parameter from obd_notify() Remove the unused data parameter from obd_notify() and related functions. Signed-off-by: John L. Hammond Change-Id: I1ae72de176ae71441cf486ad6a10c45d57b32aad Reviewed-on: https://review.whamcloud.com/24428 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Steve Guminski Reviewed-by: Dmitry Eremin Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 8da5942..af87bfb 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -544,8 +544,8 @@ enum obd_notify_event { * 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; }; @@ -935,7 +935,7 @@ struct obd_ops { 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); diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index b3fcd07..2f85a99 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -1163,54 +1163,48 @@ static inline void obd_import_event(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); if (!obd->obd_set_up) { - 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, - struct obd_device *observed, - enum obd_notify_event ev, - void *data) + struct obd_device *observed, + enum obd_notify_event ev) { - int rc1; - int rc2; + 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, diff --git a/lustre/llite/lcommon_misc.c b/lustre/llite/lcommon_misc.c index 4f35793..ced348a 100644 --- a/lustre/llite/lcommon_misc.c +++ b/lustre/llite/lcommon_misc.c @@ -75,14 +75,12 @@ static int cl_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_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; diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 0243cc5..cd34ccb 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -669,7 +669,7 @@ void ll_ras_enter(struct file *f); /* 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); diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index f9ae025..74166fb 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -143,7 +143,7 @@ struct obd_uuid *lmv_get_uuid(struct obd_export *exp) } 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; @@ -182,13 +182,13 @@ static int lmv_notify(struct obd_device *obd, struct obd_device *watched, 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); - RETURN(rc); + RETURN(rc); } static int lmv_connect(const struct lu_env *env, @@ -345,18 +345,17 @@ int lmv_connect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt) RETURN(rc); } - 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, - OBD_NOTIFY_ACTIVE, - (void *)(tgt - lmv->tgts[0])); + OBD_NOTIFY_ACTIVE); if (rc) { obd_disconnect(mdc_exp); RETURN(rc); } - } + } tgt->ltd_active = 1; tgt->ltd_exp = mdc_exp; diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 5a2eebb..985b720 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -113,7 +113,7 @@ static void lov_putref(struct obd_device *obd) 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) @@ -260,8 +260,8 @@ static int lov_connect(const struct lu_env *env, 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); @@ -444,7 +444,7 @@ static int lov_set_osc_active(struct obd_device *obd, struct obd_uuid *uuid, } 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; @@ -477,13 +477,10 @@ static int lov_notify(struct obd_device *obd, struct obd_device *watched, 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. */ - rc = obd_notify_observer(obd, watched, ev, data); + rc = obd_notify_observer(obd, watched, ev); out_notify_lock: up_read(&lov->lov_notify_lock); @@ -609,9 +606,8 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp, GOTO(out, rc); } - 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); out: if (rc) { diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index f0b9e71..2426ce8 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -2519,7 +2519,7 @@ static int mdc_import_event(struct obd_device *obd, struct obd_import *imp, 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: { @@ -2530,13 +2530,13 @@ static int mdc_import_event(struct obd_device *obd, struct obd_import *imp, 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: - 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: diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 9f541e5..4060d23 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -2647,7 +2647,7 @@ static int osc_import_event(struct obd_device *obd, 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: { @@ -2672,7 +2672,7 @@ static int osc_import_event(struct obd_device *obd, 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: { @@ -2685,15 +2685,15 @@ static int osc_import_event(struct obd_device *obd, 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: { - rc = obd_notify_observer(obd, obd, OBD_NOTIFY_DEACTIVATE, NULL); + rc = obd_notify_observer(obd, obd, OBD_NOTIFY_DEACTIVATE); break; } case IMP_EVENT_ACTIVATE: { - rc = obd_notify_observer(obd, obd, OBD_NOTIFY_ACTIVATE, NULL); + rc = obd_notify_observer(obd, obd, OBD_NOTIFY_ACTIVATE); break; } default: