search for: get_sector_size

Displaying 3 results from an estimated 3 matches for "get_sector_size".

2012 Aug 02
0
[PATCH 2/3] ALPHA: first try to fix adv problem
...x/main.c b/extlinux/main.c index e40b4d7..61eaad1 100644 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -275,7 +275,8 @@ static int patch_file_and_bootblock(int fd, const char *dir, int devfd) dprintf("subpath = %s\n", subpath); totalbytes = get_size(devfd); - sector_size = get_sector_size(devfd); + /* FIXME support greater sector sizes for BTRFS */ + sector_size = fs_type == BTRFS ? SECTOR_SIZE : get_sector_size(devfd); get_geometry(devfd, totalbytes, sector_size, &geo); if (opt.heads) @@ -318,6 +319,7 @@ static int patch_file_and_bootblock(int fd, const char *...
2012 Aug 02
0
[PATCH 1/3] ALPHA: make sector size dynamic in extlinux
...patch_sectors = (i + SECTOR_SIZE - 1) >> SECTOR_SHIFT; /* diff --git a/extlinux/main.c b/extlinux/main.c index f0d8e11..e40b4d7 100644 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -95,6 +95,18 @@ static uint64_t get_size(int devfd) } /* + * Get sector size + */ +static unsigned get_sector_size(int devfd) +{ + int size; + + if (!ioctl(devfd, BLKSSZGET, &size)) + return size; + return SECTOR_SIZE; +} + +/* * Get device geometry and partition offset */ struct geometry_table { @@ -145,7 +157,7 @@ static const struct geometry_table standard_geometries[] = { {0, {0, 0, 0...
2012 Sep 10
19
Initial support for sector size >512
This set of patches add some support for sector size >512. Currently it fixes extlinux, MBR for GPT and ext partitions. Other code is unaffected. This set of patches has been tested on a read Dell machine running a beta firmware.