From d2ea247ab9dc5985ca836ed06640719eb02f275a Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 31 Jul 2017 14:04:26 -0700 Subject: [PATCH] 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 --- kmod/src/item.c | 30 ------------------------------ kmod/src/item.h | 3 --- 2 files changed, 33 deletions(-) diff --git a/kmod/src/item.c b/kmod/src/item.c index 94c45c9b..3de2f9a8 100644 --- a/kmod/src/item.c +++ b/kmod/src/item.c @@ -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. */ diff --git a/kmod/src/item.h b/kmod/src/item.h index e7bae7da..bd04ccbc 100644 --- a/kmod/src/item.h +++ b/kmod/src/item.h @@ -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);