g_part_ldm.c (298354) | g_part_ldm.c (298649) |
---|---|
1/*- 2 * Copyright (c) 2012 Andrey V. Elsukov <ae@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 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2012 Andrey V. Elsukov <ae@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 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/geom/part/g_part_ldm.c 298354 2016-04-20 16:19:44Z pfg $"); | 28__FBSDID("$FreeBSD: head/sys/geom/part/g_part_ldm.c 298649 2016-04-26 15:38:17Z pfg $"); |
29 30#include <sys/param.h> 31#include <sys/bio.h> 32#include <sys/diskmbr.h> 33#include <sys/endian.h> 34#include <sys/gpt.h> 35#include <sys/kernel.h> 36#include <sys/kobj.h> --- 971 unchanged lines hidden (view full) --- 1008 struct ldm_component *comp; 1009 struct ldm_vblkhdr vh; 1010 u_char *buf, *p; 1011 size_t size, n, sectors; 1012 uint64_t offset; 1013 int error; 1014 1015 pp = cp->provider; | 29 30#include <sys/param.h> 31#include <sys/bio.h> 32#include <sys/diskmbr.h> 33#include <sys/endian.h> 34#include <sys/gpt.h> 35#include <sys/kernel.h> 36#include <sys/kobj.h> --- 971 unchanged lines hidden (view full) --- 1008 struct ldm_component *comp; 1009 struct ldm_vblkhdr vh; 1010 u_char *buf, *p; 1011 size_t size, n, sectors; 1012 uint64_t offset; 1013 int error; 1014 1015 pp = cp->provider; |
1016 size = (db->dh.last_seq * db->dh.size + 1017 pp->sectorsize - 1) / pp->sectorsize; | 1016 size = howmany(db->dh.last_seq * db->dh.size, pp->sectorsize); |
1018 size -= 1; /* one sector takes vmdb header */ 1019 for (n = 0; n < size; n += MAXPHYS / pp->sectorsize) { 1020 offset = db->ph.db_offset + db->th.conf_offset + n + 1; 1021 sectors = (size - n) > (MAXPHYS / pp->sectorsize) ? 1022 MAXPHYS / pp->sectorsize: size - n; 1023 /* read VBLKs */ 1024 buf = g_read_data(cp, offset * pp->sectorsize, 1025 sectors * pp->sectorsize, &error); --- 458 unchanged lines hidden --- | 1017 size -= 1; /* one sector takes vmdb header */ 1018 for (n = 0; n < size; n += MAXPHYS / pp->sectorsize) { 1019 offset = db->ph.db_offset + db->th.conf_offset + n + 1; 1020 sectors = (size - n) > (MAXPHYS / pp->sectorsize) ? 1021 MAXPHYS / pp->sectorsize: size - n; 1022 /* read VBLKs */ 1023 buf = g_read_data(cp, offset * pp->sectorsize, 1024 sectors * pp->sectorsize, &error); --- 458 unchanged lines hidden --- |