- ret = send_standard_callback_request(1, argv + 1, f, &cat_output);
- if (ret >= 0 && cat_output.data)
- printf("%s\n", (char *)cat_output.data);
- free(cat_output.data);
+ return send_standard_callback_request(cc->argc - 1, cc->argv + 1, f,
+ afs_cb_result_handler, cc);
+}
+
+static int remove_blob(struct osl_table *table, struct osl_row *row,
+ const char *name, void *data)
+{
+ struct afs_callback_arg *aca = data;
+ int ret = osl(osl_del_row(table, row));
+ if (ret < 0) {
+ para_printf(&aca->pbout, "cannot remove %s\n", name);
+ return ret;
+ }
+ return 1;
+}
+
+static int com_rmblob_callback(struct osl_table *table,
+ struct afs_callback_arg *aca)
+{
+ int ret;
+ struct pattern_match_data pmd = {
+ .table = table,
+ .patterns = aca->query,
+ .loop_col_num = BLOBCOL_NAME,
+ .match_col_num = BLOBCOL_NAME,
+ .pm_flags = PM_SKIP_EMPTY_NAME,
+ .data = aca,
+ .action = remove_blob
+ };
+ ret = for_each_matching_row(&pmd);
+ if (ret < 0)
+ goto out;
+ if (pmd.num_matches == 0)
+ ret = -E_NO_MATCH;
+ else {
+ para_printf(&aca->pbout, "removed %d blob(s)\n",
+ pmd.num_matches);
+ ret = afs_event(BLOB_REMOVE, NULL, table);
+ }
+out: