summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2023-04-14 12:32:20 -0400
committerMike Snitzer <snitzer@kernel.org>2023-04-14 12:32:20 -0400
commitf7995089c508a5a11b0491c7b348d5c07217a4e8 (patch)
tree7c4b41a1e04d0afc1128168677678cc2712024c8
parent13f6facf3faeed34ca381aef4c9b153c7aed3972 (diff)
downloadlinux-f7995089c508a5a11b0491c7b348d5c07217a4e8.tar.gz
linux-f7995089c508a5a11b0491c7b348d5c07217a4e8.tar.bz2
linux-f7995089c508a5a11b0491c7b348d5c07217a4e8.zip
dm: unexport dm_get_queue_limits()
There are no dm_get_queue_limits() callers outside of DM core and there shouldn't be. Also, remove its BUG_ON(!atomic_read(&md->holders)) to micro-optimize __process_abnormal_io(). Signed-off-by: Mike Snitzer <snitzer@kernel.org>
-rw-r--r--drivers/md/dm.c20
-rw-r--r--include/linux/device-mapper.h2
2 files changed, 9 insertions, 13 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 244ebb8c316b..3b694ba3a106 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1072,6 +1072,15 @@ static void dm_io_dec_pending(struct dm_io *io, blk_status_t error)
__dm_io_dec_pending(io);
}
+/*
+ * The queue_limits are only valid as long as you have a reference
+ * count on 'md'. But _not_ imposing verification to avoid atomic_read(),
+ */
+static inline struct queue_limits *dm_get_queue_limits(struct mapped_device *md)
+{
+ return &md->queue->limits;
+}
+
void disable_discard(struct mapped_device *md)
{
struct queue_limits *limits = dm_get_queue_limits(md);
@@ -2312,17 +2321,6 @@ struct target_type *dm_get_immutable_target_type(struct mapped_device *md)
}
/*
- * The queue_limits are only valid as long as you have a reference
- * count on 'md'.
- */
-struct queue_limits *dm_get_queue_limits(struct mapped_device *md)
-{
- BUG_ON(!atomic_read(&md->holders));
- return &md->queue->limits;
-}
-EXPORT_SYMBOL_GPL(dm_get_queue_limits);
-
-/*
* Setup the DM device's queue based on md's type
*/
int dm_setup_md_queue(struct mapped_device *md, struct dm_table *t)
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 983f1f0402b5..a52d2b9a6846 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -530,8 +530,6 @@ int __init dm_early_create(struct dm_ioctl *dmi,
struct dm_target_spec **spec_array,
char **target_params_array);
-struct queue_limits *dm_get_queue_limits(struct mapped_device *md);
-
/*
* Geometry functions.
*/