函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\elevator.c Create Date:2022-07-27 18:33:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:elevator_switch_mq

函数原型:int elevator_switch_mq(struct request_queue *q, struct elevator_type *new_e)

返回类型:int

参数:

类型参数名称
struct request_queue *q
struct elevator_type *new_e
586  lockdep_assert_held( & sysfs_lock)
588  如果elevator
589  如果registeredlv_unregister_queue is called from either blk_unregister_queue or* elevator_switch, elevator switch is prevented from being happen* in the two paths, so it is safe to not hold q->sysfs_lock.
592  ioc_clear_queue(q)
593  elevator_exit(q, elevator)
596  ret等于blk_mq_init_sched(q, new_e)
597  如果ret则转到:out
600  如果new_e
601  ret等于lv_register_queue is called from either blk_register_queue or* elevator_switch, elevator switch is prevented from being happen* in the two paths, so it is safe to not hold q->sysfs_lock.
602  如果ret
604  转到:out
608  如果new_eblk_add_trace_msg(q, "elv switch: %s", elevator_name)
610  否则blk_add_trace_msg(q, "elv switch: none")
613  out :
614  返回:ret
调用者
名称描述
elevator_switchswitch to new_e io scheduler. be careful not to introduce deadlocks -* we don't free the old io scheduler, before we have allocated what we* need for the new one. this way we have a chance of going back to the old
blk_mq_elv_switch_noneCache the elevator_type in qe pair list and switch the* io scheduler to 'none'
blk_mq_elv_switch_back