From ee105ed6f3e5aeef8b01944d8f81296f83e92ac2 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 21 Apr 2015 14:30:11 +0200 Subject: libfdisk: don't resize in label drivers The resize operation has to be implemented on upper layer. Signed-off-by: Karel Zak --- libfdisk/src/dos.c | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'libfdisk/src/dos.c') diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c index f2308e3e0..e5f708132 100644 --- a/libfdisk/src/dos.c +++ b/libfdisk/src/dos.c @@ -1897,7 +1897,6 @@ static int dos_get_partition(struct fdisk_context *cxt, size_t n, static int dos_set_partition(struct fdisk_context *cxt, size_t n, struct fdisk_partition *pa) { - struct fdisk_dos_label *l; struct dos_partition *p; struct pte *pe; fdisk_sector_t start, size; @@ -1919,7 +1918,6 @@ static int dos_set_partition(struct fdisk_context *cxt, size_t n, if (pa->type && !pa->type->code) fdisk_warnx(cxt, _("Type 0 means free space to many systems. " "Having partitions of type 0 is probably unwise.")); - l = self_label(cxt); p = self_partition(cxt, n); pe = self_pte(cxt, n); @@ -1931,31 +1929,6 @@ static int dos_set_partition(struct fdisk_context *cxt, size_t n, if (fdisk_partition_has_size(pa)) size = pa->size; - if (pa->end_follow_default) { - fdisk_sector_t first[cxt->label->nparts_max], - last[cxt->label->nparts_max], - xlast; - struct pte *ext = l->ext_offset ? self_pte(cxt, l->ext_index) : NULL; - - fill_bounds(cxt, first, last); - - if (ext && l->ext_offset) { - first[l->ext_index] = l->ext_offset; - last[l->ext_index] = get_abs_partition_end(ext); - } - if (FDISK_IS_UNDEF(start)) - start = get_abs_partition_start(pe); - - DBG(LABEL, ul_debug("DOS: #%zu now %ju +%ju sectors", - n, (uintmax_t) start, (uintmax_t) dos_partition_get_size(p))); - - xlast = get_unused_last(cxt, n, start, first, last); - size = xlast ? xlast - start + 1: dos_partition_get_size(p); - - DBG(LABEL, ul_debug("DOS: #%zu wanted %ju +%ju sectors", - n, (uintmax_t) start, (uintmax_t) size)); - } - if (!FDISK_IS_UNDEF(start) || !FDISK_IS_UNDEF(size)) { DBG(LABEL, ul_debug("DOS: resize partition")); -- cgit v1.2.3-55-g7522