Re: [PATCH, RFC] libblkid: start adding I/O topology support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 20, 2009 at 12:32:44AM +0200, Christoph Hellwig wrote:
> This patch is a first draft at adding support for the sysfs I/O

 thanks

> topologies exported by kernels 2.6.30 or newer.  The parsing code is
> taken straight from patches that Mike Snitzer sent to the LVM list.
> 
> Right now we only add the attributes to the tags, as a demonstration
> how it this can be embedded into libblkid.  Unfortunately that
> meanso

 we have to integrate this to the low-level probing interface
 (blkid_do_[safe]prob() functions). I'll try it this week.

> We will have to add lowlevel probing functions for these
> tools which could also return the information in binary format
> instead of having to go to and back from ASCII for the tagged format.

 hmm.. currently, the API is completely based on strings, so you have 
 to call:

    char *data;
    unsigned long x;

    blkid_probe_set_device(pr, device_fd, 0, 0);
    blkid_do_probe(pr);
    blkid_probe_lookup_value(pr, "ALIGNMENT_OFFSET", &data, NULL);

    x = strtoul(data, NULL, 10);


 .. but for partitions parsing code we will probably also need some
 binary interface. Maybe something like:

    blkid_probe_enable_binary(pr);
    blkid_do_probe(pr);

    x = blkid_probe_lookup_ulong(pr, "ALIGNMENT_OFFSET");

 and internally store the values as unsigned long integers.

 The high-level interface (tags, -- e.g. blkid_get_tag_value()) is
 probably better to keep based on strings only.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux