misc/create_inode.c: handle hardlinks
authorRobert Yang <liezhi.yang@windriver.com>
Thu, 6 Mar 2014 16:00:25 +0000 (11:00 -0500)
committerChanho Park <chanho61.park@samsung.com>
Tue, 5 Aug 2014 04:40:54 +0000 (13:40 +0900)
commitfc0b584f67f0524e90f8bab1964da0920bdcf4c7
tree217dc2a8d5a77770dabcaa4f3383dc73f9eaf0e7
parent1711fc722e3976e7ecf49c13ba15d8721a250fad
misc/create_inode.c: handle hardlinks

Create the inode and save the native inode number when we meet the hard
link (st_nlink > 1) at the first time, use ext2fs_link() to link the
name to the target inode number when we meet the same native inode
number again.

This algorithm is referred this from the genext2fs.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/create_inode.c
misc/create_inode.h
misc/mke2fs.c