[sheepdog] [PATCH] sockfd_cache: close socket always when node is crashed

Liu Yuan namei.unix at gmail.com
Thu May 2 06:52:50 CEST 2013


On 05/02/2013 12:49 PM, MORITA Kazutaka wrote:
> We need:
>  - Create sockfd_cache_put_nolock() to be called in the write lock
>    context of sockfd_cache_del().
>  - Close the timeout fd even when slots_all_free() returns false.

sockfd_cache_put only does

        entry = sockfd_cache_search(nid);
        if (entry)
                uatomic_set_false(&entry->fds[idx].in_use);

and we can simply inline these operations, no need to write a new helper
for it and save one sockfd_cache_search().

Thanks,
Yuan



More information about the sheepdog mailing list