[klibc] Add swap support to fstype, second version

H. Peter Anvin hpa at zytor.com
Tue Feb 7 08:58:23 PST 2006


Kay Sievers wrote:
> On Tue, Feb 07, 2006 at 08:40:46AM -0800, H. Peter Anvin wrote:
> 
>>Kay Sievers wrote:
>>
>>>>Looked at this from a technical perspective; one thing kinit needs is to 
>>>>be able to query the size of the filesystem from the data, as opposed 
>>>
>>>>from the block size.
>>>
>>>The size is just a value that is passed to the lib. The lib itself wants
>>>the volume size in bytes.
>>>
>>
>>No, the point is that for kinit, size needs to be an *output*.
> 
> 
> Ah ok, you mean the udev tool: "vol_id". We could add that easily to
> that tool. It currently looks like this:
> 
>   $ /sbin/vol_id --export /dev/sda10
>   ID_FS_USAGE=filesystem
>   ID_FS_TYPE=ext3
>   ID_FS_VERSION=1.0
>   ID_FS_UUID=c91a0acb-effc-4358-8b3e-f3cd145e1ead
>   ID_FS_LABEL=work
> 
> Or just make use of the lib in your current tool.
> 

No, in the lib, the size is only derived from the BLKGETSIZE64 ioctl. 
The point is that it needs to be obtained from the filesystem 
superblock, without any reference to the size (or lack thereof) of the 
underlying medium.

> 
> Fine, I can do this. Currently I have all individual probing functions
> exported to be able to call them individually. What do you think? Is the
> table driven model nicer to use?
> 

I don't think it matters much if they're grouped in a function or 
grouped in a table.  The function will be faster on some architectures, 
but might require less I/O.

	-hpa



More information about the klibc mailing list