[Ocfs2-tools-devel] [PATCH 15/25] o2cb: Add ops start-heartbeat and stop-heartbeat
Joel Becker
Joel.Becker at oracle.com
Wed Jun 23 20:19:16 PDT 2010
On Wed, Jun 23, 2010 at 11:44:25AM -0700, Sunil Mushran wrote:
> +static void stop_heartbeat(struct o2cb_device *od)
> +{
> + if (!(od->od_flags & O2CB_DEVICE_FOUND) ||
> + !(od->od_flags & O2CB_DEVICE_HB_STARTED))
> + return;
> +}
I don't get this function.
> +static errcode_t start_heartbeat(struct o2cb_device *od)
> +{
> + errcode_t ret = O2CB_ET_UNKNOWN_REGION;
> +
> + if (!(od->od_flags & O2CB_DEVICE_FOUND)) {
> + tcom_err(ret, "%s", od->od_uuid);
> + goto bail;
> + }
> +
> + verbosef(VL_DEBUG, "Starting heartbeat on region %s, device %s\n",
> + od->od_region.r_name, od->od_region.r_device_name);
> + ret = o2cb_start_heartbeat(&od->od_cluster, &od->od_region);
> + if (ret) {
> + if (ret == O2CB_ET_REGION_EXISTS)
> + ret = 0;
> + tcom_err(ret, "unable to start hb on uuid %s", od->od_uuid);
> + goto bail;
Why are you printing an error even if it has already been
started? Imagine I've got global heartbeat running, then I add a new
region, then I call start-heartbeat to enable it. Should I print an
error on all the existing regions?
Joel
--
"Reality is merely an illusion, albeit a very persistent one."
- Albert Einstien
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
More information about the Ocfs2-tools-devel
mailing list