diff options
author | Karel Zak | 2008-09-09 12:36:00 +0200 |
---|---|---|
committer | Karel Zak | 2009-02-11 23:21:44 +0100 |
commit | dc61d909a950e70b10180e5b2ef6e315043a2be2 (patch) | |
tree | 92da9bfa32725a4f0c123215028c922888b73639 /libs/blkid/src/probe.c | |
parent | blkid: add Linux RAID (diff) | |
download | kernel-qcow2-util-linux-dc61d909a950e70b10180e5b2ef6e315043a2be2.tar.gz kernel-qcow2-util-linux-dc61d909a950e70b10180e5b2ef6e315043a2be2.tar.xz kernel-qcow2-util-linux-dc61d909a950e70b10180e5b2ef6e315043a2be2.zip |
blkid: blkdev size fallback
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libs/blkid/src/probe.c')
-rw-r--r-- | libs/blkid/src/probe.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libs/blkid/src/probe.c b/libs/blkid/src/probe.c index 8f1b8ffd2..4f99d0887 100644 --- a/libs/blkid/src/probe.c +++ b/libs/blkid/src/probe.c @@ -30,6 +30,7 @@ #endif #include <stdarg.h> +#include "blkdev.h" #include "blkidP.h" #include "probers/probers.h" @@ -41,8 +42,8 @@ static const struct blkid_idinfo *idinfos[] = &adraid_idinfo, &ddfraid_idinfo, &iswraid_idinfo, - &jmicron_idinfo, - &lsi_idinfo, + &jmraid_idinfo, + &lsiraid_idinfo, &nvraid_idinfo, &pdcraid_idinfo, &silraid_idinfo, @@ -215,7 +216,11 @@ int blkid_probe_set_device(blkid_probe pr, int fd, pr->fd = fd; pr->off = off; - pr->size = size; + + if (!size) + blkdev_get_size(fd, (unsigned long long *) &pr->size); + else + pr->size = size; /* read SB to test if the device is readable */ if (!blkid_probe_get_buffer(pr, 0, 0x200)) |