Add context to comments.

PiperOrigin-RevId: 294295852
This commit is contained in:
Adin Scannell
2020-02-10 13:52:09 -08:00
committed by gVisor bot
parent bb22ebd7fb
commit a6f9361c2f
+4 -2
View File
@@ -88,8 +88,9 @@ func bsize(pattr p9.Attr) int64 {
if pattr.BlockSize > 0 {
return int64(pattr.BlockSize)
}
// Some files may have no clue of their block size. Better not to report
// something misleading or buggy and have a safe default.
// Some files, particularly those that are not on a local file system,
// may have no clue of their block size. Better not to report something
// misleading or buggy and have a safe default.
return usermem.PageSize
}
@@ -149,6 +150,7 @@ func links(valid p9.AttrMask, pattr p9.Attr) uint64 {
}
// This node is likely backed by a file system that doesn't support links.
//
// We could readdir() and count children directories to provide an accurate
// link count. However this may be expensive since the gofer may be backed by remote
// storage. Instead, simply return 2 links for directories and 1 for everything else