/* * Listeners have no associated device, so we never register them. * Note that ib_get_client_data() does not check if @device is * NULL for us.
*/ staticstruct rpcrdma_device *rpcrdma_get_client_data(struct ib_device *device)
{ if (!device) return NULL; return ib_get_client_data(device, &rpcrdma_ib_client);
}
/** * rpcrdma_rn_register - register to get device removal notifications * @device: device to monitor * @rn: notification object that wishes to be notified * @done: callback to notify caller of device removal * * Returns zero on success. The callback in rn_done is guaranteed * to be invoked when the device is removed, unless this notification * is unregistered first. * * On failure, a negative errno is returned.
*/ int rpcrdma_rn_register(struct ib_device *device, struct rpcrdma_notification *rn, void (*done)(struct rpcrdma_notification *rn))
{ struct rpcrdma_device *rd = rpcrdma_get_client_data(device);
if (!rd || test_bit(RPCRDMA_RD_F_REMOVING, &rd->rd_flags)) return -ENETUNREACH;
/** * rpcrdma_add_one - ib_client device insertion callback * @device: device about to be inserted * * Returns zero on success. xprtrdma private data has been allocated * for this device. On failure, a negative errno is returned.
*/ staticint rpcrdma_add_one(struct ib_device *device)
{ struct rpcrdma_device *rd;
rd = kzalloc(sizeof(*rd), GFP_KERNEL); if (!rd) return -ENOMEM;
/* * Wait only if there are still outstanding notification * registrants for this device.
*/ if (!refcount_dec_and_test(&rd->rd_kref.refcount)) {
trace_rpcrdma_client_wait_on(device);
wait_for_completion(&rd->rd_done);
}
/** * rpcrdma_ib_client_unregister - unregister ib_client for xprtrdma * * cel: watch for orphaned rpcrdma_device objects on module unload
*/ void rpcrdma_ib_client_unregister(void)
{
ib_unregister_client(&rpcrdma_ib_client);
}
/** * rpcrdma_ib_client_register - register ib_client for rpcrdma * * Returns zero on success, or a negative errno.
*/ int rpcrdma_ib_client_register(void)
{ return ib_register_client(&rpcrdma_ib_client);
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.