diff options
author | Dean Deng <deandeng@google.com> | 2020-07-31 00:38:57 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-07-31 00:40:52 -0700 |
commit | 68a7da9549ac4f6290fe85d2dab550e11f16b209 (patch) | |
tree | 96ad7ee25d76ffbe4a9a3f21034ee051bc40d35e /pkg/sentry/vfs/file_description.go | |
parent | ad8164bb50dd01bfd59c9a6c72d9cbb0d4710f15 (diff) |
Clean up vfs2 fallocate.
Move to setstat.go and add a FileDescription wrapper method.
PiperOrigin-RevId: 324165277
Diffstat (limited to 'pkg/sentry/vfs/file_description.go')
-rw-r--r-- | pkg/sentry/vfs/file_description.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/sentry/vfs/file_description.go b/pkg/sentry/vfs/file_description.go index 0c42574db..93861fb4a 100644 --- a/pkg/sentry/vfs/file_description.go +++ b/pkg/sentry/vfs/file_description.go @@ -354,7 +354,7 @@ type FileDescriptionImpl interface { // represented by the FileDescription. StatFS(ctx context.Context) (linux.Statfs, error) - // Allocate grows file represented by FileDescription to offset + length bytes. + // Allocate grows the file to offset + length bytes. // Only mode == 0 is supported currently. Allocate(ctx context.Context, mode, offset, length uint64) error @@ -563,6 +563,11 @@ func (fd *FileDescription) StatFS(ctx context.Context) (linux.Statfs, error) { return fd.impl.StatFS(ctx) } +// Allocate grows file represented by FileDescription to offset + length bytes. +func (fd *FileDescription) Allocate(ctx context.Context, mode, offset, length uint64) error { + return fd.impl.Allocate(ctx, mode, offset, length) +} + // Readiness implements waiter.Waitable.Readiness. // // It returns fd's I/O readiness. |