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

Joel Becker Joel.Becker at oracle.com
Fri Jul 31 01:41:24 PDT 2009


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.

Joel

-- 

Life's Little Instruction Book #306

	"Take a nap on Sunday afternoons."

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