[dm-devel] [RFC][PATCH] Simplify dm_get_device restriction combining

Mike Christie mikenc at us.ibm.com
Tue Jan 20 14:09:02 UTC 2004


Christophe Saout wrote:
> Hi,
> 
> I know this doesn't make the problem go away, but it looks much simpler
> this way and removes unnecessary code duplication:
> 
>  
> -		rs->max_phys_segments =
> -			min_not_zero(rs->max_phys_segments,
> -				     q->max_phys_segments);
> -
> -		rs->max_hw_segments =
> -			min_not_zero(rs->max_hw_segments, q->max_hw_segments);
> -
> -		rs->hardsect_size = max(rs->hardsect_size, q->hardsect_size);
> -
> -		rs->max_segment_size =
> -			min_not_zero(rs->max_segment_size, q->max_segment_size);
> -
> -		rs->seg_boundary_mask =
> -			min_not_zero(rs->seg_boundary_mask,
> -				     q->seg_boundary_mask);
> +		/*
> +		 * Combine the device limits low.
> +		 */
> +		combine_restrictions_low(lrs, &hrs);
>  	}


If you want to remove even more code duplication, could dm use 
blk_queue_stack_limits? The only major difference seems to be that 
combine_restrictions_low copies seg_boundary_mask and 
blk_queue_stack_limits doesn't.

Mike




More information about the dm-devel mailing list