md: raid5: change incorrect usage of 'min' macro to 'min_t'
authorNeilBrown <neilb@suse.de>
Wed, 27 May 2009 11:39:05 +0000 (21:39 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 27 May 2009 11:39:05 +0000 (21:39 +1000)
A recent patch to raid5.c use min on an int and a sector_t.
This isn't allowed.
So change it to min_t(sector_t,x,y).

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c

index 3c3626d2a1f9fe7a616bf84626a39593a56c2f84..5d400aef8d9b40f9ec0a58749037bcbbf61977df 100644 (file)
@@ -3811,13 +3811,13 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped
        safepos = conf->reshape_safe;
        sector_div(safepos, data_disks);
        if (mddev->delta_disks < 0) {
-               writepos -= min(reshape_sectors, writepos);
+               writepos -= min_t(sector_t, reshape_sectors, writepos);
                readpos += reshape_sectors;
                safepos += reshape_sectors;
        } else {
                writepos += reshape_sectors;
-               readpos -= min(reshape_sectors, readpos);
-               safepos -= min(reshape_sectors, safepos);
+               readpos -= min_t(sector_t, reshape_sectors, readpos);
+               safepos -= min_t(sector_t, reshape_sectors, safepos);
        }
 
        /* 'writepos' is the most advanced device address we might write.