use util-linux-ng's libblkid instead of libvolume_id
Karel Zak
kzak at redhat.com
Thu Mar 26 14:31:18 PDT 2009
Good work, the patch looks good. Few nits:
On Thu, Mar 26, 2009 at 05:10:57PM +0100, Kay Sievers wrote:
> +blkid_module="blkid >= 1.99"
I'm not sure if this is really the final blkid version number for
util-linux-v2.15. I need to talk about it with Ted -- unfortunately
he is probably too busy now... (The current version in e2fsprogs is 1.41
and I hope this version will be freezed -- in such case we can use
something better than 1.99 -- for example 1.43 or so.)
> +#include <blkid/blkid.h>
This is correct, but I'd suggest to use <blkid.h> and proper "-I" gcc
option (pkg-config blkid --cflags).
> + if (blkid_probe_lookup_value (pr, "USAGE", &usage, &len) == 0 &&
the "len" is optional, you can use NULL.
> + blkid_probe_set_device (pr, fd, vol_probe_offset, vol_size);
Please, test return code. This function reads 512 bytes from the
device and the read() can fail.
Note that you needn't to set volume size, that's optional, the
library can internally ask for BLKGETSIZE64.
Karel
--
Karel Zak <kzak at redhat.com>
More information about the hal
mailing list