Revision 77be4366
b/block.c | ||
---|---|---|
1929 | 1929 |
|
1930 | 1930 |
static int multiwrite_req_compare(const void *a, const void *b) |
1931 | 1931 |
{ |
1932 |
return (((BlockRequest*) a)->sector - ((BlockRequest*) b)->sector); |
|
1932 |
const BlockRequest *req1 = a, *req2 = b; |
|
1933 |
|
|
1934 |
/* |
|
1935 |
* Note that we can't simply subtract req2->sector from req1->sector |
|
1936 |
* here as that could overflow the return value. |
|
1937 |
*/ |
|
1938 |
if (req1->sector > req2->sector) { |
|
1939 |
return 1; |
|
1940 |
} else if (req1->sector < req2->sector) { |
|
1941 |
return -1; |
|
1942 |
} else { |
|
1943 |
return 0; |
|
1944 |
} |
|
1933 | 1945 |
} |
1934 | 1946 |
|
1935 | 1947 |
/* |
Also available in: Unified diff