mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-19 04:24:28 +02:00
fix(mount): add -posixDirNlink option for correct directory nlink
Add optional POSIX-compliant directory nlink counting (nlink = 2 + number_of_subdirectories) behind the -posixDirNlink flag. This requires listing cached directory entries on every stat, which has a performance cost, so it's off by default. When disabled (default), directories report nlink=2, which is the POSIX-compliant baseline for empty directories and a common default in distributed filesystems. - Set nlink baseline to 2 for all directories (was 1) - Add applyDirNlink() gated behind option.PosixDirNlink - Add -posixDirNlink CLI flag
This commit is contained in:
1 parent
cd82a9cb4b
commit
178532e63a
5 files changed
+44
-4
No files matched your search
@@ -354,6 +354,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
||||
DirIdleEvictSec: *option.dirIdleEvictSec,
|
||||
EnableDistributedLock: option.distributedLock != nil && *option.distributedLock,
|
||||
WritebackCache: option.writebackCache != nil && *option.writebackCache,
|
||||
PosixDirNlink: option.posixDirNlink != nil && *option.posixDirNlink,
|
||||
})
|
||||
|
||||
// create mount root
|
||||
|
||||
Reference in new issue
Block a user