summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2007-04-05 15:36:09 +0000
committerDavid Cantrell <dcantrell@redhat.com>2007-04-05 15:36:09 +0000
commit0d74d77e70caaf4175a64fd260cd90e654d35923 (patch)
tree77786c5ef0cb8e346861d29a0f0508555087d24d /isys
parentfe2aaafe66d7285f3cd25412d956a184957e5378 (diff)
downloadanaconda-0d74d77e70caaf4175a64fd260cd90e654d35923.tar.gz
anaconda-0d74d77e70caaf4175a64fd260cd90e654d35923.tar.xz
anaconda-0d74d77e70caaf4175a64fd260cd90e654d35923.zip
* isys/dasd.c: Condense read_vlabel() in to read_volume_label(), new
function is named read_vlabel(). Support reading FBA entries in addition to EKCD entries from /proc/dasd/devices.
Diffstat (limited to 'isys')
-rw-r--r--isys/dasd.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/isys/dasd.c b/isys/dasd.c
index 3dc98389b..6ad981830 100644
--- a/isys/dasd.c
+++ b/isys/dasd.c
@@ -24,28 +24,25 @@ typedef struct vtoc_volume_label volume_label_t;
#if defined(__s390__) || defined(__s390x__)
/* s390 stuff to detect DASDs */
-static int read_volume_label (int fd, unsigned long vlabel_start,
- volume_label_t *vlabel) {
+static int read_vlabel(dasd_information_t *dasd_info, int fd, int blksize,
+ volume_label_t *vlabel) {
int rc;
+ unsigned long vlabel_start = dasd_info->label_block * blksize;
+
+ memset(vlabel, 0, sizeof(volume_label_t));
+
if (lseek(fd, vlabel_start, SEEK_SET) < 0) {
/* fprintf(stderr, "Could not read volume label.\n"); */
return 2;
}
+
rc = read(fd, vlabel, sizeof(volume_label_t));
if (rc != sizeof(volume_label_t)) {
/* fprintf(stderr, "Could not read volume label, DASD is probably unformatted\n"); */
return 1;
}
- return 0;
-}
-static int read_vlabel(dasd_information_t *dasd_info, int fd, int blksize, volume_label_t *vlabel) {
- unsigned long pos;
-
- pos = dasd_info->label_block * blksize;
-
- memset(vlabel, 0, sizeof(volume_label_t));
- return read_volume_label(fd, pos, vlabel);
+ return 0;
}
#endif
@@ -123,7 +120,11 @@ char *getDasdPorts() {
if ((strstr(line, "unknown") != NULL)) {
continue;
}
- ret = sscanf (line, "%[A-Za-z.0-9](ECKD) at ( %*d: %*d) is %s : %*s", port, devname);
+ if (strstr(line, "(FBA )") != NULL) {
+ ret = sscanf (line, "%[A-Za-z.0-9](FBA ) at ( %*d: %*d) is %s : %*s", port, devname);
+ } else {
+ ret = sscanf (line, "%[A-Za-z.0-9](ECKD) at ( %*d: %*d) is %s : %*s", port, devname);
+ }
if (ret == 2) {
if(!ports) {
ports = (char *)malloc(strlen(port) + 1);