Displaying 20 results from an estimated 189 matches for "sector_size".
2012 Aug 02
0
[PATCH 1/3] ALPHA: make sector size dynamic in extlinux
...+723,7 @@ int main(int argc, char *argv[])
/*
* Patch ldlinux.sys and the boot sector
*/
- i = syslinux_patch(sectors, nsectors, opt.stupid_mode, opt.raid_mode, opt.directory, NULL);
+ i = syslinux_patch(sectors, nsectors, opt.stupid_mode, opt.raid_mode, opt.directory, NULL, SECTOR_SIZE);
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 uns...
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.
2013 May 13
22
[PATCH] xen-blk(front|back): Handle large physical sector disks
...rr == -EAGAIN)
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index d89ef86..60ec315 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -542,7 +542,8 @@ wait:
flush_requests(info);
}
-static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size)
+static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size,
+ unsigned int physical_sector_size)
{
struct request_queue *rq;
struct blkfront_info *info = gd->private_data;
@@ -564,6 +565,7 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16
sector_size)
/* Hard secto...
2012 Aug 02
0
[PATCH 2/3] ALPHA: first try to fix adv problem
...-git a/extlinux/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(in...
2019 Jan 21
0
[PATCH nbdkit v2 2/4] partition filter: Support MBR logical partitions.
...truct mbr_partition {
uint8_t part_type_byte;
uint32_t start_sector;
@@ -69,16 +75,16 @@ find_mbr_partition (struct nbdkit_next_ops *next_ops, void *nxdata,
{
int i;
struct mbr_partition partition;
+ uint32_t ep_start_sector, ep_nr_sectors;
+ uint64_t ebr, next_ebr;
+ uint8_t sector[SECTOR_SIZE];
- if (partnum > 4) {
- nbdkit_error ("MBR logical partitions are not supported");
- return -1;
- }
-
+ /* Primary partition. */
for (i = 0; i < 4; ++i) {
get_mbr_partition (mbr, i, &partition);
if (partition.nr_sectors > 0 &&
partiti...
2018 Aug 02
2
Re: [PATCH 3/3] file: Zero for block devices on old kernels
...Will this pick up BLKZEROOUT in all cases where it is needed? Or do we
need to relax the !defined(FALLOC_FL_PUNCH_HOLE), and just blindly
include both of these headers for all Linux compilations?
> +static bool
> +is_aligned(struct handle *h, uint64_t n)
> +{
> + return n % h->sector_size == 0;
Since we know (but the compiler doesn't) that sector_size is a power of
2, it is slightly faster to use bitwise math:
return !(n & (h->sector_size - 1))
> +#ifdef BLKSSZGET
> + if (h->is_block_device) {
> + if (ioctl (h->fd, BLKSSZGET, &h->sector_size...
2012 Aug 02
0
[PATCH 3/3] ALPHA: implement and use rdwr_bytes
...id *buf,
+ bytes_t lba, size_t count, bool is_write)
+{
+ int done, res;
+ unsigned mask, before, len;
+ unsigned shift = disk->sector_shift;
+
+ dprintf("called rdwr_bytes from %llu for %u bytes\n", (unsigned long long) lba, (unsigned) count);
+
+ mask = disk->sector_size - 1;
+
+ /* aligned, fix count/lba */
+ if (((lba|count) & mask) == 0) {
+ return (rdwr_sectors0(buf, lba >> shift, count >> shift, is_write) << shift);
+ }
+
+ /* do the hard work */
+ done = 0;
+ if ((lba & mask) != 0) {
+ /* align start sector */
+ bef...
2019 Jan 22
2
Re: [PATCH nbdkit v2 2/4] partition filter: Support MBR logical partitions.
...1 insertions(+), 11 deletions(-)
>
> @@ -69,16 +75,16 @@ find_mbr_partition (struct nbdkit_next_ops *next_ops, void *nxdata,
> {
> int i;
> struct mbr_partition partition;
> + uint32_t ep_start_sector, ep_nr_sectors;
> + uint64_t ebr, next_ebr;
> + uint8_t sector[SECTOR_SIZE];
>
> - if (partnum > 4) {
> - nbdkit_error ("MBR logical partitions are not supported");
> - return -1;
> - }
> -
> + /* Primary partition. */
> for (i = 0; i < 4; ++i) {
> get_mbr_partition (mbr, i, &partition);
> if (parti...
2020 Jul 21
0
[PATCH 09/10] block: scsi: sd: use blk_is_valid_logical_block_size
...d90fefffe31b7..f012e7397b058 100644
> > --- a/drivers/scsi/sd.c
> > +++ b/drivers/scsi/sd.c
> > @@ -2520,10 +2520,7 @@ sd_read_capacity(struct scsi_disk *sdkp,
> > unsigned char *buffer)
> > "assuming 512.\n");
> > }
> >
> > - if (sector_size != 512 &&
> > - sector_size != 1024 &&
> > - sector_size != 2048 &&
> > - sector_size != 4096) {
> > + if (!blk_is_valid_logical_block_size(sector_size)) {
> > sd_printk(KERN_NOTICE, sdkp, "Unsupported sector size
> > %...
2009 Jan 06
1
[PATCH] ocfs2: Add statistics for the checksum and ecc operations.
...osb);
static int ocfs2_verify_volume(struct ocfs2_dinode *di,
struct buffer_head *bh,
- u32 sectsize);
+ u32 sectsize,
+ struct ocfs2_blockcheck_stats *stats);
static int ocfs2_initialize_super(struct super_block *sb,
struct buffer_head *bh,
- int sector_size);
+ int sector_size,
+ struct ocfs2_blockcheck_stats *stats);
static int ocfs2_get_sector(struct super_block *sb,
struct buffer_head **bh,
int block,
@@ -539,7 +541,8 @@ out:
static int ocfs2_sb_probe(struct super_block *sb,
struct buffer_head **bh,
- int *se...
2018 Aug 02
0
Re: [PATCH 3/3] file: Zero for block devices on old kernels
...defined(FALLOC_FL_PUNCH_HOLE), and just blindly
> include both of these headers for all Linux compilations?
>
It works on RHEL 7.5, but it should not depend on FALLOC_FL_*.
> > +static bool
> > +is_aligned(struct handle *h, uint64_t n)
> > +{
> > + return n % h->sector_size == 0;
>
> Since we know (but the compiler doesn't) that sector_size is a power of
> 2, it is slightly faster to use bitwise math:
> return !(n & (h->sector_size - 1))
>
Right
>
> > +#ifdef BLKSSZGET
> > + if (h->is_block_device) {
> > + if...
2009 Apr 30
0
[PATCH] ocfs2: Add statistics for the checksum and ecc operations.
...osb);
static int ocfs2_verify_volume(struct ocfs2_dinode *di,
struct buffer_head *bh,
- u32 sectsize);
+ u32 sectsize,
+ struct ocfs2_blockcheck_stats *stats);
static int ocfs2_initialize_super(struct super_block *sb,
struct buffer_head *bh,
- int sector_size);
+ int sector_size,
+ struct ocfs2_blockcheck_stats *stats);
static int ocfs2_get_sector(struct super_block *sb,
struct buffer_head **bh,
int block,
@@ -703,7 +705,8 @@ out:
static int ocfs2_sb_probe(struct super_block *sb,
struct buffer_head **bh,
- int *se...
2019 Jan 21
8
[PATCH nbdkit v2 0/4] Support MBR logical partitions.
This is a revised version of the two series previously posted here:
https://www.redhat.com/archives/libguestfs/2019-January/msg00137.html
https://www.redhat.com/archives/libguestfs/2019-January/msg00139.html
There have been many smaller changes but the highlights are:
- Using SECTOR_SIZE instead of hard-coding 512 everywhere.
- Additional safety checks that the EBR chain doesn't
jump outside the disk.
- The better test now writes different random data into each
partition rather than the same string.
- I pushed the pure refactoring changes.
Rich.
2018 Sep 17
0
[PATCH nbdkit v3 3/3] Add partitioning plugin.
...plugin.h>
+
+#include "byte-swapping.h"
+#include "isaligned.h"
+#include "iszero.h"
+#include "rounding.h"
+
+#include "crc32.h"
+
+/* Debug flag: -D partitioning.regions=1: Print the regions table. */
+int partitioning_debug_regions;
+
+#define SECTOR_SIZE UINT64_C(512)
+
+/* Maximum size of MBR disks. This is an approximation based on the
+ * known limit (2^32 sectors) and an estimate based on the amount of
+ * padding between partitions.
+ */
+#define MAX_MBR_DISK_SIZE (UINT32_MAX * SECTOR_SIZE - 5 * ALIGNMENT)
+
+#define GPT_PT_ENTRY_SIZE 128
+
+...
2013 Oct 18
1
[RFC/PATCH 2/3] core: MultiFS infrastructure added.
...{
- static struct disk disk;
+ struct disk *disk;
struct bios_disk_private *priv = (struct bios_disk_private *)private;
com32sys_t *regs = priv->regs;
static __lowmem struct edd_disk_params edd_params;
@@ -302,6 +302,10 @@ struct disk *bios_disk_init(void *private)
int sector_size;
unsigned int hard_max_transfer;
+ disk = malloc(sizeof(struct disk));
+ if (!disk)
+ return NULL;
+
memset(&ireg, 0, sizeof ireg);
ireg.edx.b[0] = devno;
@@ -319,18 +323,18 @@ struct disk *bios_disk_init(void *private)
hard_max_transfer = 63;
/* CBIOS paramet...
2011 Sep 01
9
[PATCH V4 0/3] xen-blkfront/blkback discard support
Dear list,
This is the V4 of the trim support for xen-blkfront/blkback,
Now we move BLKIF_OP_TRIM to BLKIF_OP_DISCARD, and dropped all
"trim" stuffs in the patches, and use "discard" instead.
Also we updated the helpers of blkif_x86_{32|64}_request or we
will meet problems using a non-native protocol.
And this patch has been tested with both SSD and raw file,
with SSD we will
2020 Apr 15
0
[PATCH nbdkit 4/9] common/regions: Use new vector type to store the list of regions.
...14 100644
--- a/plugins/partitioning/partition-gpt.c
+++ b/plugins/partitioning/partition-gpt.c
@@ -88,7 +88,7 @@ create_gpt_partition_header (const void *pt, bool is_primary,
uint64_t nr_lbas;
struct gpt_header *header = (struct gpt_header *) out;
- nr_lbas = virtual_size (®ions) / SECTOR_SIZE;
+ nr_lbas = virtual_size (&the_regions) / SECTOR_SIZE;
memset (header, 0, sizeof *header);
memcpy (header->signature, GPT_SIGNATURE, sizeof (header->signature));
@@ -122,8 +122,8 @@ create_gpt_partition_table (unsigned char *out)
{
size_t i, j;
- for (j = 0; j < nr_reg...
2009 Mar 31
1
[PATCH 1/1] CORE/cache: add cache priority parameter
...ax,ax ; Clear ZF
sub si,CachePtrs+cptr_size
shl si,SECTOR_SHIFT-cptr_size_lg2 ; Buffer address
diff --git a/core/extlinux.asm b/core/extlinux.asm
index 9684c8a..59d460d 100644
--- a/core/extlinux.asm
+++ b/core/extlinux.asm
@@ -966,7 +966,10 @@ open_inode:
add eax,edx
pop edx
and dx,SECTOR_SIZE-1
+ push dx
+ mov dx,1
call getcachesector ; Get the group descriptor
+ pop dx
add si,dx
mov esi,[gs:si+bg_inode_table] ; Get inode table block #
pop eax ; Get inode within group
@@ -985,7 +988,10 @@ open_inode:
and dx,SECTOR_SIZE-1
mov [bx+file_in_off],dx
+ push dx
+ mo...
2018 Sep 17
4
[PATCH nbdkit 0/3] Add partitioning plugin.
nbdkit partitioning boot.img swap.img root.img
... creates a virtual disk by adding a partition table.
In ancient times Xen used to do this.
Rich.
2018 Sep 17
7
[PATCH nbdkit v3 0/3] Add partitioning plugin.
The partitioning plugin patch is the same (except for rebasing).
However I have changed the first two patches based on feedback
received. In particular this fixes a very serious bug found by Eric
Blake in the current truncate filter.
Rich.