* [PATCH] block: use min_not_zero in blk_queue_stack_limits
@ 2008-12-04 6:32 FUJITA Tomonori
2008-12-04 7:56 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: FUJITA Tomonori @ 2008-12-04 6:32 UTC (permalink / raw)
To: jens.axboe; +Cc: linux-kernel
This is against for-2.6.29 in the block tree.
=
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: [PATCH] block: use min_not_zero in blk_queue_stack_limits
zero is invalid for max_phys_segments, max_hw_segments, and
max_segment_size. It's better to use use min_not_zero instead of
min. min() works though (because the commit 0e435ac makes sure that
these values are set to the default values, non zero, if a queue is
initialized properly).
With this patch, blk_queue_stack_limits does the almost same thing
that dm's combine_restrictions_low() does. I think that it's easy to
remove dm's combine_restrictions_low.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
block/blk-settings.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/blk-settings.c b/block/blk-settings.c
index afa55e1..59fd05d 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -319,9 +319,9 @@ void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b)
t->max_hw_sectors = min_not_zero(t->max_hw_sectors, b->max_hw_sectors);
t->seg_boundary_mask = min_not_zero(t->seg_boundary_mask, b->seg_boundary_mask);
- t->max_phys_segments = min(t->max_phys_segments, b->max_phys_segments);
- t->max_hw_segments = min(t->max_hw_segments, b->max_hw_segments);
- t->max_segment_size = min(t->max_segment_size, b->max_segment_size);
+ t->max_phys_segments = min_not_zero(t->max_phys_segments, b->max_phys_segments);
+ t->max_hw_segments = min_not_zero(t->max_hw_segments, b->max_hw_segments);
+ t->max_segment_size = min_not_zero(t->max_segment_size, b->max_segment_size);
t->hardsect_size = max(t->hardsect_size, b->hardsect_size);
if (!t->queue_lock)
WARN_ON_ONCE(1);
--
1.5.5.GIT
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] block: use min_not_zero in blk_queue_stack_limits
2008-12-04 6:32 [PATCH] block: use min_not_zero in blk_queue_stack_limits FUJITA Tomonori
@ 2008-12-04 7:56 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2008-12-04 7:56 UTC (permalink / raw)
To: FUJITA Tomonori; +Cc: linux-kernel
On Thu, Dec 04 2008, FUJITA Tomonori wrote:
> This is against for-2.6.29 in the block tree.
> =
> From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Subject: [PATCH] block: use min_not_zero in blk_queue_stack_limits
>
> zero is invalid for max_phys_segments, max_hw_segments, and
> max_segment_size. It's better to use use min_not_zero instead of
> min. min() works though (because the commit 0e435ac makes sure that
> these values are set to the default values, non zero, if a queue is
> initialized properly).
>
> With this patch, blk_queue_stack_limits does the almost same thing
> that dm's combine_restrictions_low() does. I think that it's easy to
> remove dm's combine_restrictions_low.
Queued up for 2.6.29. It would be nice to get rid of the dm mirror of
this function...
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-12-04 7:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-04 6:32 [PATCH] block: use min_not_zero in blk_queue_stack_limits FUJITA Tomonori
2008-12-04 7:56 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox