]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dm: unexport dm_get_queue_limits()
authorMike Snitzer <snitzer@kernel.org>
Fri, 14 Apr 2023 16:32:20 +0000 (12:32 -0400)
committerMike Snitzer <snitzer@kernel.org>
Fri, 14 Apr 2023 16:32:20 +0000 (12:32 -0400)
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>
drivers/md/dm.c
include/linux/device-mapper.h

index 244ebb8c316bcd1eb0784268613617d28011554d..3b694ba3a106e68d4c0d5e64cd9136cf7abce237 100644 (file)
@@ -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);
@@ -2311,17 +2320,6 @@ struct target_type *dm_get_immutable_target_type(struct mapped_device *md)
        return md->immutable_target_type;
 }
 
-/*
- * 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
  */
index 983f1f0402b5e76e083ada5a6dde3bad95617320..a52d2b9a68460ac7951ad6ebe76d9a1cfccf7afb 100644 (file)
@@ -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.
  */