Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a9f5f24 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

block: simplify BIOVEC_PHYS_MERGEABLE



Turn the macro into an inline, move it to blk.h and simplify the
arch hooks a bit.

Also rename the function to biovec_phys_mergeable as there is no need
to shout.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 27ca1d4e
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -469,9 +469,8 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr);
struct bio_vec;
extern bool xen_biovec_phys_mergeable(const struct bio_vec *vec1,
				      const struct bio_vec *vec2);
#define BIOVEC_PHYS_MERGEABLE(vec1, vec2)				\
	(__BIOVEC_PHYS_MERGEABLE(vec1, vec2) &&				\
	 (!xen_domain() || xen_biovec_phys_mergeable(vec1, vec2)))
#define ARCH_BIOVEC_PHYS_MERGEABLE(vec1, vec2)				\
	 (!xen_domain() || xen_biovec_phys_mergeable(vec1, vec2))

#ifdef CONFIG_MMU
#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
+2 −3
Original line number Diff line number Diff line
@@ -208,9 +208,8 @@ extern int devmem_is_allowed(unsigned long pfn);
struct bio_vec;
extern bool xen_biovec_phys_mergeable(const struct bio_vec *vec1,
				      const struct bio_vec *vec2);
#define BIOVEC_PHYS_MERGEABLE(vec1, vec2)				\
	(__BIOVEC_PHYS_MERGEABLE(vec1, vec2) &&				\
	 (!xen_domain() || xen_biovec_phys_mergeable(vec1, vec2)))
#define ARCH_BIOVEC_PHYS_MERGEABLE(vec1, vec2)				\
	 (!xen_domain() || xen_biovec_phys_mergeable(vec1, vec2))

#endif	/* __KERNEL__ */
#endif	/* __ASM_IO_H */
+2 −3
Original line number Diff line number Diff line
@@ -376,9 +376,8 @@ struct bio_vec;
extern bool xen_biovec_phys_mergeable(const struct bio_vec *vec1,
				      const struct bio_vec *vec2);

#define BIOVEC_PHYS_MERGEABLE(vec1, vec2)				\
	(__BIOVEC_PHYS_MERGEABLE(vec1, vec2) &&				\
	 (!xen_domain() || xen_biovec_phys_mergeable(vec1, vec2)))
#define ARCH_BIOVEC_PHYS_MERGEABLE(vec1, vec2)				\
	 (!xen_domain() || xen_biovec_phys_mergeable(vec1, vec2))
#endif	/* CONFIG_XEN */

#define IO_SPACE_LIMIT 0xffff
+1 −1
Original line number Diff line number Diff line
@@ -731,7 +731,7 @@ int bio_add_pc_page(struct request_queue *q, struct bio *bio, struct page
	}

	/* If we may be able to merge these biovecs, force a recount */
	if (bio->bi_vcnt > 1 && (BIOVEC_PHYS_MERGEABLE(bvec-1, bvec)))
	if (bio->bi_vcnt > 1 && biovec_phys_mergeable(bvec-1, bvec))
		bio_clear_flag(bio, BIO_SEG_VALID);

 done:
+2 −2
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ int blk_rq_count_integrity_sg(struct request_queue *q, struct bio *bio)
	bio_for_each_integrity_vec(iv, bio, iter) {

		if (prev) {
			if (!BIOVEC_PHYS_MERGEABLE(&ivprv, &iv))
			if (!biovec_phys_mergeable(&ivprv, &iv))
				goto new_segment;

			if (!BIOVEC_SEG_BOUNDARY(q, &ivprv, &iv))
@@ -95,7 +95,7 @@ int blk_rq_map_integrity_sg(struct request_queue *q, struct bio *bio,
	bio_for_each_integrity_vec(iv, bio, iter) {

		if (prev) {
			if (!BIOVEC_PHYS_MERGEABLE(&ivprv, &iv))
			if (!biovec_phys_mergeable(&ivprv, &iv))
				goto new_segment;

			if (!BIOVEC_SEG_BOUNDARY(q, &ivprv, &iv))
Loading