diff options
Diffstat (limited to 'pkg/sentry/fs/ext/regular_file.go')
-rw-r--r-- | pkg/sentry/fs/ext/regular_file.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/pkg/sentry/fs/ext/regular_file.go b/pkg/sentry/fs/ext/regular_file.go index 9bf39acfe..b48f61795 100644 --- a/pkg/sentry/fs/ext/regular_file.go +++ b/pkg/sentry/fs/ext/regular_file.go @@ -29,10 +29,7 @@ type fileReader interface { // // This reader is not meant to be retained across Read operations as it needs // to be reinitialized with the correct offset for every Read. - // - // Precondition: Must hold the mutex of the filesystem containing dev while - // using the Reader. - getFileReader(dev io.ReadSeeker, blkSize uint64, offset uint64) io.Reader + getFileReader(dev io.ReaderAt, blkSize uint64, offset uint64) io.Reader } // regularFile represents a regular file's inode. This too follows the @@ -48,9 +45,7 @@ type regularFile struct { // newRegularFile is the regularFile constructor. It figures out what kind of // file this is and initializes the fileReader. -// -// Preconditions: Must hold the mutex of the filesystem containing dev. -func newRegularFile(dev io.ReadSeeker, blkSize uint64, inode inode) (*regularFile, error) { +func newRegularFile(dev io.ReaderAt, blkSize uint64, inode inode) (*regularFile, error) { regFile := regularFile{ inode: inode, } |