[Sheepdog] [PATCH] sheep: avoid calling get_vnode_info() against force operations

Liu Yuan namei.unix at gmail.com
Sat May 5 16:12:23 CEST 2012


On 05/05/2012 06:08 PM, Christoph Hellwig wrote:

> On Sat, May 05, 2012 at 06:05:54PM +0800, Liu Yuan wrote:
>>>  	if (is_io_op(req->op)) {
>>>  		req->work.fn = do_io_request;
>>>  		req->work.done = io_op_done;
>>
>>
>>
>> Well, on the second look, free_request() calls put_vnode_info()... it
>> seems that we have to call get_vnode_info() for every request queuing, no?
> 
> It checks for it beeing non-NULL first, and thus is fine.
> 
> That beeing said I generally prefer the checks outside as they force
> a programming style that forces understanding what's going on.
> 


Okay, put_vnode_info() can work out with NULL passed in. This interface
looks a little bit different than conventional practice to call get/put
operating on refcount in pair.

Thanks,
Yuan



More information about the sheepdog mailing list