Skip to content

Commit 0516c2f

Browse files
igawaxboe
authored andcommitted
block: Remove callback typedefs for blk_mq_ops
No need to define typedefs for the callbacks, because there is not a single user except blk_mq_ops. Signed-off-by: Daniel Wagner <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 08c875c commit 0516c2f

File tree

1 file changed

+18
-32
lines changed

1 file changed

+18
-32
lines changed

include/linux/blk-mq.h

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -267,27 +267,9 @@ struct blk_mq_queue_data {
267267
bool last;
268268
};
269269

270-
typedef blk_status_t (queue_rq_fn)(struct blk_mq_hw_ctx *,
271-
const struct blk_mq_queue_data *);
272-
typedef void (commit_rqs_fn)(struct blk_mq_hw_ctx *);
273-
typedef bool (get_budget_fn)(struct request_queue *);
274-
typedef void (put_budget_fn)(struct request_queue *);
275-
typedef enum blk_eh_timer_return (timeout_fn)(struct request *, bool);
276-
typedef int (init_hctx_fn)(struct blk_mq_hw_ctx *, void *, unsigned int);
277-
typedef void (exit_hctx_fn)(struct blk_mq_hw_ctx *, unsigned int);
278-
typedef int (init_request_fn)(struct blk_mq_tag_set *set, struct request *,
279-
unsigned int, unsigned int);
280-
typedef void (exit_request_fn)(struct blk_mq_tag_set *set, struct request *,
281-
unsigned int);
282-
283270
typedef bool (busy_iter_fn)(struct blk_mq_hw_ctx *, struct request *, void *,
284271
bool);
285272
typedef bool (busy_tag_iter_fn)(struct request *, void *, bool);
286-
typedef int (poll_fn)(struct blk_mq_hw_ctx *);
287-
typedef int (map_queues_fn)(struct blk_mq_tag_set *set);
288-
typedef bool (busy_fn)(struct request_queue *);
289-
typedef void (complete_fn)(struct request *);
290-
typedef void (cleanup_rq_fn)(struct request *);
291273

292274
/**
293275
* struct blk_mq_ops - Callback functions that implements block driver
@@ -297,7 +279,8 @@ struct blk_mq_ops {
297279
/**
298280
* @queue_rq: Queue a new request from block IO.
299281
*/
300-
queue_rq_fn *queue_rq;
282+
blk_status_t (*queue_rq)(struct blk_mq_hw_ctx *,
283+
const struct blk_mq_queue_data *);
301284

302285
/**
303286
* @commit_rqs: If a driver uses bd->last to judge when to submit
@@ -306,45 +289,46 @@ struct blk_mq_ops {
306289
* purpose of kicking the hardware (which the last request otherwise
307290
* would have done).
308291
*/
309-
commit_rqs_fn *commit_rqs;
292+
void (*commit_rqs)(struct blk_mq_hw_ctx *);
310293

311294
/**
312295
* @get_budget: Reserve budget before queue request, once .queue_rq is
313296
* run, it is driver's responsibility to release the
314297
* reserved budget. Also we have to handle failure case
315298
* of .get_budget for avoiding I/O deadlock.
316299
*/
317-
get_budget_fn *get_budget;
300+
bool (*get_budget)(struct request_queue *);
301+
318302
/**
319303
* @put_budget: Release the reserved budget.
320304
*/
321-
put_budget_fn *put_budget;
305+
void (*put_budget)(struct request_queue *);
322306

323307
/**
324308
* @timeout: Called on request timeout.
325309
*/
326-
timeout_fn *timeout;
310+
enum blk_eh_timer_return (*timeout)(struct request *, bool);
327311

328312
/**
329313
* @poll: Called to poll for completion of a specific tag.
330314
*/
331-
poll_fn *poll;
315+
int (*poll)(struct blk_mq_hw_ctx *);
332316

333317
/**
334318
* @complete: Mark the request as complete.
335319
*/
336-
complete_fn *complete;
320+
void (*complete)(struct request *);
337321

338322
/**
339323
* @init_hctx: Called when the block layer side of a hardware queue has
340324
* been set up, allowing the driver to allocate/init matching
341325
* structures.
342326
*/
343-
init_hctx_fn *init_hctx;
327+
int (*init_hctx)(struct blk_mq_hw_ctx *, void *, unsigned int);
344328
/**
345329
* @exit_hctx: Ditto for exit/teardown.
346330
*/
347-
exit_hctx_fn *exit_hctx;
331+
void (*exit_hctx)(struct blk_mq_hw_ctx *, unsigned int);
348332

349333
/**
350334
* @init_request: Called for every command allocated by the block layer
@@ -353,11 +337,13 @@ struct blk_mq_ops {
353337
* Tag greater than or equal to queue_depth is for setting up
354338
* flush request.
355339
*/
356-
init_request_fn *init_request;
340+
int (*init_request)(struct blk_mq_tag_set *set, struct request *,
341+
unsigned int, unsigned int);
357342
/**
358343
* @exit_request: Ditto for exit/teardown.
359344
*/
360-
exit_request_fn *exit_request;
345+
void (*exit_request)(struct blk_mq_tag_set *set, struct request *,
346+
unsigned int);
361347

362348
/**
363349
* @initialize_rq_fn: Called from inside blk_get_request().
@@ -368,18 +354,18 @@ struct blk_mq_ops {
368354
* @cleanup_rq: Called before freeing one request which isn't completed
369355
* yet, and usually for freeing the driver private data.
370356
*/
371-
cleanup_rq_fn *cleanup_rq;
357+
void (*cleanup_rq)(struct request *);
372358

373359
/**
374360
* @busy: If set, returns whether or not this queue currently is busy.
375361
*/
376-
busy_fn *busy;
362+
bool (*busy)(struct request_queue *);
377363

378364
/**
379365
* @map_queues: This allows drivers specify their own queue mapping by
380366
* overriding the setup-time function that builds the mq_map.
381367
*/
382-
map_queues_fn *map_queues;
368+
int (*map_queues)(struct blk_mq_tag_set *set);
383369

384370
#ifdef CONFIG_BLK_DEBUG_FS
385371
/**

0 commit comments

Comments
 (0)