Commit Graph

19 Commits

Author SHA1 Message Date
Ayush Ranjan 40d6d8c15b ext: StatAt unit tests.
PiperOrigin-RevId: 262249166
2019-08-07 17:21:00 -07:00
Ayush Ranjan 3b368cabf9 ext: Read unit tests.
PiperOrigin-RevId: 262242410
2019-08-07 16:44:10 -07:00
Ayush Ranjan ad67e5a7a0 ext: IterDirent unit tests.
PiperOrigin-RevId: 262226761
2019-08-07 15:24:33 -07:00
Ayush Ranjan 1c9781a4ed ext: vfs.FileDescriptionImpl and vfs.FilesystemImpl implementations.
- This also gets rid of pipes for now because pipe does not have vfs2 specific
  support yet.
- Added file path resolution logic.
- Fixes testing infrastructure.
- Does not include unit tests yet.

PiperOrigin-RevId: 262213950
2019-08-07 14:23:42 -07:00
Ayush Ranjan 5afa642deb ext: Migrate from using fileReader custom interface to using io.Reader.
It gets rid of holding state of the io.Reader offset (which is anyways held by
the vfs.FileDescriptor struct. It is also odd using a io.Reader becuase we
using io.ReaderAt to interact with the device. So making a io.ReaderAt wrapper
makes more sense.

Most importantly, it gets rid of the complexity of extracting the file reader
from a regular file implementation and then using it. Now we can just use the
regular file implementation as a reader which is more intuitive.

PiperOrigin-RevId: 260846927
2019-07-30 19:43:59 -07:00
Ayush Ranjan 9fbe984dc1 ext: block map file reader implementation.
Also adds stress tests for block map reader and intensifies extent reader tests.

PiperOrigin-RevId: 260838177
2019-07-30 18:20:31 -07:00
Ayush Ranjan 8da9f8a12c Migrate from using io.ReadSeeker to io.ReaderAt.
This provides the following benefits:
- We can now use pkg/fd package which does not take ownership
  of the file descriptor. So it does not close the fd when garbage collected.
  This reduces scope of errors from unexpected garbage collection of io.File.
- It enforces the offset parameter in every read call.
  It does not affect the fd offset nor is it affected by it. Hence reducing
  scope of error of using stale offsets when reading.
- We do not need to serialize the usage of any global file descriptor anymore.
  So this drops the mutual exclusion req hence reducing complexity and
  congestion.

PiperOrigin-RevId: 260635174
2019-07-29 20:12:37 -07:00
Ayush Ranjan ddf25e3331 ext: extent reader implementation.
PiperOrigin-RevId: 260629559
2019-07-29 19:17:27 -07:00
Ayush Ranjan b765eb4589 ext: inode implementations.
PiperOrigin-RevId: 260624470
2019-07-29 18:33:55 -07:00
Ayush Ranjan 8376757495 ext: filesystem boilerplate code.
PiperOrigin-RevId: 259865366
2019-07-24 19:08:21 -07:00
Ayush Ranjan 417096f781 ext: Add tests for root directory inode.
PiperOrigin-RevId: 259856442
2019-07-24 17:59:57 -07:00
Ayush Ranjan 2ed832ff86 ext: testing environment setup with VFS2 support.
PiperOrigin-RevId: 259835948
2019-07-24 16:03:30 -07:00
Ayush Ranjan 7e38d64333 ext: Inode creation logic.
PiperOrigin-RevId: 259666476
2019-07-23 20:36:04 -07:00
Ayush Ranjan d7bb79b6f1 ext: Add ext2 and ext3 tiny images.
PiperOrigin-RevId: 259657917
2019-07-23 19:01:05 -07:00
Ayush Ranjan bd7708956f ext: Added extent tree building logic.
PiperOrigin-RevId: 259628657
2019-07-23 15:51:50 -07:00
Ayush Ranjan 84a59de5dc ext: disklayout: extents support.
PiperOrigin-RevId: 258657776
2019-07-17 15:48:58 -07:00
Ayush Ranjan 8e3e021aca ext: Filesystem init implementation.
PiperOrigin-RevId: 258645957
2019-07-17 14:48:04 -07:00
Ayush Ranjan 2eeca68900 Added tiny ext4 image.
The image is of size 64Kb which supports 64 1k blocks
and 16 inodes. This is the smallest size mkfs.ext4 works with.

Added README.md documenting how this was created and included
all files on the device under assets.

PiperOrigin-RevId: 257712672
2019-07-11 17:17:47 -07:00
Ayush Ranjan 5242face2e ext: boilerplate code.
Renamed ext4 to ext since we are targeting ext(2/3/4).
Removed fs.go since we are targeting VFS2.
Added ext.go with filesystem struct.

PiperOrigin-RevId: 257689775
2019-07-11 15:05:36 -07:00