[sheepdog] [PATCH V2 1/2] sheep: simplify client_decref() and move it into free_request() and add a helper function

Christoph Hellwig hch at infradead.org
Fri Jul 6 12:13:12 CEST 2012


> +static void clear_client(struct client_info *ci)
> +{
> +	if (!list_empty(&ci->conn.blocking_siblings))
> +		list_del_init(&ci->conn.blocking_siblings);
> +
> +	unregister_event(ci->conn.fd);

Is a double unregister-event fine?  It seems like we don't protect
against that here.

>  static void client_decref(struct client_info *ci)
>  {
> -	if (ci && --ci->refcnt == 0)
> -		destroy_client(ci);
> +	if (ci)
> +		ci->refcnt--;

It seems like client_incref / client_decref should just go away,
they contain an unneeded NULL check and otherwise just do a trivial
-- / ++ operation and only have a singler caller each.




More information about the sheepdog mailing list