[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220409045043.23593-20-hch@lst.de>
Date: Sat, 9 Apr 2022 06:50:35 +0200
From: Christoph Hellwig <hch@....de>
To: Jens Axboe <axboe@...nel.dk>
Cc: dm-devel@...hat.com, linux-xfs@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-um@...ts.infradead.org,
linux-block@...r.kernel.org, drbd-dev@...ts.linbit.com,
nbd@...er.debian.org, ceph-devel@...r.kernel.org,
virtualization@...ts.linux-foundation.org,
xen-devel@...ts.xenproject.org, linux-bcache@...r.kernel.org,
linux-raid@...r.kernel.org, linux-mmc@...r.kernel.org,
linux-mtd@...ts.infradead.org, linux-nvme@...ts.infradead.org,
linux-s390@...r.kernel.org, linux-scsi@...r.kernel.org,
target-devel@...r.kernel.org, linux-btrfs@...r.kernel.org,
linux-ext4@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
cluster-devel@...hat.com, jfs-discussion@...ts.sourceforge.net,
linux-nilfs@...r.kernel.org, ntfs3@...ts.linux.dev,
ocfs2-devel@....oracle.com, linux-mm@...ck.org,
"Martin K . Petersen" <martin.petersen@...cle.com>
Subject: [PATCH 19/27] block: remove queue_discard_alignment
Just use bdev_alignment_offset in disk_discard_alignment_show instead.
That helpers is the same except for an always false branch that doesn't
matter in this slow path.
Signed-off-by: Christoph Hellwig <hch@....de>
Reviewed-by: Martin K. Petersen <martin.petersen@...cle.com>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 712031ce19070..36532b9318419 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1019,7 +1019,7 @@ static ssize_t disk_discard_alignment_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t diskseq_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0a1795ac26275..5a9b7aeda010b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1253,14 +1253,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
int bdev_alignment_offset(struct block_device *bdev);
-static inline int queue_discard_alignment(const struct request_queue *q)
-{
- if (q->limits.discard_misaligned)
- return -1;
-
- return q->limits.discard_alignment;
-}
-
static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector_t sector)
{
unsigned int alignment, granularity, offset;
--
2.30.2
Powered by blists - more mailing lists