* [PATCH] dm: Change return type of pg_init_all_paths() from int into void
@ 2016-09-30 17:44 Bart Van Assche
2016-10-01 7:53 ` Hannes Reinecke
0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2016-09-30 17:44 UTC (permalink / raw)
To: Mike Snitzer; +Cc: device-mapper development
None of the callers of pg_init_all_paths() check its return value.
Hence change the return type of pg_init_all_paths() from int into
void.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
---
drivers/md/dm-mpath.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index dd66653..8e2341d 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -378,16 +378,13 @@ static int __pg_init_all_paths(struct multipath *m)
return atomic_read(&m->pg_init_in_progress);
}
-static int pg_init_all_paths(struct multipath *m)
+static void pg_init_all_paths(struct multipath *m)
{
- int r;
unsigned long flags;
spin_lock_irqsave(&m->lock, flags);
- r = __pg_init_all_paths(m);
+ __pg_init_all_paths(m);
spin_unlock_irqrestore(&m->lock, flags);
-
- return r;
}
static void __switch_pg(struct multipath *m, struct priority_group *pg)
--
2.10.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] dm: Change return type of pg_init_all_paths() from int into void
2016-09-30 17:44 [PATCH] dm: Change return type of pg_init_all_paths() from int into void Bart Van Assche
@ 2016-10-01 7:53 ` Hannes Reinecke
2016-10-01 15:30 ` Bart Van Assche
0 siblings, 1 reply; 3+ messages in thread
From: Hannes Reinecke @ 2016-10-01 7:53 UTC (permalink / raw)
To: dm-devel
On 09/30/2016 07:44 PM, Bart Van Assche wrote:
> None of the callers of pg_init_all_paths() check its return value.
> Hence change the return type of pg_init_all_paths() from int into
> void.
>
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> ---
> drivers/md/dm-mpath.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
> index dd66653..8e2341d 100644
> --- a/drivers/md/dm-mpath.c
> +++ b/drivers/md/dm-mpath.c
> @@ -378,16 +378,13 @@ static int __pg_init_all_paths(struct multipath *m)
> return atomic_read(&m->pg_init_in_progress);
> }
>
> -static int pg_init_all_paths(struct multipath *m)
> +static void pg_init_all_paths(struct multipath *m)
> {
> - int r;
> unsigned long flags;
>
> spin_lock_irqsave(&m->lock, flags);
> - r = __pg_init_all_paths(m);
> + __pg_init_all_paths(m);
> spin_unlock_irqrestore(&m->lock, flags);
> -
> - return r;
> }
>
> static void __switch_pg(struct multipath *m, struct priority_group *pg)
>
Hmm. But this would invalidate your earlier patch, now would it not?
And at least in my code we _do_ check the return value in
pg_init_done(), and it's return value is used to check if we need to
wake up for submitting waiting I/O.
Which tree is the patch made against?
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dm: Change return type of pg_init_all_paths() from int into void
2016-10-01 7:53 ` Hannes Reinecke
@ 2016-10-01 15:30 ` Bart Van Assche
0 siblings, 0 replies; 3+ messages in thread
From: Bart Van Assche @ 2016-10-01 15:30 UTC (permalink / raw)
To: Hannes Reinecke; +Cc: dm-devel, Mike Snitzer
On 10/01/16 00:53, Hannes Reinecke wrote:
> On 09/30/2016 07:44 PM, Bart Van Assche wrote:
>> None of the callers of pg_init_all_paths() check its return value.
>> Hence change the return type of pg_init_all_paths() from int into
>> void.
>>
>> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
>> ---
>> drivers/md/dm-mpath.c | 7 ++-----
>> 1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
>> index dd66653..8e2341d 100644
>> --- a/drivers/md/dm-mpath.c
>> +++ b/drivers/md/dm-mpath.c
>> @@ -378,16 +378,13 @@ static int __pg_init_all_paths(struct multipath *m)
>> return atomic_read(&m->pg_init_in_progress);
>> }
>>
>> -static int pg_init_all_paths(struct multipath *m)
>> +static void pg_init_all_paths(struct multipath *m)
>> {
>> - int r;
>> unsigned long flags;
>>
>> spin_lock_irqsave(&m->lock, flags);
>> - r = __pg_init_all_paths(m);
>> + __pg_init_all_paths(m);
>> spin_unlock_irqrestore(&m->lock, flags);
>> -
>> - return r;
>> }
>>
>> static void __switch_pg(struct multipath *m, struct priority_group *pg)
>>
> Hmm. But this would invalidate your earlier patch, now would it not?
>
> And at least in my code we _do_ check the return value in
> pg_init_done(), and it's return value is used to check if we need to
> wake up for submitting waiting I/O.
>
> Which tree is the patch made against?
Hello Hannes,
This patch applies on top of kernel v4.8-rc8. In that kernel version the
return value of __pg_init_all_paths() is used but the return value of
pg_init_all_paths() is not used by any caller.
Bart.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-01 15:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-30 17:44 [PATCH] dm: Change return type of pg_init_all_paths() from int into void Bart Van Assche
2016-10-01 7:53 ` Hannes Reinecke
2016-10-01 15:30 ` Bart Van Assche
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.