mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Jani Nikula <jani.nikula@intel.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	Hannes Reinecke <hare@suse.com>, Omar Sandoval <osandov@fb.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH] [v2] blkdev: always export SECTOR_SHIFT
Date: Fri, 19 Jul 2019 14:13:37 +0200	[thread overview]
Message-ID: <20190719121336.GB28960@lst.de> (raw)
In-Reply-To: <20190719113139.4005262-1-arnd@arndb.de>

> +/*
> + * The basic unit of block I/O is a sector. It is used in a number of contexts
> + * in Linux (blk, bio, genhd). The size of one sector is 512 = 2**9
> + * bytes. Variables of type sector_t represent an offset or size that is a
> + * multiple of 512 bytes. Hence these two constants.
> + */
> +#ifndef SECTOR_SHIFT
> +#define SECTOR_SHIFT 9
> +#endif
> +#ifndef SECTOR_SIZE
> +#define SECTOR_SIZE (1 << SECTOR_SHIFT)
> +#endif

While we're at it we really should drop the ifndefs.

Otherwise looks good.

In fact given that sector_t is in linux/types.h I wonder if these
should just move there.

  reply	other threads:[~2019-07-19 12:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-19 11:31 Arnd Bergmann
2019-07-19 12:13 ` Christoph Hellwig [this message]
2019-07-19 13:14   ` Arnd Bergmann
2019-07-19 13:28     ` Arnd Bergmann
2019-07-19 12:47 ` Masahiro Yamada
2019-07-19 13:15   ` Arnd Bergmann

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=20190719121336.GB28960@lst.de \
    --to=hch@lst.de \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=darrick.wong@oracle.com \
    --cc=hare@suse.com \
    --cc=jani.nikula@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=osandov@fb.com \
    --cc=rdunlap@infradead.org \
    --cc=yamada.masahiro@socionext.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

all inboxes | Powered by JetHome®