[Ocfs2-tools-devel] [PATCH 5/9] fsck.ocfs2: Implement Pass 1C, scanning for inode names.

Tao Ma tao.ma at oracle.com
Fri Jul 31 02:00:05 PDT 2009



Joel Becker wrote:
> On Fri, Jul 31, 2009 at 03:24:28PM +0800, Tao Ma wrote:
>> Joel Becker wrote:
>>> Pass 1C scans the directory tree to provide names for any inode owning
>>> multiply-claimed clusters.  This allows Pass 1D to print readable names
>>> when asking questions.
>>>
>>> Signed-off-by: Joel Becker <joel.becker at oracle.com>
>>> ---
>> <snip>
>>> +
>>> +static void name_inode(struct dir_scan_context *scan,
>>> +		       struct ocfs2_dir_entry *de)
>>> +{
>>> +	struct dup_inode *di = dup_inode_lookup(scan->ds_dct, de->inode);
>>> +
>>> +	if (!di || di->di_path)
>>> +		return;
>>> +
>>> +	scan->ds_inodes_left--;
>> How do we handle hard link here? It is initialized as the inode
>> count, but decreased whenever we see a dentry, so the hard link will
>> eat up our ds_inodes_left I guess?
> 
> 	We're just getting a nice name to print.  Note that we do
> nothing if di->di_path is already set.  So we find the first name for
> this inode and that's it.  Subsequent hard links to this inode will
> return before decrementing ds_inodes_left.
oh, I see, thanks.

Regards,
Tao



More information about the Ocfs2-tools-devel mailing list