Message ID | 20220720142456.1414262-5-hch@lst.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/5] block: move ->bio_split to the gendisk | expand |
On 20.07.22 16:25, Christoph Hellwig wrote: > +/* > + * The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size > + * is defined as 'unsigned int', meantime it has to aligned to with logical > + * block size which is the minimum accepted unit by hardware. > + */ Not your call, as your only moving the comment but 'to be aligned to'
On Thu, Jul 21, 2022 at 06:31:24AM +0000, Johannes Thumshirn wrote: > On 20.07.22 16:25, Christoph Hellwig wrote: > > +/* > > + * The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size > > + * is defined as 'unsigned int', meantime it has to aligned to with logical > > + * block size which is the minimum accepted unit by hardware. > > + */ > > Not your call, as your only moving the comment but 'to be aligned to' I'm perfectly fine with fixing it, but a little to lazy to resend just for that :)
On 21.07.22 08:42, Christoph Hellwig wrote: > On Thu, Jul 21, 2022 at 06:31:24AM +0000, Johannes Thumshirn wrote: >> On 20.07.22 16:25, Christoph Hellwig wrote: >>> +/* >>> + * The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size >>> + * is defined as 'unsigned int', meantime it has to aligned to with logical >>> + * block size which is the minimum accepted unit by hardware. >>> + */ >> >> Not your call, as your only moving the comment but 'to be aligned to' > > I'm perfectly fine with fixing it, but a little to lazy to resend just > for that :) > Sure. I think Jens can fix it up when applying.
On 7/20/22 23:24, Christoph Hellwig wrote: > Move this helper into the only file where it is used. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> > --- > block/blk-merge.c | 10 ++++++++++ > block/blk.h | 10 ---------- > 2 files changed, 10 insertions(+), 10 deletions(-) > > diff --git a/block/blk-merge.c b/block/blk-merge.c > index 1676a835b16e7..9593a8a617292 100644 > --- a/block/blk-merge.c > +++ b/block/blk-merge.c > @@ -95,6 +95,16 @@ static inline bool req_gap_front_merge(struct request *req, struct bio *bio) > return bio_will_gap(req->q, NULL, bio, req->bio); > } > > +/* > + * The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size > + * is defined as 'unsigned int', meantime it has to aligned to with logical > + * block size which is the minimum accepted unit by hardware. > + */ > +static unsigned int bio_allowed_max_sectors(struct request_queue *q) > +{ > + return round_down(UINT_MAX, queue_logical_block_size(q)) >> 9; > +} > + > static struct bio *blk_bio_discard_split(struct request_queue *q, > struct bio *bio, > struct bio_set *bs, > diff --git a/block/blk.h b/block/blk.h > index c4b084bfe87c9..3026ba81c85f0 100644 > --- a/block/blk.h > +++ b/block/blk.h > @@ -349,16 +349,6 @@ static inline void req_set_nomerge(struct request_queue *q, struct request *req) > q->last_merge = NULL; > } > > -/* > - * The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size > - * is defined as 'unsigned int', meantime it has to aligned to with logical > - * block size which is the minimum accepted unit by hardware. > - */ > -static inline unsigned int bio_allowed_max_sectors(struct request_queue *q) > -{ > - return round_down(UINT_MAX, queue_logical_block_size(q)) >> 9; > -} > - > /* > * Internal io_context interface > */
diff --git a/block/blk-merge.c b/block/blk-merge.c index 1676a835b16e7..9593a8a617292 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -95,6 +95,16 @@ static inline bool req_gap_front_merge(struct request *req, struct bio *bio) return bio_will_gap(req->q, NULL, bio, req->bio); } +/* + * The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size + * is defined as 'unsigned int', meantime it has to aligned to with logical + * block size which is the minimum accepted unit by hardware. + */ +static unsigned int bio_allowed_max_sectors(struct request_queue *q) +{ + return round_down(UINT_MAX, queue_logical_block_size(q)) >> 9; +} + static struct bio *blk_bio_discard_split(struct request_queue *q, struct bio *bio, struct bio_set *bs, diff --git a/block/blk.h b/block/blk.h index c4b084bfe87c9..3026ba81c85f0 100644 --- a/block/blk.h +++ b/block/blk.h @@ -349,16 +349,6 @@ static inline void req_set_nomerge(struct request_queue *q, struct request *req) q->last_merge = NULL; } -/* - * The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size - * is defined as 'unsigned int', meantime it has to aligned to with logical - * block size which is the minimum accepted unit by hardware. - */ -static inline unsigned int bio_allowed_max_sectors(struct request_queue *q) -{ - return round_down(UINT_MAX, queue_logical_block_size(q)) >> 9; -} - /* * Internal io_context interface */
Move this helper into the only file where it is used. Signed-off-by: Christoph Hellwig <hch@lst.de> --- block/blk-merge.c | 10 ++++++++++ block/blk.h | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-)