mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 11:10:44 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user