Whamcloud - gitweb
misc/create_inode.c: handle hardlinks
authorRobert Yang <liezhi.yang@windriver.com>
Thu, 6 Mar 2014 16:00:25 +0000 (11:00 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 6 Mar 2014 16:00:25 +0000 (11:00 -0500)
commitf84894bc047898559f314531ed469c52d79ad7f2
treea2f24ce5cd47e5efa75ac636b74884b3de9633b9
parent217c0bdf17899c0f79b73f76feeadd6d55863180
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