Skip to content

API to manage user controlled metadata as extended attribute. #15

@jcdubois

Description

@jcdubois

Hello guys,

For our purpose we were in need of a way to add user controlled metadata to files stored inside the reliance edge filesystem (posix version).

The need was for these data to be associated to the file but distinct from the file data payload. Moreover it was desired that these metadata could be protected in integrity.

So instead of devising a solution strictly on top of the actual reliance API, I started to add a very crude/simple "user controlled metadata API" loosely inspired by the linux/posix "extended attribute API".

Here, the feature is rather limited as:

  • the max number of attributes is determined at compile time,
  • the size of an attribute is fixed at 32 bits
  • the attributes are referenced by index rather than by a key.

The drawback is that the API is not really linux compliant. Anyway there is no posix version of this API it seems. So maybe it doesn't really matter to have a Reliance specific API.

My present prototype is available on a branch in my github repository (https://github.com/jcdubois/reliance-edge/tree/attr).

The feature is optional (if REDCONF_ATTRIBUTES_MAX is equal to 0 it is not included) and it allows the user to store 32 bits user controlled values inside dir/file inodes. Because it is stored in the inode, it is protected by the inode CRC.

I would like to know if such feature is of interest to you and if you would consider merging it (after careful review and required fix/change) to reliance main line.

Thanks.

JC

Note: on my branch I have added a crc_file_wrapper API as an example of what could be achieved with this feature (using one attribute to store the data file CRC). This API is not necessarily candidate for inclusion (unless you find it useful). Extended attributes can be used to store a lot of other things related to file like owner ID, file type, encoding, identifier, ... and any number of other tags.

Note: I ported fsstress to use the crc_file_wrapper API (rather than the red API) to test it some bit and it did work as expected (with some performance hit when writing files).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions