commit | 657432a21deaee8f63005c8f9694d232aebd5db3 | [log] [tgz] |
---|---|---|
author | Gao Xiang <hsiangkao@aol.com> | Sat Dec 05 17:16:37 2020 +0800 |
committer | Gao Xiang <hsiangkao@aol.com> | Sat Dec 05 17:25:20 2020 +0800 |
tree | 3ff3043846d9872e1f763b360f14b331080ae6ac | |
parent | c4595dba777030dd967d882b0869560bb59ac922 [diff] |
erofs-utils: update i_nlink stat for directories Previously, nlink of directories was treated as 1 for simplicity. Since st_nlink for dirs is actually not well defined, nlink=1 seems to pacify `find' (even without -noleaf option) and other utilities. AFAICT, isofs, romfs and cramfs always set it to 1, Overlayfs sets it to 1 conditionally, btrfs[1], ceph[2] and FUSE client historically set it to 1. The convention under unix is that it's # of subdirs including "." and "..". This patch tries to follow such convention if possible to optimize `find' performance since it's not quite hard for local fs. [1] https://lore.kernel.org/r/20100124003336.GP23006@think [2] https://lore.kernel.org/r/20180521092729.17470-1-lhenriques@suse.com Link: https://lore.kernel.org/r/20201205091637.8944-1-hsiangkao@aol.com Reviewed-by: Li Guifu <bluce.lee@aliyun.com> Signed-off-by: Gao Xiang <hsiangkao@aol.com>