[sheepdog] [PATCH 1/6] sheep: redesign a new cached sockfd pool
MORITA Kazutaka
morita.kazutaka at lab.ntt.co.jp
Mon Jun 25 10:00:31 CEST 2012
At Mon, 25 Jun 2012 14:35:58 +0800,
Liu Yuan wrote:
>
> On 06/25/2012 01:22 PM, MORITA Kazutaka wrote:
> > How about changing this prototype to
> >
> > void sockfd_cache_del(struct sd_node *);
> >
> > and avoiding exporting struct node_id?
>
> sheep_del_fd() calls sockfd_cache_del() internally, but sheep_del_fd's
> parameter is sd_vnode instead of sd_node. Casting sd_vnode to sd_node
> looks weird to me.
Ah, I see.
If we allow casting sd_node and sd_vnode to node_id outside
socketfd_cache.c, it looks cleaner to use node_id for other prototypes
too:
void sockfd_cache_del(struct node_id *);
void sockfd_cache_add(struct node_id *);
void sockfd_cache_add_group(struct node_id *, int nr);
int sheep_get_fd(struct node_id *, int *);
void sheep_put_fd(struct node_id *, int fd, int);
void sheep_del_fd(struct node_id *, int fd, int);
I think it's a matter of taste, though.
Thanks,
Kazutaka
More information about the sheepdog
mailing list