//go:build linux package layout import ( "os" "syscall" ) // linkCount is the number of directory entries that name the file, read // without following a symlink, and the file's inode so an operator can // find the other names. A regular file the pass moves must have exactly // one name: a second one somewhere else is a second reader and writer the // move does not know about. func linkCount(fi os.FileInfo) (nlink, inode uint64) { if st, ok := fi.Sys().(*syscall.Stat_t); ok { return uint64(st.Nlink), uint64(st.Ino) } return 1, 0 }