Re: [PATCH BUGFIX] block: make elevator_get robust against cross blk/blk-mq choice
flat view
From: Bart Van Assche <hidden>
Date: 2017-02-13 21:14:13
Also in:
lkml
On Mon, 2017-02-13 at 22:01 +0100, Paolo Valente wrote:
-static struct elevator_type *elevator_get(const char *name, bool try_loa=
ding)
+static struct elevator_type *elevator_get(const char *name, bool try_loa=
ding,
+ bool mq_ops)
Please choose a better name for that argument, e.q. "mq". To me the name "m= q_ops" means "a pointer to a data structure with operation function pointers".
quoted hunk ↗ jump to hunk
+ if (e && (e->uses_mq !=3D mq_ops)) { + pr_err("ERROR: attempted to choose %s %s I/O scheduler in blk%s", + name, e->uses_mq ? "blk-mq" : "legacy", mq_ops ? "-mq" : ""); + e =3D NULL; + }
How about changing the above into:
+=A0=A0=A0=A0=A0=A0=A0if (e && e->uses_mq !=3D mq) {
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0pr_err("ERROR: attempt to con=
figure %s as I/O scheduler for a %s queue\n",
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0name, mq=
? "blk-mq" : "legacy");
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0e =3D NULL;
+=A0=A0=A0=A0=A0=A0=A0}
Thanks,
Bart.
Western Digital Corporation (and its subsidiaries) E-mail Confidentiality N=
otice & Disclaimer:
This e-mail and any files transmitted with it may contain confidential or l=
egally privileged information of WDC and/or its affiliates, and are intende=
d solely for the use of the individual or entity to which they are addresse=
d. If you are not the intended recipient, any disclosure, copying, distribu=
tion or any action taken or omitted to be taken in reliance on it, is prohi=
bited. If you have received this e-mail in error, please notify the sender =
immediately and delete the e-mail in its entirety from your system.