Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\elevator.c Create Date:2022-07-28 16:58:01
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:elevator_switch_mq

Proto:int elevator_switch_mq(struct request_queue *q, struct elevator_type *new_e)

Type:int

Parameter:

TypeParameterName
struct request_queue *q
struct elevator_type *new_e
586  lockdep_assert_held( & sysfs_lock)
588  If elevator Then
589  If registered Then lv_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  If ret Then Go to out
600  If new_e Then
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  If ret Then
604  Go to out
608  If new_e Then blk_add_trace_msg(q, "elv switch: %s", elevator_name)
610  Else blk_add_trace_msg(q, "elv switch: none")
613  out :
614  Return ret
Caller
NameDescribe
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