Skip to content

Commit f799508

Browse files
author
Mike Snitzer
committed
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 <[email protected]>
1 parent 13f6fac commit f799508

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

drivers/md/dm.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,15 @@ static void dm_io_dec_pending(struct dm_io *io, blk_status_t error)
10721072
__dm_io_dec_pending(io);
10731073
}
10741074

1075+
/*
1076+
* The queue_limits are only valid as long as you have a reference
1077+
* count on 'md'. But _not_ imposing verification to avoid atomic_read(),
1078+
*/
1079+
static inline struct queue_limits *dm_get_queue_limits(struct mapped_device *md)
1080+
{
1081+
return &md->queue->limits;
1082+
}
1083+
10751084
void disable_discard(struct mapped_device *md)
10761085
{
10771086
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)
23112320
return md->immutable_target_type;
23122321
}
23132322

2314-
/*
2315-
* The queue_limits are only valid as long as you have a reference
2316-
* count on 'md'.
2317-
*/
2318-
struct queue_limits *dm_get_queue_limits(struct mapped_device *md)
2319-
{
2320-
BUG_ON(!atomic_read(&md->holders));
2321-
return &md->queue->limits;
2322-
}
2323-
EXPORT_SYMBOL_GPL(dm_get_queue_limits);
2324-
23252323
/*
23262324
* Setup the DM device's queue based on md's type
23272325
*/

include/linux/device-mapper.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,6 @@ int __init dm_early_create(struct dm_ioctl *dmi,
530530
struct dm_target_spec **spec_array,
531531
char **target_params_array);
532532

533-
struct queue_limits *dm_get_queue_limits(struct mapped_device *md);
534-
535533
/*
536534
* Geometry functions.
537535
*/

0 commit comments

Comments
 (0)