diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-28 17:38:44 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-28 20:27:19 +0200 |
commit | 0bd27cbaec56d71b2525c2b37ae209396c65d45b (patch) | |
tree | c49b1826647d752d9d1572d71dd28da39312dc5c /lib/util | |
parent | 533c9b9d2b19639beda404d84b613bb2719e768f (diff) |
Add recoding implementation for the xattr writer
This commit implements the part of the API responsible for recoding
and deduplicating xattr key-value blocks.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/util')
-rw-r--r-- | lib/util/str_table.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/util/str_table.c b/lib/util/str_table.c index dba61fe..34aa70e 100644 --- a/lib/util/str_table.c +++ b/lib/util/str_table.c @@ -176,6 +176,14 @@ void str_table_add_ref(str_table_t *table, size_t index) bucket->refcount += 1; } +void str_table_del_ref(str_table_t *table, size_t index) +{ + str_bucket_t *bucket = bucket_by_index(table, index); + + if (bucket != NULL && bucket->refcount > 0) + bucket->refcount -= 1; +} + size_t str_table_get_ref_count(str_table_t *table, size_t index) { str_bucket_t *bucket = bucket_by_index(table, index); |