At Sun, 24 Jun 2012 20:51:50 +0800,
Liu Yuan wrote:
> +
> +/*
> + * Grab a free slot of the node and inc the refcount of the slot
> + *
> + * If no free slot available, this typically means we should use short FD.
> + */
> +static struct sockfd_cache_entry *sockfd_cache_grab(struct node_id *nid,
> +                                                 char *name, int *ret_idx)
>  {
>       struct sockfd_cache_entry *entry;
>  
>       pthread_rwlock_rdlock(&sockfd_cache.lock);
>       entry = sockfd_cache_search(nid);
> -     pthread_rwlock_unlock(&sockfd_cache.lock);
> -     assert(entry);
> -     /* if refcount == 0, set it to 1, otherwise someone holds it */
> -     if (uatomic_cmpxchg(&entry->refcount, 0, 1))
> -             return NULL;
> +     if (!entry){

Space required before '{'.

Thanks,

Kazutaka
-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to