[sheepdog] [PATCH v3 2/3] lib: move sockfd cache from sheep to lib
Hitoshi Mitake
mitake.hitoshi at gmail.com
Thu Jul 25 04:46:35 CEST 2013
At Sat, 20 Jul 2013 00:38:42 +0900,
Hitoshi Mitake wrote:
>
> At Fri, 19 Jul 2013 23:27:02 +0800,
> Liu Yuan wrote:
> >
> > On Sat, Jul 20, 2013 at 12:24:18AM +0900, Hitoshi Mitake wrote:
> > > At Fri, 19 Jul 2013 23:21:54 +0800,
> > > Liu Yuan wrote:
> > > >
> > > > On Sat, Jul 20, 2013 at 12:14:33AM +0900, Hitoshi Mitake wrote:
> > > > > At Fri, 19 Jul 2013 20:31:57 +0800,
> > > > > Liu Yuan wrote:
> > > > > >
> > > > > > On Fri, Jul 19, 2013 at 03:18:23PM +0900, Hitoshi Mitake wrote:
> > > > > > > On some subcommands, collie also issues lots of request to sheeps. So
> > > > > > > collie can enjoy sockfd caching. For this purpose, this patch moves
> > > > > > > sockfd from sheep to lib and generalize the interfaces of sockfd.
> > > > > > >
> > > > > > > This patch doesn't change anything related to IO nic in sockfd
> > > > > > > cache. Because collie can know address nad port of IO nic and
> > > > > > > potentially use them.
> > > > > >
> > > > > > I think you should strip out node management code. Only sheep daemon need to
> > > > > > manage node.
> > > > >
> > > > > What does "node management code" mean? sockfd_node_del() and
> > > > > sockfd_cache_add_group()?
> > > >
> > > > Yes, only sheep needs these code.
> > >
> > > OK, I agree. I'll move them to sheep again in v4.
> >
> > Well, seems you need to add nodes in collie too? I didn't see the code in collie
> > to add nodes to sockfd cache.
>
> For now, sockfd_cache_get() and sockfd_cache_put() would be enough for
> collie. sockfd_cache_add() seems to be in sheep, too.
On the second thought, it seems that the node management code like
sockfd_node_del() should be provided by lib/sockfd_cache.c. Because
these interfaces rely on internal data structures and functions, so
sheep cannot implement them in its code.
(We can hide the interfaces. But if we do so, other interfaces must be
provided by lib/sockfd_cache.c)
Thanks,
Hitoshi
More information about the sheepdog
mailing list