diff options
author | Ayush Ranjan <ayushranjan@google.com> | 2020-09-30 12:37:17 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-09-30 12:39:25 -0700 |
commit | 3e450a991b844a6b45fc57e59bfb0030ba0d0f4c (patch) | |
tree | 1f49f4d58a3fc190b5b8d0291588470cf3d76b6e /pkg/sentry/fsimpl/ext/extent_file.go | |
parent | b49a17fc3d33068a1235d97efd8cc8bc9f0f3ccf (diff) |
[go-marshal] Port ext codebase to use go marshal.
PiperOrigin-RevId: 334656292
Diffstat (limited to 'pkg/sentry/fsimpl/ext/extent_file.go')
-rw-r--r-- | pkg/sentry/fsimpl/ext/extent_file.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/sentry/fsimpl/ext/extent_file.go b/pkg/sentry/fsimpl/ext/extent_file.go index 04917d762..778460107 100644 --- a/pkg/sentry/fsimpl/ext/extent_file.go +++ b/pkg/sentry/fsimpl/ext/extent_file.go @@ -18,7 +18,6 @@ import ( "io" "sort" - "gvisor.dev/gvisor/pkg/binary" "gvisor.dev/gvisor/pkg/sentry/fsimpl/ext/disklayout" "gvisor.dev/gvisor/pkg/syserror" ) @@ -60,7 +59,7 @@ func newExtentFile(args inodeArgs) (*extentFile, error) { func (f *extentFile) buildExtTree() error { rootNodeData := f.regFile.inode.diskInode.Data() - binary.Unmarshal(rootNodeData[:disklayout.ExtentHeaderSize], binary.LittleEndian, &f.root.Header) + f.root.Header.UnmarshalBytes(rootNodeData[:disklayout.ExtentHeaderSize]) // Root node can not have more than 4 entries: 60 bytes = 1 header + 4 entries. if f.root.Header.NumEntries > 4 { @@ -79,7 +78,7 @@ func (f *extentFile) buildExtTree() error { // Internal node. curEntry = &disklayout.ExtentIdx{} } - binary.Unmarshal(rootNodeData[off:off+disklayout.ExtentEntrySize], binary.LittleEndian, curEntry) + curEntry.UnmarshalBytes(rootNodeData[off : off+disklayout.ExtentEntrySize]) f.root.Entries[i].Entry = curEntry } |