On 01/31/14 10:30, Hannes Reinecke wrote:
> +static void alua_check(struct scsi_device *sdev)
> +{
> +     struct alua_dh_data *h = get_alua_data(sdev);
> +     struct alua_port_group *pg;
> +
> +     if (!h)
> +             return;
> +
> +     rcu_read_lock();
> +     pg = rcu_dereference(h->pg);
> +     if (pg) {
> +             kref_get(&pg->kref);
> +             rcu_read_unlock();
> +             alua_rtpg_queue(pg, sdev, NULL);
> +             kref_put(&pg->kref, release_port_group);
> +     } else
> +             rcu_read_unlock();
> +}

>From the implementation it seems to me like the target port group data
is kept just as long as it is in use ? Has it been considered to keep
that data as long as the sdev exists instead ? I think that would result
in far fewer reference count manipulations and hence in code that is
easier to read and to verify.

Thanks,

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to