mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 19:20:44 +00:00
scoutfs: remove scoutfs_item_delete_many()
It looked like it was easier to have a helper dirty and delete items. But now that we also have to pass in locks the interface gets messy enough that it's easier to have the caller take care of it. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -1416,36 +1416,6 @@ void scoutfs_item_delete_dirty(struct super_block *sb,
|
||||
scoutfs_kvec_kfree(del_val);
|
||||
}
|
||||
|
||||
/*
|
||||
* A helper that deletes a set of items. It first dirties the items
|
||||
* will be pinned so that deletion won't fail as it tries to read and
|
||||
* populate the items.
|
||||
*
|
||||
* It's a little cleaner to have this helper than have the caller
|
||||
* iterate, but it could also give us the opportunity to reduce item
|
||||
* searches if we remembered the items we dirtied.
|
||||
*/
|
||||
int scoutfs_item_delete_many(struct super_block *sb,
|
||||
struct scoutfs_key_buf **keys, unsigned nr,
|
||||
struct scoutfs_key_buf **ends)
|
||||
{
|
||||
int ret = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nr; i++) {
|
||||
ret = scoutfs_item_dirty(sb, keys[i], ends[i]);
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (i = 0; i < nr; i++)
|
||||
scoutfs_item_delete_dirty(sb, keys[i]);
|
||||
|
||||
out:
|
||||
trace_printk("ret %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the first dirty node in the subtree starting at the given node.
|
||||
*/
|
||||
|
||||
@@ -36,9 +36,6 @@ int scoutfs_item_update(struct super_block *sb, struct scoutfs_key_buf *key,
|
||||
struct kvec *val, struct scoutfs_key_buf *end);
|
||||
void scoutfs_item_delete_dirty(struct super_block *sb,
|
||||
struct scoutfs_key_buf *key);
|
||||
int scoutfs_item_delete_many(struct super_block *sb,
|
||||
struct scoutfs_key_buf **keys, unsigned nr,
|
||||
struct scoutfs_key_buf **ends);
|
||||
int scoutfs_item_delete(struct super_block *sb, struct scoutfs_key_buf *key,
|
||||
struct scoutfs_key_buf *end);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user