[Sheepdog] [PATCH 3/3] sheep: use do_process_work() in io request

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Nov 22 06:44:38 CET 2011


> >> -static int store_remove_obj(struct request *req, uint32_t epoch)
> >> +int store_remove_obj(const struct sd_req *req, struct sd_rsp *rsp, void *data)
> >>  {
> >> -	struct sd_obj_req *hdr = (struct sd_obj_req *)&req->rq;
> >> +	struct sd_obj_req *hdr = (struct sd_obj_req *)req;
> > 
> > No really a comment to this patch, but rather to the protocol headers
> > in general:  Any reason why the sd_obj_req defintion (and others like
> > it) can't simply include the sd_req in their defintion?  In that case
> > we could actually use type-safe container_of constructs for things like
> > this one.
> > 
> 
> 
> I am not sure (I only have around 2 month long coding on sheepdog), but
> I notice some of code written the way you sugguest, so I think it is a
> historic leftover.

No reasons other than that we can directly access the sd_req members.
Probably, using container_of is better to avoid too much casting.

Thanks,

Kazutaka



More information about the sheepdog mailing list