tech-userlevel archive

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

Re: fs-independent quotas



On 21 October 2011 12:35, Manuel Bouyer <bouyer%antioche.eu.org@localhost> 
wrote:
> On Fri, Oct 21, 2011 at 12:03:25PM +0200, Michal Suchanek wrote:
>> By the same token you can say that the hierarchy starts at type
>> because block quota is different from file quota and only within the
>> same quota type the (class,id) pair is unique but that's all grafting
>> artifical hierarchy to a simple table.
>
> OK, you can represent it as a simple table for a given filesystem.
> But then you may have a different format for different filesystems.
> With a hierarchical, or multidimensional array representation, you have

A multidimensional array is in my book a uniform and non-sparse structure.

That is it has n indexes with the i-th index having the same type
across all of the array and any combination of n valid indexes
referencing an actual cell which is of the same type across all of the
array and always present even if not used by the current operation.
Then this array like the table is specific to each filesystem.

Yes, you can emulate something that looks on the surface like an array
with some kind of dictionary tree which can be non-uniform and sparse
and whatnot but it's no longer an array.

The dictionary tree may wrap disparate values and index types across
filesystems into a single dynamically typed structure but to work with
the structure you still need to handle the disparate types and
indexes, they are just hidden inside something else.

When this is represented as a proplib blob transferring the blob
always succeeds but parsing the blob requires that the application
parsing the blob be aware of the api version of the blob, same as it
would need to be aware of api version of the binary table if it was
transferred unwrapped by the syscall.

That you can make some sense of the proplib data by looking at it in
vim is paid by numerous conversion dances in the kernel and userland
tools. In the end the tools will be broken if the api version does not
match one way or another, and you can make sense of the binary blob by
looking in the header where it is described, too.

I don't expect that results of a syscall be feed directly to vim on
regular basis. Indeed, you still have to write some code to perform
the syscall in the first place so you can as well add a few lines that
print struct fields.

> and this makes your table space as sparse as a multidimentionnal array,
> as not all the type,class,id combination make sense.

It is not. It assigns values to keys, not all keys need be present in the table.

Thanks

Michal


Home | Main Index | Thread Index | Old Index