[Sheepdog] [PATCH 4/5] sheep: pass vnode_info to the object cache

Christoph Hellwig hch at infradead.org
Mon May 7 16:54:52 CEST 2012


On Mon, May 07, 2012 at 05:39:57PM +0800, Yunkai Zhang wrote:
> On Mon, May 7, 2012 at 5:11 PM, Christoph Hellwig <hch at infradead.org> wrote:
> > There is no need to grab a local copy of the vnode information in the object
> > cache, as the callers can pass it. ?Unfortunately we also need the local copy
> > hack for the async flush.
> 
> It seems ugly to pass a vnode_info pointer, if we need to access other
> variables in the future, we should add another pointer?

I'd much prefer to pass the struct request like I do for the non-cluster
requests.  I actually tried it but couldn't make it work due to the
subtile interaction with the on the wire vdi_op_message.

> If we don't want to use RCU recently, passing a void* pointer to those
> functions will be more scalable.

Void pointers are inherently type unsafe - e.g. previously we passed
a struct request in the private data pointer to I/O commands, but the
user data from req->data to all others.  This isn't really a proper
implementation of the private data where the data is controller by
the consumer of an interface (thing file->private in Linux) but a
badly implented union type without enforced access rules.




More information about the sheepdog mailing list