summaryrefslogtreecommitdiff
path: root/blockdev/linux
diff options
context:
space:
mode:
authorgkostka <kostka.grzegorz@gmail.com>2015-12-08 20:06:41 +0100
committergkostka <kostka.grzegorz@gmail.com>2015-12-08 20:14:33 +0100
commite69f4b3ad8c1b56035b669e10072054ae2939695 (patch)
treee402cfaffd18d21e0e7a521c73394257a3dc513a /blockdev/linux
parentc3b3f743175a5827feacaa37bbc5443adc2c359b (diff)
ext4_mbr: multiple changes related to MBR parsing
1. Introduce part_offset & part_size fields in blockdev 2. Blockdev operations with part_offset 3. Blockdev operations check based on part_size 4. lwext4_mbr tool: scan master boot record for linux partitions 5. Set right partition sizes in linux/windows file blockdevs
Diffstat (limited to 'blockdev/linux')
-rw-r--r--blockdev/linux/ext4_filedev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/blockdev/linux/ext4_filedev.c b/blockdev/linux/ext4_filedev.c
index 2db87e3..a49e6e7 100644
--- a/blockdev/linux/ext4_filedev.c
+++ b/blockdev/linux/ext4_filedev.c
@@ -74,7 +74,9 @@ static int filedev_open(struct ext4_blockdev *bdev)
if (fseeko(dev_file, 0, SEEK_END))
return EFAULT;
- _filedev.bdif->ph_bcnt = ftell(dev_file) / _filedev.bdif->ph_bsize;
+ _filedev.part_offset = 0;
+ _filedev.part_size = ftell(dev_file);
+ _filedev.bdif->ph_bcnt = _filedev.part_size / _filedev.bdif->ph_bsize;
return EOK;
}