Added file-level and fs-level custom attribute APIs

In the form of lfs_file_setattr, lfs_file_getattr, lfs_fs_setattr,
lfs_fs_getattr.

This enables atomic updates of custom attributes as described in
6c754c8, and provides a custom attribute API that allows custom attributes
to be stored on the filesystem itself.
This commit is contained in:
Christopher Haster
2018-04-08 16:58:12 -05:00
parent 636c0ed3d1
commit 93244a3734
2 changed files with 219 additions and 97 deletions

5
lfs.h
View File

@@ -283,7 +283,7 @@ typedef struct lfs_cache {
typedef struct lfs_file {
struct lfs_file *next;
lfs_block_t pair[2];
lfs_off_t poff;
lfs_off_t pairoff;
lfs_block_t head;
lfs_size_t size;
@@ -294,6 +294,9 @@ typedef struct lfs_file {
lfs_block_t block;
lfs_off_t off;
lfs_cache_t cache;
const struct lfs_attr *attrs;
int attrcount;
} lfs_file_t;
typedef struct lfs_dir {