scoutfs: remove item_forget

It's pretty dangerous to forcefully remove items without writing
deletion items to lsm segments.  This was only used for magical
ephemeral items when we were having them store file data.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-05-23 12:59:24 -07:00
parent 1f933016f0
commit a2ef5ecb33
3 changed files with 0 additions and 28 deletions

View File

@@ -32,7 +32,6 @@
EXPAND_COUNTER(item_lookup_hit) \
EXPAND_COUNTER(item_lookup_miss) \
EXPAND_COUNTER(item_delete) \
EXPAND_COUNTER(item_forget) \
EXPAND_COUNTER(item_range_hit) \
EXPAND_COUNTER(item_range_miss) \
EXPAND_COUNTER(item_range_insert)

View File

@@ -1344,32 +1344,6 @@ out:
return ret;
}
/*
* Forcefully remove an item from the cache regardless of its state or
* relationship to persistent items.
*
* The caller is entirely responsible for the correctness of having this
* item vanish.
*/
void scoutfs_item_forget(struct super_block *sb, struct scoutfs_key_buf *key)
{
struct scoutfs_sb_info *sbi = SCOUTFS_SB(sb);
struct item_cache *cac = sbi->item_cache;
struct cached_item *item;
unsigned long flags;
spin_lock_irqsave(&cac->lock, flags);
item = find_item(sb, &cac->items, key);
if (item) {
trace_printk("forgetting item %p\n", item);
scoutfs_inc_counter(sb, item_forget);
erase_item(sb, cac, item);
}
spin_unlock_irqrestore(&cac->lock, flags);
}
/*
* Return the first dirty node in the subtree starting at the given node.
*/

View File

@@ -35,7 +35,6 @@ void scoutfs_item_delete_dirty(struct super_block *sb,
int scoutfs_item_delete_many(struct super_block *sb,
struct scoutfs_key_buf **keys, unsigned nr);
int scoutfs_item_delete(struct super_block *sb, struct scoutfs_key_buf *key);
void scoutfs_item_forget(struct super_block *sb, struct scoutfs_key_buf *key);
int scoutfs_item_add_batch(struct super_block *sb, struct list_head *list,
struct scoutfs_key_buf *key, struct kvec *val);