summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/ext/utils.go
diff options
context:
space:
mode:
authorAyush Ranjan <ayushranjan@google.com>2019-07-23 20:34:49 -0700
committergVisor bot <gvisor-bot@google.com>2019-07-23 20:36:04 -0700
commit7e38d643334647fb79c7cc8be35745699de264e6 (patch)
treef6470d9f953dc7274ee98f1af62736a7493ef68c /pkg/sentry/fs/ext/utils.go
parentd7bb79b6f177e8c58d47695e0ee1a072475463c4 (diff)
ext: Inode creation logic.
PiperOrigin-RevId: 259666476
Diffstat (limited to 'pkg/sentry/fs/ext/utils.go')
-rw-r--r--pkg/sentry/fs/ext/utils.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/sentry/fs/ext/utils.go b/pkg/sentry/fs/ext/utils.go
index 71e46b2c4..3472c5fa8 100644
--- a/pkg/sentry/fs/ext/utils.go
+++ b/pkg/sentry/fs/ext/utils.go
@@ -28,7 +28,7 @@ import (
// All disk reads should use this helper so we avoid reading from stale
// previously used offsets. This function forces the offset parameter.
//
-// Precondition: Must have mutual exclusion on device fd.
+// Precondition: Must hold the mutex of the filesystem containing dev.
func readFromDisk(dev io.ReadSeeker, abOff int64, v interface{}) error {
if _, err := dev.Seek(abOff, io.SeekStart); err != nil {
return syserror.EIO
@@ -45,7 +45,7 @@ func readFromDisk(dev io.ReadSeeker, abOff int64, v interface{}) error {
// device. There are three versions of the superblock. This function identifies
// and returns the correct version.
//
-// Precondition: Must have mutual exclusion on device fd.
+// Precondition: Must hold the mutex of the filesystem containing dev.
func readSuperBlock(dev io.ReadSeeker) (disklayout.SuperBlock, error) {
var sb disklayout.SuperBlock = &disklayout.SuperBlockOld{}
if err := readFromDisk(dev, disklayout.SbOffset, sb); err != nil {
@@ -87,7 +87,7 @@ func blockGroupsCount(sb disklayout.SuperBlock) uint64 {
// readBlockGroups reads the block group descriptor table from block group 0 in
// the underlying device.
//
-// Precondition: Must have mutual exclusion on device fd.
+// Precondition: Must hold the mutex of the filesystem containing dev.
func readBlockGroups(dev io.ReadSeeker, sb disklayout.SuperBlock) ([]disklayout.BlockGroup, error) {
bgCount := blockGroupsCount(sb)
bgdSize := uint64(sb.BgDescSize())