From: Christoph Hellwig <hch@lst.de> Date: 2021-08-04 09:59:07
Hi Jens,
this series adds a bvec_virt helper to return the virtual address of the
data in bvec to replace the open coded calculation, and as a reminder
that generall bio/bvec data can be in high memory unless it is caller
controller or in an architecture specific driver where highmem is
impossible.
From: Christoph Hellwig <hch@lst.de> Date: 2021-08-04 09:59:43
Add a helper to get the virtual address for a bvec. This avoids that
all callers need to know about the page + offset representation.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
include/linux/bvec.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
From: Christoph Hellwig <hch@lst.de> Date: 2021-08-04 10:00:34
Use the bvec_virt helper to clean up the bio integrity processing a
little bit.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/bio-integrity.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
From: Christoph Hellwig <hch@lst.de> Date: 2021-08-04 10:01:50
__ebs_rw_bvec use page_address on the submitted bios data, and thus
can't deal with highmem. Disable the target on highmem configs.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/md/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Christoph Hellwig <hch@lst.de> Date: 2021-08-04 10:01:59
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/md/dm-ebs-target.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Christoph Hellwig <hch@lst.de> Date: 2021-08-04 10:03:01
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/md/dm-integrity.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -49,8 +49,7 @@ static int copy_bio_to_actor(struct bio *bio,bytes_to_copy=min_t(int,bytes_to_copy,req_length-copied_bytes);-memcpy(actor_addr+actor_offset,-page_address(bvec->bv_page)+bvec->bv_offset+offset,+memcpy(actor_addr+actor_offset,bvec_virt(bvec)+offset,bytes_to_copy);actor_offset+=bytes_to_copy;
@@ -177,7 +176,7 @@ int squashfs_read_data(struct super_block *sb, u64 index, int length,gotoout_free_bio;}/* Extract the length of the metadata block */-data=page_address(bvec->bv_page)+bvec->bv_offset;+data=bvec_virt(bvec);length=data[offset];if(offset<bvec->bv_len-1){length|=data[offset+1]<<8;
@@ -186,7 +185,7 @@ int squashfs_read_data(struct super_block *sb, u64 index, int length,res=-EIO;gotoout_free_bio;}-data=page_address(bvec->bv_page)+bvec->bv_offset;+data=bvec_virt(bvec);length|=data[0]<<8;}bio_free_pages(bio);
From: Christoph Hellwig <hch@lst.de> Date: 2021-08-04 10:04:30
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rbd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
From: Christoph Hellwig <hch@lst.de> Date: 2021-08-04 10:05:34
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/virtio_blk.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
From: Christoph Hellwig <hch@lst.de> Date: 2021-08-04 10:06:17
Use bvec_virt instead of open coding it. Note that the existing code is
fine despite ignoring bv_offset as the bio is known to contain exactly
one page from the page allocator per bio_vec.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/md/bcache/btree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Christoph Hellwig <hch@lst.de> Date: 2021-08-04 10:06:51
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/scsi/sd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Christoph Hellwig <hch@lst.de> Date: 2021-08-04 10:07:35
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
arch/um/drivers/ubd_kern.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
From: Christoph Hellwig <hch@lst.de> Date: 2021-08-04 10:08:36
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/ps3vram.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -541,7 +541,7 @@ static struct bio *ps3vram_do_bio(struct ps3_system_bus_device *dev,bio_for_each_segment(bvec,bio,iter){/* PS3 is ppc64, so we don't handle highmem */-char*ptr=page_address(bvec.bv_page)+bvec.bv_offset;+char*ptr=bvec_virt(&bvec);size_tlen=bvec.bv_len,retlen;dev_dbg(&dev->core," %s %zu bytes at offset %llu\n",op,
From: Christoph Hellwig <hch@lst.de> Date: 2021-08-04 10:10:03
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/s390/block/dcssblk.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
@@ -892,8 +892,7 @@ dcssblk_submit_bio(struct bio *bio)index=(bio->bi_iter.bi_sector>>3);bio_for_each_segment(bvec,bio,iter){-page_addr=(unsignedlong)-page_address(bvec.bv_page)+bvec.bv_offset;+page_addr=(unsignedlong)bvec_virt(&bvec);source_addr=dev_info->start+(index<<12)+bytes_done;if(unlikely((page_addr&4095)!=0)||(bvec.bv_len&4095)!=0)// More paranoia.
From: Anton Ivanov <anton.ivanov@cambridgegreys.com> Date: 2021-08-04 10:11:08
On 04/08/2021 10:56, Christoph Hellwig wrote:
quoted hunk
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
arch/um/drivers/ubd_kern.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
--
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/
From: Christoph Hellwig <hch@lst.de> Date: 2021-08-04 10:12:08
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/host/core.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
From: Keith Busch <kbusch@kernel.org> Date: 2021-08-04 14:33:40
On Wed, Aug 04, 2021 at 11:56:34AM +0200, Christoph Hellwig wrote:
quoted hunk
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/host/core.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Use bvec_virt instead of open coding it. Note that the existing code is
fine despite ignoring bv_offset as the bio is known to contain exactly
one page from the page allocator per bio_vec.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Looks good to me.
Reviewed-by: Coly Li <redacted>
Thanks.
Coly Li
Add a helper to get the virtual address for a bvec. This avoids that
all callers need to know about the page + offset representation.
Signed-off-by: Christoph Hellwig<hch@lst.de>
From: Jeff Layton <jlayton@kernel.org> Date: 2021-08-05 12:01:18
On Wed, 2021-08-04 at 11:56 +0200, Christoph Hellwig wrote:
quoted hunk
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rbd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
From: Stefan Hajnoczi <stefanha@redhat.com> Date: 2021-08-05 14:18:08
On Wed, Aug 04, 2021 at 11:56:27AM +0200, Christoph Hellwig wrote:
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/virtio_blk.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
From: Bart Van Assche <bvanassche@acm.org> Date: 2021-08-05 16:31:44
On 8/4/21 2:56 AM, Christoph Hellwig wrote:
quoted hunk
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/scsi/sd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
The patch description is not correct. The above patch involves a
functional change while the patch description suggests that no
functionality has been changed.
Although the above patch looks fine to me, why has page_address() been
changed into bvec_virt() in the sd driver? My understanding is that the
sd driver always sets bv_offset to zero.
Thanks,
Bart.
From: Christoph Hellwig <hch@lst.de> Date: 2021-08-16 12:38:21
ping.
On Wed, Aug 04, 2021 at 11:56:19AM +0200, Christoph Hellwig wrote:
Hi Jens,
this series adds a bvec_virt helper to return the virtual address of the
data in bvec to replace the open coded calculation, and as a reminder
that generall bio/bvec data can be in high memory unless it is caller
controller or in an architecture specific driver where highmem is
impossible.
Hi Jens,
this series adds a bvec_virt helper to return the virtual address of the
data in bvec to replace the open coded calculation, and as a reminder
that generall bio/bvec data can be in high memory unless it is caller
controller or in an architecture specific driver where highmem is
impossible.