[Ocfs2-tools-devel] [PATCH 20/22] tunefs rework: Add the libocfs2ne sources.

Joel Becker Joel.Becker at oracle.com
Thu Aug 7 01:50:30 PDT 2008


On Thu, Aug 07, 2008 at 04:30:58PM +0800, Tao Ma wrote:
> Joel Becker wrote:

>> +errcode_t tunefs_foreach_inode(ocfs2_filesys *fs, int filetype_mask,
>> +			       errcode_t (*func)(ocfs2_filesys *fs,
>> +						 struct ocfs2_dinode *di,
>> +						 void *user_data),
>> +			       void *user_data)
>> +{

<snip>

>> +		if (di->i_flags & OCFS2_SYSTEM_FL)
>> +			continue;
> you'd better leave this judgement to the func itself. inline data also need 
> to iterate all the inodes and it will also modify system files if we want 
> to remove "inline-data" support from the volume(orphand_dir is intialized 
> as inline dir).

	You're right that inline data will want system files.
	I'd rather create a flag to the foreach function.  I wrote
tunefs_validate_inode() and tunefs_foreach_inode() because we were
repeating the same checks in many places.
	Let me think about this, we don't have an i_flags for regular
files, so how would we check that?  The "common" case would be regular
files, and we could have an allowed_system_files mask that takes the
OCFS2_LOCAL_ALLOC_FL, etc...
	No, I think you're right that the callers should do the check
and skip themselves.

Joel

-- 

"There is no more evil thing on earth than race prejudice, none at 
 all.  I write deliberately -- it is the worst single thing in life 
 now.  It justifies and holds together more baseness, cruelty and
 abomination than any other sort of error in the world." 
        - H. G. Wells

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