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

Tao Ma tao.ma at oracle.com
Thu Aug 7 02:00:15 PDT 2008



Joel Becker wrote:
> 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.
yeah, tunefs_foreach_node just iterate the inode, and it shouldn't know 
much about what the caller really want. btw you may need to modify some 
previous patches(sparse files e.g.)'s callback although system files are 
non-sparse of course. ;)

Regards,
Tao



More information about the Ocfs2-tools-devel mailing list