]> err.no Git - util-linux/commitdiff
blkid: blkdev size fallback
authorKarel Zak <kzak@redhat.com>
Tue, 9 Sep 2008 10:36:00 +0000 (12:36 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Feb 2009 22:21:44 +0000 (23:21 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libs/blkid/src/Makefile.am
libs/blkid/src/probe.c
libs/blkid/src/probers/probers.h

index e9b782fd6663af5c28bb292faf6c817a320dbec2..271ce69b9990caa0f198a07a23634a990ac5c700 100644 (file)
@@ -10,7 +10,8 @@ probers = prober-cramfs.c
 lib_LIBRARIES = libblkid.a
 libblkid_a_SOURCES = cache.c dev.c devname.c devno.c getsize.c llseek.c  \
                     probe.c read.c resolve.c save.c tag.c version.c verify.c \
-                    blkid.h blkidP.h list.h blkid_types.h probers/probers.h
+                    blkid.h blkidP.h list.h blkid_types.h probers/probers.h \
+                    $(top_srcdir)/lib/blkdev.c $(top_srcdir)/lib/linux_version.c
 libblkid_a_LIBADD = probers/libprobers.a
 libblkid_a_CFLAGS = -fPIC
 
index 8f1b8ffd2ae55b5ad70c966c71e954113a2e3b11..4f99d088769ece213dd8bc168e827cddf98c8b40 100644 (file)
@@ -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))
index 83012b934d0298a0033f8e5657efdde97f1f4dee..694672c2c018b0a70146fff199b73bc2cb696609 100644 (file)
@@ -21,8 +21,8 @@ extern const struct blkid_idinfo swsuspend_idinfo;
 extern const struct blkid_idinfo adraid_idinfo;
 extern const struct blkid_idinfo ddfraid_idinfo;
 extern const struct blkid_idinfo iswraid_idinfo;
-extern const struct blkid_idinfo jmicron_idinfo;
-extern const struct blkid_idinfo lsi_idinfo;
+extern const struct blkid_idinfo jmraid_idinfo;
+extern const struct blkid_idinfo lsiraid_idinfo;
 extern const struct blkid_idinfo nvraid_idinfo;
 extern const struct blkid_idinfo pdcraid_idinfo;
 extern const struct blkid_idinfo silraid_idinfo;