Re: [PATCH 03/10] AXFS: axfs.h

Arnd Bergmann
2008-08-21T12:24:33Z

On Thursday 21 August 2008, Jared Hulbert wrote:
> +static inline u64 axfs_bytetable_stitch(u8 depth, u8 *table, u64 index)
> +{
> +       u64 i;
> +       u64 output = 0;
> +       u64 byte = 0;
> +       u64 j;
> +       u64 bits;
> +
> +       for (i = 0; i < depth; i++) {
> +               j = index * depth + i;
> +               bits = 8 * (depth - i - 1);
> +               byte = table[j];
> +               output += byte << bits;
> +       }
> +       return output;
> +}
> +
> +#define AXFS_GET_BYTETABLE_VAL(desc,index) \
> +  axfs_bytetable_stitch(((struct axfs_region_desc)(desc)).table_byte_depth,\
> +  (u8 *)((struct axfs_region_desc)(desc)).virt_addr, index)
> +

This bytetable stuff looks overly complicated, both the data structure and
the access method. It seems like you are implementing your own custom Huffman
compression with this.

Is the reasonn for the bytetable just to pack numbers efficiently, or do you
have a different intention?

Did you see a significant size benefit over simply storing all metadata as
uncompressed data structures like in cramfs?

Have you considered storing simple dentry/inode data in node_type==Compressed
nodes?