Displaying 20 results from an estimated 98 matches for "blk_size".
2020 Jul 15
3
[PATCH] virtio-blk: check host supplied logical block size
...blksize >= 512 && blksize <= PAGE_SIZE && is_power_of_2(blksize);
+}
+
static int virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
@@ -809,9 +815,16 @@ static int virtblk_probe(struct virtio_device *vdev)
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
struct virtio_blk_config, blk_size,
&blk_size);
- if (!err)
+ if (!err) {
+ if (!virtblk_valid_block_size(blk_size)) {
+ dev_err(&vdev->dev,
+ "%s failure: unsupported logical block size %d\n",
+ __func__, blk_size);
+ err = -EINVAL;
+ goto out_cle...
2020 Jul 15
3
[PATCH] virtio-blk: check host supplied logical block size
...blksize >= 512 && blksize <= PAGE_SIZE && is_power_of_2(blksize);
+}
+
static int virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
@@ -809,9 +815,16 @@ static int virtblk_probe(struct virtio_device *vdev)
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
struct virtio_blk_config, blk_size,
&blk_size);
- if (!err)
+ if (!err) {
+ if (!virtblk_valid_block_size(blk_size)) {
+ dev_err(&vdev->dev,
+ "%s failure: unsupported logical block size %d\n",
+ __func__, blk_size);
+ err = -EINVAL;
+ goto out_cle...
2020 Jul 15
2
[PATCH] virtio-blk: check host supplied logical block size
...d to create
too much mess.
>
> > static int virtblk_probe(struct virtio_device *vdev)
> > {
> > struct virtio_blk *vblk;
> > @@ -809,9 +815,16 @@ static int virtblk_probe(struct virtio_device
> > *vdev)
> > err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
> > struct virtio_blk_config, blk_size,
> > &blk_size);
> > - if (!err)
> > + if (!err) {
> > + if (!virtblk_valid_block_size(blk_size)) {
> > + dev_err(&vdev->dev,
> > + "%s failure: unsupported logical block
> >...
2020 Jul 15
2
[PATCH] virtio-blk: check host supplied logical block size
...d to create
too much mess.
>
> > static int virtblk_probe(struct virtio_device *vdev)
> > {
> > struct virtio_blk *vblk;
> > @@ -809,9 +815,16 @@ static int virtblk_probe(struct virtio_device
> > *vdev)
> > err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
> > struct virtio_blk_config, blk_size,
> > &blk_size);
> > - if (!err)
> > + if (!err) {
> > + if (!virtblk_valid_block_size(blk_size)) {
> > + dev_err(&vdev->dev,
> > + "%s failure: unsupported logical block
> >...
2020 Jul 15
0
[PATCH] virtio-blk: check host supplied logical block size
...lk core assumption? in that case, does not this belong
in blk core?
> static int virtblk_probe(struct virtio_device *vdev)
> {
> struct virtio_blk *vblk;
> @@ -809,9 +815,16 @@ static int virtblk_probe(struct virtio_device *vdev)
> err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
> struct virtio_blk_config, blk_size,
> &blk_size);
> - if (!err)
> + if (!err) {
> + if (!virtblk_valid_block_size(blk_size)) {
> + dev_err(&vdev->dev,
> + "%s failure: unsupported logical block size %d\n",
> + __func__, blk_si...
2020 Jul 15
0
[PATCH] virtio-blk: check host supplied logical block size
...t;
> > > static int virtblk_probe(struct virtio_device *vdev)
> > > {
> > > struct virtio_blk *vblk;
> > > @@ -809,9 +815,16 @@ static int virtblk_probe(struct virtio_device
> > > *vdev)
> > > err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
> > > struct virtio_blk_config, blk_size,
> > > &blk_size);
> > > - if (!err)
> > > + if (!err) {
> > > + if (!virtblk_valid_block_size(blk_size)) {
> > > + dev_err(&vdev->dev,
> > > + "%s failure:...
2020 Jul 21
0
[PATCH 02/10] block: virtio-blk: check logical block size
...diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 980df853ee497..b5ee87cba00ed 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -809,10 +809,18 @@ static int virtblk_probe(struct virtio_device *vdev)
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
struct virtio_blk_config, blk_size,
&blk_size);
- if (!err)
+ if (!err) {
+ if (!blk_is_valid_logical_block_size(blk_size)) {
+ dev_err(&vdev->dev,
+ "%s failure: invalid logical block size %d\n",
+ __func__, blk_size);
+ err = -EINVAL;
+ goto out_...
2017 Mar 28
6
[PATCH] virtio-blk: add DISCARD support to virtio-blk driver
...else
+ vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev,
+ VIRTIO_BLK_T_IN);
+ }
}
spin_lock_irqsave(&vblk->vqs[qid].lock, flags);
@@ -775,6 +786,15 @@ static int virtblk_probe(struct virtio_device *vdev)
if (!err && opt_io_size)
blk_queue_io_opt(q, blk_size * opt_io_size);
+ if (virtio_has_feature(vdev, VIRTIO_BLK_F_DISCARD)) {
+ q->limits.discard_zeroes_data = 0;
+ q->limits.discard_alignment = blk_size;
+ q->limits.discard_granularity = blk_size;
+ blk_queue_max_discard_sectors(q, UINT_MAX);
+ blk_queue_max_discard_segments(q, 1);
+...
2017 Mar 28
6
[PATCH] virtio-blk: add DISCARD support to virtio-blk driver
...else
+ vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev,
+ VIRTIO_BLK_T_IN);
+ }
}
spin_lock_irqsave(&vblk->vqs[qid].lock, flags);
@@ -775,6 +786,15 @@ static int virtblk_probe(struct virtio_device *vdev)
if (!err && opt_io_size)
blk_queue_io_opt(q, blk_size * opt_io_size);
+ if (virtio_has_feature(vdev, VIRTIO_BLK_F_DISCARD)) {
+ q->limits.discard_zeroes_data = 0;
+ q->limits.discard_alignment = blk_size;
+ q->limits.discard_granularity = blk_size;
+ blk_queue_max_discard_sectors(q, UINT_MAX);
+ blk_queue_max_discard_segments(q, 1);
+...
2015 Mar 13
0
[PATCH] sd, mmc, virtio_blk, string_helpers: fix block size units
...x/string_helpers.h
> +++ b/include/linux/string_helpers.h
> @@ -10,7 +10,7 @@ enum string_size_units {
> STRING_UNITS_2, /* use binary powers of 2^10 */
> };
>
> -void string_get_size(u64 size, enum string_size_units units,
> +void string_get_size(u64 size, u64 blk_size, enum string_size_units units,
> char *buf, int len);
>
> #define UNESCAPE_SPACE 0x01
> diff --git a/lib/string_helpers.c b/lib/string_helpers.c
> index 8f8c441..6ac8d5a 100644
> --- a/lib/string_helpers.c
> +++ b/lib/string_helpers.c
> @@ -4,6...
2015 Mar 13
0
[PATCH] sd, mmc, virtio_blk, string_helpers: fix block size units
...x/string_helpers.h
> +++ b/include/linux/string_helpers.h
> @@ -10,7 +10,7 @@ enum string_size_units {
> STRING_UNITS_2, /* use binary powers of 2^10 */
> };
>
> -void string_get_size(u64 size, enum string_size_units units,
> +void string_get_size(u64 size, u64 blk_size, enum string_size_units units,
> char *buf, int len);
>
> #define UNESCAPE_SPACE 0x01
> diff --git a/lib/string_helpers.c b/lib/string_helpers.c
> index 8f8c441..6ac8d5a 100644
> --- a/lib/string_helpers.c
> +++ b/lib/string_helpers.c
> @@ -4,6...
2008 May 27
1
[PATCH/RFC] virtio_blk: check for hardsector size from host
...s(+), 1 deletion(-)
Index: kvm/drivers/block/virtio_blk.c
===================================================================
--- kvm.orig/drivers/block/virtio_blk.c
+++ kvm/drivers/block/virtio_blk.c
@@ -196,6 +196,7 @@ static int virtblk_probe(struct virtio_d
int err;
u64 cap;
u32 v;
+ u64 blk_size;
if (index_to_minor(index) >= 1 << MINORBITS)
return -ENOSPC;
@@ -290,6 +291,13 @@ static int virtblk_probe(struct virtio_d
if (!err)
blk_queue_max_hw_segments(vblk->disk->queue, v);
+ /* Host can optionally specify the block size of the device */
+ err = virtio_config_...
2008 May 27
1
[PATCH/RFC] virtio_blk: check for hardsector size from host
...s(+), 1 deletion(-)
Index: kvm/drivers/block/virtio_blk.c
===================================================================
--- kvm.orig/drivers/block/virtio_blk.c
+++ kvm/drivers/block/virtio_blk.c
@@ -196,6 +196,7 @@ static int virtblk_probe(struct virtio_d
int err;
u64 cap;
u32 v;
+ u64 blk_size;
if (index_to_minor(index) >= 1 << MINORBITS)
return -ENOSPC;
@@ -290,6 +291,13 @@ static int virtblk_probe(struct virtio_d
if (!err)
blk_queue_max_hw_segments(vblk->disk->queue, v);
+ /* Host can optionally specify the block size of the device */
+ err = virtio_config_...
2020 Jul 21
2
[PATCH 02/10] block: virtio-blk: check logical block size
...k/virtio_blk.c b/drivers/block/virtio_blk.c
> index 980df853ee497..b5ee87cba00ed 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -809,10 +809,18 @@ static int virtblk_probe(struct virtio_device *vdev)
> err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
> struct virtio_blk_config, blk_size,
> &blk_size);
> - if (!err)
> + if (!err) {
> + if (!blk_is_valid_logical_block_size(blk_size)) {
> + dev_err(&vdev->dev,
> + "%s failure: invalid logical block size %d\n",
> + __func__, blk...
2020 Jul 21
2
[PATCH 02/10] block: virtio-blk: check logical block size
...k/virtio_blk.c b/drivers/block/virtio_blk.c
> index 980df853ee497..b5ee87cba00ed 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -809,10 +809,18 @@ static int virtblk_probe(struct virtio_device *vdev)
> err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
> struct virtio_blk_config, blk_size,
> &blk_size);
> - if (!err)
> + if (!err) {
> + if (!blk_is_valid_logical_block_size(blk_size)) {
> + dev_err(&vdev->dev,
> + "%s failure: invalid logical block size %d\n",
> + __func__, blk...
2017 Mar 28
1
[PATCH] virtio-blk: add DISCARD support to virtio-blk driver
...; > +
> VIRTIO_BLK_T_IN);
> > + }
> > }
> >
> > spin_lock_irqsave(&vblk->vqs[qid].lock, flags);
> > @@ -775,6 +786,15 @@ static int virtblk_probe(struct virtio_device *vdev)
> > if (!err && opt_io_size)
> > blk_queue_io_opt(q, blk_size * opt_io_size);
> >
> > + if (virtio_has_feature(vdev, VIRTIO_BLK_F_DISCARD)) {
> > + q->limits.discard_zeroes_data = 0;
> > + q->limits.discard_alignment = blk_size;
> > + q->limits.discard_granularity = blk_size;
> > + blk_queue_max_discard_sectors...
2017 Mar 28
1
[PATCH] virtio-blk: add DISCARD support to virtio-blk driver
...; > +
> VIRTIO_BLK_T_IN);
> > + }
> > }
> >
> > spin_lock_irqsave(&vblk->vqs[qid].lock, flags);
> > @@ -775,6 +786,15 @@ static int virtblk_probe(struct virtio_device *vdev)
> > if (!err && opt_io_size)
> > blk_queue_io_opt(q, blk_size * opt_io_size);
> >
> > + if (virtio_has_feature(vdev, VIRTIO_BLK_F_DISCARD)) {
> > + q->limits.discard_zeroes_data = 0;
> > + q->limits.discard_alignment = blk_size;
> > + q->limits.discard_granularity = blk_size;
> > + blk_queue_max_discard_sectors...
2006 Apr 14
0
Quota again
...-maildir is at least better...)
Best regards,
Stian
--- quota-fs.c.old 2006-04-14 22:46:17.000000000 +0200
+++ quota-fs.c 2006-04-14 13:55:26.000000000 +0200
@@ -285,9 +285,9 @@
}
#endif
*value_r = (uint64_t)dqblk.dqb_curblocks *
- (uint64_t)root->mount->blk_size / 1024;
+ (uint64_t)root->mount->blk_size / 1024 / 4096;
*limit_r = (uint64_t)dqblk.dqb_bsoftlimit *
- (uint64_t)root->mount->blk_size / 1024;
+ (uint64_t)root->mount->blk_size / 1024 / 4;
return 1;
}
--- quota-maildir.c....
2011 Jun 01
6
[PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index
...@@ struct virtio_blk
/* The disk structure for the kernel. */
struct gendisk *disk;
+ u32 index;
/* Request tracking. */
struct list_head reqs;
@@ -343,12 +348,26 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
struct request_queue *q;
int err;
u64 cap;
- u32 v, blk_size, sg_elems, opt_io_size;
+ u32 v, blk_size, sg_elems, opt_io_size, index;
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
- if (index_to_minor(index) >= 1 << MINORBITS)
- return -ENOSPC;
+ do {
+ if (!ida_pre_get(&vd_index_ida, GFP_KERNEL))
+ return err;
+
+ spin_lo...
2011 Jun 01
6
[PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index
...@@ struct virtio_blk
/* The disk structure for the kernel. */
struct gendisk *disk;
+ u32 index;
/* Request tracking. */
struct list_head reqs;
@@ -343,12 +348,26 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
struct request_queue *q;
int err;
u64 cap;
- u32 v, blk_size, sg_elems, opt_io_size;
+ u32 v, blk_size, sg_elems, opt_io_size, index;
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
- if (index_to_minor(index) >= 1 << MINORBITS)
- return -ENOSPC;
+ do {
+ if (!ida_pre_get(&vd_index_ida, GFP_KERNEL))
+ return err;
+
+ spin_lo...