[Ocfs2-tools-devel] [PATCH 05/10] libocfs2: read/write now know inline data.

Joel Becker Joel.Becker at oracle.com
Fri Jul 11 21:07:36 PDT 2008


On Sat, Jul 12, 2008 at 09:58:53AM +0800, Tao Ma wrote:
>>> +	written = 1;
>>> +out:
>>> +	return written ? written : ret;
>>
>> 	This isn't pretty.  Why do it this way?
> Copied from kernel. I think the reason is that this function returns 3  
> values: 0 means "can't write inline, but no error", 1 means "write  
> inline" succ, <0 means error. So we have to tell from 1 and 0 by the 
> caller.

	Right, in kernel.  But in errcode_t land, 0 means 'ok' and !0
means 'error', so we can't play these tricks on errcode_t so much.  (the
right answer in errcode_t is to create an _ET_ value specific to your
need.  But that's not as good as lifting the function up as below)

>> 	Why not lift this call to ocfs2_write_cached_inode back up into
>> ocfs2_try_to_write_inline_data()?  It's coupled with that anyway.
> Yeah. thx.

	Sounds good.

Joel

-- 

Life's Little Instruction Book #69

	"Whistle"

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list