All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Coly Li <colyli@suse.de>, Mike Snitzer <snitzer@redhat.com>,
	Song Liu <song@kernel.org>, David Sterba <dsterba@suse.com>,
	Josef Bacik <josef@toxicpanda.com>,
	"Theodore Ts'o" <tytso@mit.edu>,
	OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	Dave Kleikamp <shaggy@kernel.org>,
	Ryusuke Konishi <konishi.ryusuke@gmail.com>,
	Anton Altaparmakov <anton@tuxera.com>,
	Konstantin Komarov <almaz.alexandrovich@paragon-software.com>,
	Kees Cook <keescook@chromium.org>,
	Phillip Lougher <phillip@squashfs.org.uk>,
	Jan Kara <jack@suse.com>,
	linux-block@vger.kernel.org, dm-devel@redhat.com,
	drbd-dev@lists.linbit.com, linux-bcache@vger.kernel.org,
	linux-raid@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-ext4@vger.kernel.org, jfs-discussion@lists.sourceforge.net,
	linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org,
	linux-ntfs-dev@lists.sourceforge.net, ntfs3@lists.linux.dev,
	reiserfs-devel@vger.kernel.org
Subject: [PATCH 01/30] block: move the SECTOR_SIZE related definitions to blk_types.h
Date: Fri, 15 Oct 2021 15:26:14 +0200	[thread overview]
Message-ID: <20211015132643.1621913-2-hch@lst.de> (raw)
In-Reply-To: <20211015132643.1621913-1-hch@lst.de>

Ensure these are always available for inlines in the various block layer
headers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/linux/blk_types.h | 17 +++++++++++++++++
 include/linux/blkdev.h    | 17 -----------------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 3b967053e9f5a..dc8da0c7fa09b 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -20,6 +20,23 @@ struct cgroup_subsys_state;
 typedef void (bio_end_io_t) (struct bio *);
 struct bio_crypt_ctx;
 
+/*
+ * 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
+
+#define PAGE_SECTORS_SHIFT	(PAGE_SHIFT - SECTOR_SHIFT)
+#define PAGE_SECTORS		(1 << PAGE_SECTORS_SHIFT)
+#define SECTOR_MASK		(PAGE_SECTORS - 1)
+
 struct block_device {
 	sector_t		bd_start_sect;
 	struct disk_stats __percpu *bd_stats;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 17705c970d7e1..161496d1aced0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -571,23 +571,6 @@ static inline struct request_queue *bdev_get_queue(struct block_device *bdev)
 	return bdev->bd_disk->queue;	/* this is never NULL */
 }
 
-/*
- * 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
-
-#define PAGE_SECTORS_SHIFT	(PAGE_SHIFT - SECTOR_SHIFT)
-#define PAGE_SECTORS		(1 << PAGE_SECTORS_SHIFT)
-#define SECTOR_MASK		(PAGE_SECTORS - 1)
-
 #ifdef CONFIG_BLK_DEV_ZONED
 
 /* Helper to convert BLK_ZONE_ZONE_XXX to its string format XXX */
-- 
2.30.2


WARNING: multiple messages have this Message-ID
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Dave Kleikamp <shaggy@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Mike Snitzer <snitzer@redhat.com>,
	linux-nvme@lists.infradead.org,
	Konstantin Komarov <almaz.alexandrovich@paragon-software.com>,
	Song Liu <song@kernel.org>,
	dm-devel@redhat.com, target-devel@vger.kernel.org,
	reiserfs-devel@vger.kernel.org, drbd-dev@lists.linbit.com,
	linux-nilfs@vger.kernel.org, linux-scsi@vger.kernel.org,
	OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	linux-ext4@vger.kernel.org, Kees Cook <keescook@chromium.org>,
	Josef Bacik <josef@toxicpanda.com>, Coly Li <colyli@suse.de>,
	linux-raid@vger.kernel.org, linux-bcache@vger.kernel.org,
	David Sterba <dsterba@suse.com>,
	Ryusuke Konishi <konishi.ryusuke@gmail.com>,
	Anton Altaparmakov <anton@tuxera.com>,
	linux-block@vger.kernel.org, linux-nfs@vger.kernel.org,
	Theodore Ts'o <tytso@mit.edu>,
	linux-ntfs-dev@lists.sourceforge.net, Jan Kara <jack@suse.com>,
	linux-fsdevel@vger.kernel.org,
	Phillip Lougher <phillip@squashfs.org.uk>,
	ntfs3@lists.linux.dev, linux-btrfs@vger.kernel.org
Subject: [dm-devel] [PATCH 01/30] block: move the SECTOR_SIZE related definitions to blk_types.h
Date: Fri, 15 Oct 2021 15:26:14 +0200	[thread overview]
Message-ID: <20211015132643.1621913-2-hch@lst.de> (raw)
In-Reply-To: <20211015132643.1621913-1-hch@lst.de>

Ensure these are always available for inlines in the various block layer
headers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/linux/blk_types.h | 17 +++++++++++++++++
 include/linux/blkdev.h    | 17 -----------------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 3b967053e9f5a..dc8da0c7fa09b 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -20,6 +20,23 @@ struct cgroup_subsys_state;
 typedef void (bio_end_io_t) (struct bio *);
 struct bio_crypt_ctx;
 
+/*
+ * 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
+
+#define PAGE_SECTORS_SHIFT	(PAGE_SHIFT - SECTOR_SHIFT)
+#define PAGE_SECTORS		(1 << PAGE_SECTORS_SHIFT)
+#define SECTOR_MASK		(PAGE_SECTORS - 1)
+
 struct block_device {
 	sector_t		bd_start_sect;
 	struct disk_stats __percpu *bd_stats;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 17705c970d7e1..161496d1aced0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -571,23 +571,6 @@ static inline struct request_queue *bdev_get_queue(struct block_device *bdev)
 	return bdev->bd_disk->queue;	/* this is never NULL */
 }
 
-/*
- * 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
-
-#define PAGE_SECTORS_SHIFT	(PAGE_SHIFT - SECTOR_SHIFT)
-#define PAGE_SECTORS		(1 << PAGE_SECTORS_SHIFT)
-#define SECTOR_MASK		(PAGE_SECTORS - 1)
-
 #ifdef CONFIG_BLK_DEV_ZONED
 
 /* Helper to convert BLK_ZONE_ZONE_XXX to its string format XXX */
-- 
2.30.2

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2021-10-15 13:27 UTC|newest]

Thread overview: 127+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15 13:26 don't use ->bd_inode to access the block device size v2 Christoph Hellwig
2021-10-15 13:26 ` [dm-devel] " Christoph Hellwig
2021-10-15 13:26 ` Christoph Hellwig [this message]
2021-10-15 13:26   ` [dm-devel] [PATCH 01/30] block: move the SECTOR_SIZE related definitions to blk_types.h Christoph Hellwig
2021-10-15 13:44   ` Jan Kara
2021-10-15 13:44     ` [dm-devel] " Jan Kara
2021-10-15 15:45   ` Kees Cook
2021-10-15 15:45     ` [dm-devel] " Kees Cook
2021-10-18  6:21   ` Chaitanya Kulkarni
2021-10-18  6:21     ` [dm-devel] " Chaitanya Kulkarni
2021-10-15 13:26 ` [PATCH 02/30] block: add a bdev_nr_bytes helper Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 13:35   ` Matthew Wilcox
2021-10-15 13:35     ` [dm-devel] " Matthew Wilcox
2021-10-15 13:37     ` Christoph Hellwig
2021-10-15 13:37       ` [dm-devel] " Christoph Hellwig
2021-10-15 14:37   ` Anton Altaparmakov
2021-10-15 14:37     ` [dm-devel] " Anton Altaparmakov
2021-10-15 15:49     ` Kees Cook
2021-10-15 15:49       ` [dm-devel] " Kees Cook
2021-10-15 13:26 ` [PATCH 03/30] bcache: remove bdev_sectors Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-18  5:46   ` Chaitanya Kulkarni
2021-10-18  5:46     ` [dm-devel] " Chaitanya Kulkarni
2021-10-15 13:26 ` [PATCH 04/30] drbd: use bdev_nr_sectors instead of open coding it Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 18:00   ` Lee Duncan
2021-10-15 18:00     ` [dm-devel] " Lee Duncan
2021-10-15 13:26 ` [PATCH 05/30] dm: use bdev_nr_sectors and bdev_nr_bytes instead of open coding them Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 13:26 ` [PATCH 06/30] md: use bdev_nr_sectors instead of open coding it Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 13:26 ` [PATCH 07/30] nvmet: use bdev_nr_bytes " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 15:51   ` Kees Cook
2021-10-15 15:51     ` [dm-devel] " Kees Cook
2021-10-15 13:26 ` [PATCH 08/30] target/iblock: " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 15:57   ` Kees Cook
2021-10-15 15:57     ` [dm-devel] " Kees Cook
2021-10-15 13:26 ` [PATCH 09/30] fs: use bdev_nr_bytes instead of open coding it in blkdev_max_block Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 16:00   ` Kees Cook
2021-10-15 16:00     ` [dm-devel] " Kees Cook
2021-10-15 13:26 ` [PATCH 10/30] fs: simplify init_page_buffers Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 13:26 ` [PATCH 11/30] affs: use bdev_nr_sectors instead of open coding it Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-18  6:22   ` Chaitanya Kulkarni
2021-10-18  6:22     ` [dm-devel] " Chaitanya Kulkarni
2021-10-15 13:26 ` [PATCH 12/30] btrfs: use bdev_nr_bytes " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 13:52   ` David Sterba
2021-10-15 13:52     ` [dm-devel] " David Sterba
2021-10-15 16:59   ` Kees Cook
2021-10-15 16:59     ` [dm-devel] " Kees Cook
2021-10-15 13:26 ` [PATCH 13/30] cramfs: " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 16:51   ` Kees Cook
2021-10-15 16:51     ` [dm-devel] " Kees Cook
2021-10-15 13:26 ` [PATCH 14/30] fat: use bdev_nr_sectors " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 13:26 ` [PATCH 15/30] hfs: " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 13:26 ` [PATCH 16/30] hfsplus: " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 13:26 ` [PATCH 17/30] jfs: use bdev_nr_bytes " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 16:53   ` Kees Cook
2021-10-15 16:53     ` [dm-devel] " Kees Cook
2021-10-15 13:26 ` [PATCH 18/30] nfs/blocklayout: " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 16:54   ` Kees Cook
2021-10-15 16:54     ` [dm-devel] " Kees Cook
2021-10-15 13:26 ` [PATCH 19/30] nilfs2: " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 13:54   ` Ryusuke Konishi
2021-10-15 13:54     ` [dm-devel] " Ryusuke Konishi
2021-10-15 16:54   ` Kees Cook
2021-10-15 16:54     ` [dm-devel] " Kees Cook
2021-10-15 13:26 ` [PATCH 20/30] ntfs3: " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 16:54   ` Kees Cook
2021-10-15 16:54     ` [dm-devel] " Kees Cook
2021-10-16  7:40   ` Kari Argillander
2021-10-16  7:40     ` [dm-devel] " Kari Argillander
2021-10-15 13:26 ` [PATCH 21/30] pstore/blk: " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 16:56   ` Kees Cook
2021-10-15 16:56     ` [dm-devel] " Kees Cook
2021-10-15 13:26 ` [PATCH 22/30] reiserfs: " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 16:56   ` Kees Cook
2021-10-15 16:56     ` [dm-devel] " Kees Cook
2021-10-18  6:22   ` Chaitanya Kulkarni
2021-10-18  6:22     ` [dm-devel] " Chaitanya Kulkarni
2021-10-15 13:26 ` [PATCH 23/30] squashfs: " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 16:57   ` Kees Cook
2021-10-15 16:57     ` [dm-devel] " Kees Cook
2021-10-15 13:26 ` [PATCH 24/30] block: use bdev_nr_bytes instead of open coding it in blkdev_fallocate Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 16:57   ` Kees Cook
2021-10-15 16:57     ` [dm-devel] " Kees Cook
2021-10-15 13:26 ` [PATCH 25/30] block: add a sb_bdev_nr_blocks helper Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 16:58   ` Kees Cook
2021-10-15 16:58     ` [dm-devel] " Kees Cook
2021-10-18  5:48   ` Chaitanya Kulkarni
2021-10-18  5:48     ` [dm-devel] " Chaitanya Kulkarni
2021-10-15 13:26 ` [PATCH 26/30] ext4: use sb_bdev_nr_blocks Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-18  5:48   ` Chaitanya Kulkarni
2021-10-18  5:48     ` [dm-devel] " Chaitanya Kulkarni
2021-10-15 13:26 ` [PATCH 27/30] jfs: " Christoph Hellwig
2021-10-15 13:26   ` [dm-devel] " Christoph Hellwig
2021-10-15 14:16   ` Dave Kleikamp
2021-10-15 14:16     ` [dm-devel] " Dave Kleikamp
2021-10-15 13:26 ` [dm-devel] [PATCH 28/30] ntfs: " Christoph Hellwig
2021-10-15 13:26   ` Christoph Hellwig
2021-10-15 14:35   ` Anton Altaparmakov
2021-10-15 14:35     ` [dm-devel] " Anton Altaparmakov
2021-10-15 13:26 ` [dm-devel] [PATCH 29/30] reiserfs: " Christoph Hellwig
2021-10-15 13:26   ` Christoph Hellwig
2021-10-15 13:26 ` [dm-devel] [PATCH 30/30] udf: " Christoph Hellwig
2021-10-15 13:26   ` Christoph Hellwig
2021-10-18 10:11 don't use ->bd_inode to access the block device size v3 Christoph Hellwig
2021-10-18 10:11 ` [PATCH 01/30] block: move the SECTOR_SIZE related definitions to blk_types.h 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=20211015132643.1621913-2-hch@lst.de \
    --to=hch@lst.de \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=anton@tuxera.com \
    --cc=axboe@kernel.dk \
    --cc=colyli@suse.de \
    --cc=dm-devel@redhat.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=dsterba@suse.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=jack@suse.com \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=josef@toxicpanda.com \
    --cc=keescook@chromium.org \
    --cc=konishi.ryusuke@gmail.com \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-nilfs@vger.kernel.org \
    --cc=linux-ntfs-dev@lists.sourceforge.net \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    --cc=phillip@squashfs.org.uk \
    --cc=reiserfs-devel@vger.kernel.org \
    --cc=shaggy@kernel.org \
    --cc=snitzer@redhat.com \
    --cc=song@kernel.org \
    --cc=target-devel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.