linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave-h16yJtLeMjHk1uMJSBkQmQ@public.gmane.org>
To: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: Jens Axboe <axboe-b10kYP2dOMg@public.gmane.org>,
	"Nicholas A . Bellinger"
	<nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>,
	Mike Christie <mchristi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Andy Grover <agrover-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Hannes Reinecke <hare-IBi9RG/b67k@public.gmane.org>,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 1/3] block: provide helpers for reading block count
Date: Mon, 27 Jun 2016 09:30:12 -0700	[thread overview]
Message-ID: <20160627163012.GA11116@linux-80c1.suse> (raw)
In-Reply-To: <20160623133016.3781907-1-arnd-r2nGTMty4D4@public.gmane.org>

On Thu, 23 Jun 2016, Arnd Bergmann wrote:

>Several drivers use an expensive do_div() to compute the number
>of logical or physical blocks in a blockdev, which can be done
>more efficiently using a shift, since the blocksize is always
>a power of two number.
>
>Let's introduce bdev_logical_block_count() and bdev_physical_block_count()
>helper functions mirroring the bdev_logical_block_size() and
>bdev_physical_block_size() interfaces for the block size.

>@@ -1226,6 +1226,13 @@ static inline unsigned short bdev_logical_block_size(struct block_device *bdev)
> 	return queue_logical_block_size(bdev_get_queue(bdev));
> }
>
>+static inline sector_t bdev_logical_block_count(struct block_device *bdev)

Curious, why not just return u64 instead for all these instead of sector_t (ie
dealing with lba, it reads weird)?

Thanks,
Davidlohr

      parent reply	other threads:[~2016-06-27 16:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-23 13:30 [PATCH v2 1/3] block: provide helpers for reading block count Arnd Bergmann
2016-06-23 13:30 ` [PATCH v2 2/3] partition/efi: use bdev_logical_block_count() Arnd Bergmann
2016-06-23 13:30 ` [PATCH v2 3/3] target/iblock: " Arnd Bergmann
2016-06-23 15:52 ` [PATCH v2 1/3] block: provide helpers for reading block count Sagi Grimberg
     [not found] ` <20160623133016.3781907-1-arnd-r2nGTMty4D4@public.gmane.org>
2016-06-23 14:22   ` Christoph Hellwig
2016-06-27 16:30   ` Davidlohr Bueso [this message]

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=20160627163012.GA11116@linux-80c1.suse \
    --to=dave-h16yjtlemjhk1umjsbkqmq@public.gmane.org \
    --cc=agrover-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=axboe-b10kYP2dOMg@public.gmane.org \
    --cc=hare-IBi9RG/b67k@public.gmane.org \
    --cc=hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mchristi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org \
    --cc=target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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).