diff options
author | Ayush Ranjan <ayushranjan@google.com> | 2019-07-23 20:34:49 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-07-23 20:36:04 -0700 |
commit | 7e38d643334647fb79c7cc8be35745699de264e6 (patch) | |
tree | f6470d9f953dc7274ee98f1af62736a7493ef68c /pkg/sentry/fs/ext/disklayout | |
parent | d7bb79b6f177e8c58d47695e0ee1a072475463c4 (diff) |
ext: Inode creation logic.
PiperOrigin-RevId: 259666476
Diffstat (limited to 'pkg/sentry/fs/ext/disklayout')
-rw-r--r-- | pkg/sentry/fs/ext/disklayout/inode_new.go | 2 | ||||
-rw-r--r-- | pkg/sentry/fs/ext/disklayout/inode_old.go | 6 | ||||
-rw-r--r-- | pkg/sentry/fs/ext/disklayout/inode_test.go | 2 | ||||
-rw-r--r-- | pkg/sentry/fs/ext/disklayout/superblock_old.go | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/pkg/sentry/fs/ext/disklayout/inode_new.go b/pkg/sentry/fs/ext/disklayout/inode_new.go index 4f5348372..8f9f574ce 100644 --- a/pkg/sentry/fs/ext/disklayout/inode_new.go +++ b/pkg/sentry/fs/ext/disklayout/inode_new.go @@ -62,7 +62,7 @@ func (in *InodeNew) Size() uint64 { // InodeSize implements Inode.InodeSize. func (in *InodeNew) InodeSize() uint16 { - return oldInodeSize + in.ExtraInodeSize + return OldInodeSize + in.ExtraInodeSize } // ChangeTime implements Inode.ChangeTime. diff --git a/pkg/sentry/fs/ext/disklayout/inode_old.go b/pkg/sentry/fs/ext/disklayout/inode_old.go index 7d7cc9143..db25b11b6 100644 --- a/pkg/sentry/fs/ext/disklayout/inode_old.go +++ b/pkg/sentry/fs/ext/disklayout/inode_old.go @@ -21,8 +21,8 @@ import ( ) const ( - // oldInodeSize is the inode size in ext2/ext3. - oldInodeSize = 128 + // OldInodeSize is the inode size in ext2/ext3. + OldInodeSize = 128 ) // InodeOld implements Inode interface. It emulates ext2/ext3 inode struct. @@ -85,7 +85,7 @@ func (in *InodeOld) Size() uint64 { } // InodeSize implements Inode.InodeSize. -func (in *InodeOld) InodeSize() uint16 { return oldInodeSize } +func (in *InodeOld) InodeSize() uint16 { return OldInodeSize } // AccessTime implements Inode.AccessTime. func (in *InodeOld) AccessTime() time.Time { diff --git a/pkg/sentry/fs/ext/disklayout/inode_test.go b/pkg/sentry/fs/ext/disklayout/inode_test.go index 9cae9e4f0..dd03ee50e 100644 --- a/pkg/sentry/fs/ext/disklayout/inode_test.go +++ b/pkg/sentry/fs/ext/disklayout/inode_test.go @@ -24,7 +24,7 @@ import ( // TestInodeSize tests that the inode structs are of the correct size. func TestInodeSize(t *testing.T) { - assertSize(t, InodeOld{}, oldInodeSize) + assertSize(t, InodeOld{}, OldInodeSize) // This was updated from 156 bytes to 160 bytes in Oct 2015. assertSize(t, InodeNew{}, 160) diff --git a/pkg/sentry/fs/ext/disklayout/superblock_old.go b/pkg/sentry/fs/ext/disklayout/superblock_old.go index aada8b550..5a64aaaa1 100644 --- a/pkg/sentry/fs/ext/disklayout/superblock_old.go +++ b/pkg/sentry/fs/ext/disklayout/superblock_old.go @@ -81,7 +81,7 @@ func (sb *SuperBlockOld) ClusterSize() uint64 { return 1 << (10 + sb.LogClusterS func (sb *SuperBlockOld) ClustersPerGroup() uint32 { return sb.ClustersPerGroupRaw } // InodeSize implements SuperBlock.InodeSize. -func (sb *SuperBlockOld) InodeSize() uint16 { return oldInodeSize } +func (sb *SuperBlockOld) InodeSize() uint16 { return OldInodeSize } // InodesPerGroup implements SuperBlock.InodesPerGroup. func (sb *SuperBlockOld) InodesPerGroup() uint32 { return sb.InodesPerGroupRaw } |