hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IB4C27
--------------------------------
Fix kabi broken in struct blk_mq_ops and struct scsi_cmnd.
Fixes: 7f858b2ec997 ("scsi: blk-mq: Add callbacks for storing & retrieving budget token") Fixes: 0b5ef658025f ("scsi: blk-mq: Return budget token from .get_budget callback") Signed-off-by: Zheng Qixing zhengqixing@huawei.com --- include/linux/blk-mq.h | 47 ++++++++++++++++++++-------------------- include/scsi/scsi_cmnd.h | 4 +--- 2 files changed, 24 insertions(+), 27 deletions(-)
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 24ea13c4e88d..0c0d6111f3b2 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -327,27 +327,9 @@ struct blk_mq_ops { */ void (*commit_rqs)(struct blk_mq_hw_ctx *);
- /** - * @get_budget: Reserve budget before queue request, once .queue_rq is - * run, it is driver's responsibility to release the - * reserved budget. Also we have to handle failure case - * of .get_budget for avoiding I/O deadlock. - */ - int (*get_budget)(struct request_queue *); + KABI_DEPRECATE_FN(bool, get_budget, struct request_queue *)
- /** - * @put_budget: Release the reserved budget. - */ - void (*put_budget)(struct request_queue *, int); - - /** - * @set_rq_budget_token: store rq's budget token - */ - void (*set_rq_budget_token)(struct request *, int); - /** - * @get_rq_budget_token: retrieve rq's budget token - */ - int (*get_rq_budget_token)(struct request *); + KABI_DEPRECATE_FN(void, put_budget, struct request_queue *)
/** * @timeout: Called on request timeout. @@ -420,10 +402,27 @@ struct blk_mq_ops { void (*show_rq)(struct seq_file *m, struct request *rq); #endif
- KABI_RESERVE(1) - KABI_RESERVE(2) - KABI_RESERVE(3) - KABI_RESERVE(4) + /** + * @set_rq_budget_token: store rq's budget token + */ + KABI_USE(1, void (*set_rq_budget_token)(struct request *, int)) + /** + * @get_rq_budget_token: retrieve rq's budget token + */ + KABI_USE(2, int (*get_rq_budget_token)(struct request *)) + + /** + * @get_budget: Reserve budget before queue request, once .queue_rq is + * run, it is driver's responsibility to release the + * reserved budget. Also we have to handle failure case + * of .get_budget for avoiding I/O deadlock. + */ + KABI_USE(3, int (*get_budget)(struct request_queue *)) + + /** + * @put_budget: Release the reserved budget. + */ + KABI_USE(4, void (*put_budget)(struct request_queue *, int)) KABI_RESERVE(5) KABI_RESERVE(6) KABI_RESERVE(7) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 49e238cd477e..6e5bbe1e7dfa 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -76,8 +76,6 @@ struct scsi_cmnd {
int eh_eflags; /* Used by error handlr */
- int budget_token; - /* * This is set to jiffies as it was when the command was first * allocated. It is used to time how long the command has @@ -146,7 +144,7 @@ struct scsi_cmnd { unsigned char tag; /* SCSI-II queued command tag */ unsigned int extra_len; /* length of alignment and padding */
- KABI_RESERVE(1) + KABI_USE(1, int budget_token) KABI_RESERVE(2) KABI_RESERVE(3) KABI_RESERVE(4)