mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 11:10:44 +00:00
Allow creation of items with no value
Item creation always tried to allocate a value. We have some item types which don't have values. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -100,8 +100,12 @@ static struct cached_item *alloc_item(struct super_block *sb,
|
||||
|
||||
item = kzalloc(sizeof(struct cached_item), GFP_NOFS);
|
||||
if (item) {
|
||||
if (!val)
|
||||
scoutfs_kvec_init_null(item->val);
|
||||
|
||||
item->key = scoutfs_key_dup(sb, key);
|
||||
if (!item->key || scoutfs_kvec_dup_flatten(item->val, val)) {
|
||||
if (!item->key ||
|
||||
(val && scoutfs_kvec_dup_flatten(item->val, val))) {
|
||||
free_item(sb, item);
|
||||
item = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user