Re: [PATCH] dm table: simplify discard support processing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/14/2011 04:30 PM, Mike Snitzer wrote:
> Remove 'discards_supported' from the dm_table structure.  The same
> information can be easily discovered from the table's target(s) in
> dm_table_supports_discards().
> 
> Also DMWARN if a target sets 'discards_supported' override but forgets
> to set 'num_discard_requests'.

Why not BUG_ON? It is bug in code on static attribute, isn't? :-)

> @@ -1426,6 +1422,9 @@ bool dm_table_supports_discards(struct dm_table *t)
>  	while (i < dm_table_get_num_targets(t)) {
>  		ti = dm_table_get_target(t, i++);
>  
> +		if (!ti->num_discard_requests)
> +			return 0;
> +		

>  		if (ti->discards_supported)
>  			return 1;

What if next target has ti->num_discard_requests = 0 here?
Shouldn't it loop through the all targets always?

Milan

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel


[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux