tr_raid5.c (256281) | tr_raid5.c (260385) |
---|---|
1/*- 2 * Copyright (c) 2012 Alexander Motin <mav@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2012 Alexander Motin <mav@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: stable/10/sys/geom/raid/tr_raid5.c 254275 2013-08-13 07:56:40Z mav $"); | 28__FBSDID("$FreeBSD: stable/10/sys/geom/raid/tr_raid5.c 260385 2014-01-07 01:32:23Z scottl $"); |
29 30#include <sys/param.h> 31#include <sys/bio.h> 32#include <sys/endian.h> 33#include <sys/kernel.h> 34#include <sys/kobj.h> 35#include <sys/limits.h> 36#include <sys/lock.h> --- 282 unchanged lines hidden (view full) --- 319 no += imax(0, pno + pdisks - vol->v_disks_count); 320 offset += strip_size; 321 } 322 } 323 remain -= length; 324 addr += length; 325 start = 0; 326 } while (remain > 0); | 29 30#include <sys/param.h> 31#include <sys/bio.h> 32#include <sys/endian.h> 33#include <sys/kernel.h> 34#include <sys/kobj.h> 35#include <sys/limits.h> 36#include <sys/lock.h> --- 282 unchanged lines hidden (view full) --- 319 no += imax(0, pno + pdisks - vol->v_disks_count); 320 offset += strip_size; 321 } 322 } 323 remain -= length; 324 addr += length; 325 start = 0; 326 } while (remain > 0); |
327 for (cbp = bioq_first(&queue); cbp != NULL; 328 cbp = bioq_first(&queue)) { 329 bioq_remove(&queue, cbp); | 327 while ((cbp = bioq_takefirst(&queue)) != NULL) { |
330 sd = cbp->bio_caller1; 331 cbp->bio_caller1 = NULL; 332 g_raid_subdisk_iostart(sd, cbp); 333 } 334 return; 335failure: | 328 sd = cbp->bio_caller1; 329 cbp->bio_caller1 = NULL; 330 g_raid_subdisk_iostart(sd, cbp); 331 } 332 return; 333failure: |
336 for (cbp = bioq_first(&queue); cbp != NULL; 337 cbp = bioq_first(&queue)) { 338 bioq_remove(&queue, cbp); | 334 while ((cbp = bioq_takefirst(&queue)) != NULL) |
339 g_destroy_bio(cbp); | 335 g_destroy_bio(cbp); |
340 } | |
341 if (bp->bio_error == 0) 342 bp->bio_error = ENOMEM; 343 g_raid_iodone(bp, bp->bio_error); 344} 345 346static void 347g_raid_tr_iostart_raid5(struct g_raid_tr_object *tr, struct bio *bp) 348{ --- 78 unchanged lines hidden --- | 336 if (bp->bio_error == 0) 337 bp->bio_error = ENOMEM; 338 g_raid_iodone(bp, bp->bio_error); 339} 340 341static void 342g_raid_tr_iostart_raid5(struct g_raid_tr_object *tr, struct bio *bp) 343{ --- 78 unchanged lines hidden --- |