diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2008-10-21 17:44:57 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2008-10-21 17:44:57 +0100 |
commit | d63a5ce3c0d25c96bdadc78792e5b48b846e899d (patch) | |
tree | ac46375b47f784dff17d1e657d5115b45ad86844 /include/linux | |
parent | 7acedc5b98a2fcff64f00c21110aae7d3ac2f7df (diff) | |
download | linux-3.10-d63a5ce3c0d25c96bdadc78792e5b48b846e899d.tar.gz linux-3.10-d63a5ce3c0d25c96bdadc78792e5b48b846e899d.tar.bz2 linux-3.10-d63a5ce3c0d25c96bdadc78792e5b48b846e899d.zip |
dm: publish array_too_big
Move array_too_big to include/linux/device-mapper.h because it is
used by targets.
Remove the test from dm-raid1 as the number of mirror legs is limited
such that it can never fail. (Even for stripes it seems rather
unlikely.)
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/device-mapper.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 08d783592b7..dfb30db475e 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -354,6 +354,9 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size); */ #define dm_round_up(n, sz) (dm_div_up((n), (sz)) * (sz)) +#define dm_array_too_big(fixed, obj, num) \ + ((num) > (UINT_MAX - (fixed)) / (obj)) + static inline sector_t to_sector(unsigned long n) { return (n >> SECTOR_SHIFT); |