Skip to content

Commit 27ca1d4

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: move req_gap_back_merge to blk.h
No need to expose these helpers outside the block layer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent e990700 commit 27ca1d4

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

‎block/blk.h‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,25 @@ static inline void blk_queue_enter_live(struct request_queue *q)
149149
percpu_ref_get(&q->q_usage_counter);
150150
}
151151

152+
static inline bool __bvec_gap_to_prev(struct request_queue *q,
153+
struct bio_vec *bprv, unsigned int offset)
154+
{
155+
return offset ||
156+
((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q));
157+
}
158+
159+
/*
160+
* Check if adding a bio_vec after bprv with offset would create a gap in
161+
* the SG list. Most drivers don't care about this, but some do.
162+
*/
163+
static inline bool bvec_gap_to_prev(struct request_queue *q,
164+
struct bio_vec *bprv, unsigned int offset)
165+
{
166+
if (!queue_virt_boundary(q))
167+
return false;
168+
return __bvec_gap_to_prev(q, bprv, offset);
169+
}
170+
152171
#ifdef CONFIG_BLK_DEV_INTEGRITY
153172
void blk_flush_integrity(void);
154173
bool __bio_integrity_endio(struct bio *);

‎include/linux/blkdev.h‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,25 +1676,6 @@ static inline void put_dev_sector(Sector p)
16761676
put_page(p.v);
16771677
}
16781678

1679-
static inline bool __bvec_gap_to_prev(struct request_queue *q,
1680-
struct bio_vec *bprv, unsigned int offset)
1681-
{
1682-
return offset ||
1683-
((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q));
1684-
}
1685-
1686-
/*
1687-
* Check if adding a bio_vec after bprv with offset would create a gap in
1688-
* the SG list. Most drivers don't care about this, but some do.
1689-
*/
1690-
static inline bool bvec_gap_to_prev(struct request_queue *q,
1691-
struct bio_vec *bprv, unsigned int offset)
1692-
{
1693-
if (!queue_virt_boundary(q))
1694-
return false;
1695-
return __bvec_gap_to_prev(q, bprv, offset);
1696-
}
1697-
16981679
int kblockd_schedule_work(struct work_struct *work);
16991680
int kblockd_schedule_work_on(int cpu, struct work_struct *work);
17001681
int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned long delay);

0 commit comments

Comments
 (0)