From: Bart Van Assche <bvanassche@acm.org>
To: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, dm-devel@redhat.com,
Mike Snitzer <snitzer@redhat.com>
Subject: Re: [dm-devel] [PATCH 1/5] block: factor out a chunk_size_left helper
Date: Tue, 12 Oct 2021 09:50:11 -0700 [thread overview]
Message-ID: <d5273d1f-dbf1-8921-b03d-0f61d08dbfdc@acm.org> (raw)
In-Reply-To: <20211012163613.994933-2-hch@lst.de>
On 10/12/21 9:36 AM, Christoph Hellwig wrote:
> +/*
> + * Return how much of the chunk sectors is left to be used for an I/O at the
> + * given offset.
> + */
> +static inline unsigned int chunk_size_left(sector_t offset,
> + unsigned int chunk_sectors)
> +{
> + if (unlikely(!is_power_of_2(chunk_sectors)))
> + return chunk_sectors - sector_div(offset, chunk_sectors);
> + return chunk_sectors - (offset & (chunk_sectors - 1));
> +}
No "blk_" prefix for the function name? I think most other functions
declared or defined in this header file have such a prefix.
Thanks,
Bart.
next prev parent reply other threads:[~2021-10-12 16:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-12 16:36 simplify I/O size calculation helpers Christoph Hellwig
2021-10-12 16:36 ` [PATCH 1/5] block: factor out a chunk_size_left helper Christoph Hellwig
2021-10-12 16:50 ` Bart Van Assche [this message]
2021-10-12 16:36 ` [PATCH 2/5] dm: open code blk_max_size_offset in max_io_len Christoph Hellwig
2021-10-12 16:36 ` [PATCH 3/5] block: open code blk_max_size_offset in blk_rq_get_max_sectors Christoph Hellwig
2021-10-12 16:36 ` [PATCH 4/5] block: fold blk_max_size_offset into get_max_io_size Christoph Hellwig
2021-10-12 16:36 ` [PATCH 5/5] block: pass the start sector to get_max_io_size Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d5273d1f-dbf1-8921-b03d-0f61d08dbfdc@acm.org \
--to=bvanassche@acm.org \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=snitzer@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).