summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNageswara R Sastry <rnsastry@linux.vnet.ibm.com>2013-08-21 16:37:17 -0700
committerBrian C. Lane <bcl@redhat.com>2014-04-29 11:42:25 -0700
commitbdb439f660344404f27084c48fe7b9429436b9e9 (patch)
tree6b53b7a82a5ac9d85a39eae2d771412d38542f8e
parent0673dabee6f5b19317b0d85e399e9f876a2c2ea7 (diff)
downloadparted-bdb439f660344404f27084c48fe7b9429436b9e9.tar.gz
libparted: mklabel to support EDEV DASD
Fixed Block Access (FBA) DASDs are mainframe-specific disk devices which are layed out as a sequence of 512-byte sectors. This patch adds support for mklabel to properly handle FBA devices. Signed-off-by: Nageswara R Sastry <rnsastry@linux.vnet.ibm.com>
-rw-r--r--libparted/labels/fdasd.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c
index 7de5f34..1f87937 100644
--- a/libparted/labels/fdasd.c
+++ b/libparted/labels/fdasd.c
@@ -870,19 +870,21 @@ fdasd_check_volume (fdasd_anchor_t *anc, int fd)
vtoc_read_volume_label (fd, anc->label_pos, v);
if (strncmp(v->vollbl, vtoc_ebcdic_enc ("VOL1", str, 4), 4) == 0) {
- /* found VOL1 volume label */
- b = (cchhb2blk (&v->vtoc, &anc->geo) - 1) * anc->blksize;
-
- if (b > 0) {
- int rc;
- rc = fdasd_valid_vtoc_pointer (anc, b, fd);
-
- if (rc < 0)
- return 1;
- else
- return 0;
- } else {
- fdasd_invalid_vtoc_pointer(anc);
+ if (anc->FBA_layout != 1 ) {
+ /* found VOL1 volume label */
+ b = (cchhb2blk (&v->vtoc, &anc->geo) - 1) * anc->blksize;
+
+ if (b > 0) {
+ int rc;
+ rc = fdasd_valid_vtoc_pointer (anc, b, fd);
+
+ if (rc < 0)
+ return 1;
+ else
+ return 0;
+ } else {
+ fdasd_invalid_vtoc_pointer(anc);
+ }
}
} else if (strncmp (v->volkey, vtoc_ebcdic_enc ("LNX1", str, 4), 4) == 0 ||
strncmp (v->volkey, vtoc_ebcdic_enc ("CMS1", str, 4), 4) == 0) {