linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blk-mq: fix the cmd_flag_name array
@ 2019-01-24 10:28 Jianchao Wang
  2019-01-24 15:09 ` Jeff Moyer
  2019-01-24 16:21 ` Jens Axboe
  0 siblings, 2 replies; 6+ messages in thread
From: Jianchao Wang @ 2019-01-24 10:28 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel

Swap REQ_NOWAIT and REQ_NOUNMAP and add REQ_HIPRI.

Signed-off-by: Jianchao Wang <jianchao.w.wang@oracle.com>
---
 block/blk-mq-debugfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index 90d6876..f812083 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -308,8 +308,9 @@ static const char *const cmd_flag_name[] = {
 	CMD_FLAG_NAME(PREFLUSH),
 	CMD_FLAG_NAME(RAHEAD),
 	CMD_FLAG_NAME(BACKGROUND),
-	CMD_FLAG_NAME(NOUNMAP),
 	CMD_FLAG_NAME(NOWAIT),
+	CMD_FLAG_NAME(NOUNMAP),
+	CMD_FLAG_NAME(HIPRI),
 };
 #undef CMD_FLAG_NAME
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] blk-mq: fix the cmd_flag_name array
  2019-01-24 10:28 [PATCH] blk-mq: fix the cmd_flag_name array Jianchao Wang
@ 2019-01-24 15:09 ` Jeff Moyer
  2019-01-24 16:22   ` Jens Axboe
  2019-01-24 16:21 ` Jens Axboe
  1 sibling, 1 reply; 6+ messages in thread
From: Jeff Moyer @ 2019-01-24 15:09 UTC (permalink / raw)
  To: Jianchao Wang; +Cc: axboe, linux-block, linux-kernel

Jianchao Wang <jianchao.w.wang@oracle.com> writes:

> Swap REQ_NOWAIT and REQ_NOUNMAP and add REQ_HIPRI.
>
> Signed-off-by: Jianchao Wang <jianchao.w.wang@oracle.com>
> ---
>  block/blk-mq-debugfs.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
> index 90d6876..f812083 100644
> --- a/block/blk-mq-debugfs.c
> +++ b/block/blk-mq-debugfs.c
> @@ -308,8 +308,9 @@ static const char *const cmd_flag_name[] = {
>  	CMD_FLAG_NAME(PREFLUSH),
>  	CMD_FLAG_NAME(RAHEAD),
>  	CMD_FLAG_NAME(BACKGROUND),
> -	CMD_FLAG_NAME(NOUNMAP),
>  	CMD_FLAG_NAME(NOWAIT),
> +	CMD_FLAG_NAME(NOUNMAP),
> +	CMD_FLAG_NAME(HIPRI),
>  };
>  #undef CMD_FLAG_NAME

Acked-by: Jeff Moyer <jmoyer@redhat.com>

You might consider also adding a comment above the req_flag_bits enum
noting that modifications also need to be propagated to cmd_flag_name.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] blk-mq: fix the cmd_flag_name array
  2019-01-24 10:28 [PATCH] blk-mq: fix the cmd_flag_name array Jianchao Wang
  2019-01-24 15:09 ` Jeff Moyer
@ 2019-01-24 16:21 ` Jens Axboe
  1 sibling, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2019-01-24 16:21 UTC (permalink / raw)
  To: Jianchao Wang; +Cc: linux-block, linux-kernel

On 1/24/19 3:28 AM, Jianchao Wang wrote:
> Swap REQ_NOWAIT and REQ_NOUNMAP and add REQ_HIPRI.

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] blk-mq: fix the cmd_flag_name array
  2019-01-24 15:09 ` Jeff Moyer
@ 2019-01-24 16:22   ` Jens Axboe
  2019-01-24 16:28     ` Bart Van Assche
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2019-01-24 16:22 UTC (permalink / raw)
  To: Jeff Moyer, Jianchao Wang; +Cc: linux-block, linux-kernel

On 1/24/19 8:09 AM, Jeff Moyer wrote:
> Jianchao Wang <jianchao.w.wang@oracle.com> writes:
> 
>> Swap REQ_NOWAIT and REQ_NOUNMAP and add REQ_HIPRI.
>>
>> Signed-off-by: Jianchao Wang <jianchao.w.wang@oracle.com>
>> ---
>>  block/blk-mq-debugfs.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
>> index 90d6876..f812083 100644
>> --- a/block/blk-mq-debugfs.c
>> +++ b/block/blk-mq-debugfs.c
>> @@ -308,8 +308,9 @@ static const char *const cmd_flag_name[] = {
>>  	CMD_FLAG_NAME(PREFLUSH),
>>  	CMD_FLAG_NAME(RAHEAD),
>>  	CMD_FLAG_NAME(BACKGROUND),
>> -	CMD_FLAG_NAME(NOUNMAP),
>>  	CMD_FLAG_NAME(NOWAIT),
>> +	CMD_FLAG_NAME(NOUNMAP),
>> +	CMD_FLAG_NAME(HIPRI),
>>  };
>>  #undef CMD_FLAG_NAME
> 
> Acked-by: Jeff Moyer <jmoyer@redhat.com>
> 
> You might consider also adding a comment above the req_flag_bits enum
> noting that modifications also need to be propagated to cmd_flag_name.

Agree... These things are notoriously difficult to keep in sync, this
isn't the first time we've had a fixup. Not sure if that situation
is improvable, but at least a comment might help.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] blk-mq: fix the cmd_flag_name array
  2019-01-24 16:22   ` Jens Axboe
@ 2019-01-24 16:28     ` Bart Van Assche
  2019-01-24 16:34       ` Jens Axboe
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Van Assche @ 2019-01-24 16:28 UTC (permalink / raw)
  To: Jens Axboe, Jeff Moyer, Jianchao Wang; +Cc: linux-block, linux-kernel

On Thu, 2019-01-24 at 09:22 -0700, Jens Axboe wrote:
> On 1/24/19 8:09 AM, Jeff Moyer wrote:
> > Jianchao Wang <jianchao.w.wang@oracle.com> writes:
> > 
> > > Swap REQ_NOWAIT and REQ_NOUNMAP and add REQ_HIPRI.
> > > 
> > > Signed-off-by: Jianchao Wang <jianchao.w.wang@oracle.com>
> > > ---
> > >  block/blk-mq-debugfs.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
> > > index 90d6876..f812083 100644
> > > --- a/block/blk-mq-debugfs.c
> > > +++ b/block/blk-mq-debugfs.c
> > > @@ -308,8 +308,9 @@ static const char *const cmd_flag_name[] = {
> > >  	CMD_FLAG_NAME(PREFLUSH),
> > >  	CMD_FLAG_NAME(RAHEAD),
> > >  	CMD_FLAG_NAME(BACKGROUND),
> > > -	CMD_FLAG_NAME(NOUNMAP),
> > >  	CMD_FLAG_NAME(NOWAIT),
> > > +	CMD_FLAG_NAME(NOUNMAP),
> > > +	CMD_FLAG_NAME(HIPRI),
> > >  };
> > >  #undef CMD_FLAG_NAME
> > 
> > Acked-by: Jeff Moyer <jmoyer@redhat.com>
> > 
> > You might consider also adding a comment above the req_flag_bits enum
> > noting that modifications also need to be propagated to cmd_flag_name.
> 
> Agree... These things are notoriously difficult to keep in sync, this
> isn't the first time we've had a fixup. Not sure if that situation
> is improvable, but at least a comment might help.

How about making the build system derive the CMD_FLAG_NAME() declarations
from the include/linux/blk* header files? It's not that hard to do that e.g.
with the help of sed. The output of sed could be written into a .h file and
that file could be #included from blk-mq-debugfs.c.

Bart.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] blk-mq: fix the cmd_flag_name array
  2019-01-24 16:28     ` Bart Van Assche
@ 2019-01-24 16:34       ` Jens Axboe
  0 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2019-01-24 16:34 UTC (permalink / raw)
  To: Bart Van Assche, Jeff Moyer, Jianchao Wang; +Cc: linux-block, linux-kernel

On 1/24/19 9:28 AM, Bart Van Assche wrote:
> On Thu, 2019-01-24 at 09:22 -0700, Jens Axboe wrote:
>> On 1/24/19 8:09 AM, Jeff Moyer wrote:
>>> Jianchao Wang <jianchao.w.wang@oracle.com> writes:
>>>
>>>> Swap REQ_NOWAIT and REQ_NOUNMAP and add REQ_HIPRI.
>>>>
>>>> Signed-off-by: Jianchao Wang <jianchao.w.wang@oracle.com>
>>>> ---
>>>>  block/blk-mq-debugfs.c | 3 ++-
>>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
>>>> index 90d6876..f812083 100644
>>>> --- a/block/blk-mq-debugfs.c
>>>> +++ b/block/blk-mq-debugfs.c
>>>> @@ -308,8 +308,9 @@ static const char *const cmd_flag_name[] = {
>>>>  	CMD_FLAG_NAME(PREFLUSH),
>>>>  	CMD_FLAG_NAME(RAHEAD),
>>>>  	CMD_FLAG_NAME(BACKGROUND),
>>>> -	CMD_FLAG_NAME(NOUNMAP),
>>>>  	CMD_FLAG_NAME(NOWAIT),
>>>> +	CMD_FLAG_NAME(NOUNMAP),
>>>> +	CMD_FLAG_NAME(HIPRI),
>>>>  };
>>>>  #undef CMD_FLAG_NAME
>>>
>>> Acked-by: Jeff Moyer <jmoyer@redhat.com>
>>>
>>> You might consider also adding a comment above the req_flag_bits enum
>>> noting that modifications also need to be propagated to cmd_flag_name.
>>
>> Agree... These things are notoriously difficult to keep in sync, this
>> isn't the first time we've had a fixup. Not sure if that situation
>> is improvable, but at least a comment might help.
> 
> How about making the build system derive the CMD_FLAG_NAME() declarations
> from the include/linux/blk* header files? It's not that hard to do that e.g.
> with the help of sed. The output of sed could be written into a .h file and
> that file could be #included from blk-mq-debugfs.c.

I'd be fine with that, if we already require sed for building other parts.
If it can't be handled with pre processor macros or similar.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-01-24 16:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-24 10:28 [PATCH] blk-mq: fix the cmd_flag_name array Jianchao Wang
2019-01-24 15:09 ` Jeff Moyer
2019-01-24 16:22   ` Jens Axboe
2019-01-24 16:28     ` Bart Van Assche
2019-01-24 16:34       ` Jens Axboe
2019-01-24 16:21 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).