+ struct remove_attribute_action_data *raad = data;
+ int ret;
+ struct rmatt_event_data red = {.name = name};
+
+ ret = get_attribute_bitnum_by_name(name, &red.bitnum);
+ if (ret < 0)
+ return para_printf(&raad->pb, "%s: %s\n", name, para_strerror(-ret));
+ ret = osl_del_row(table, row);
+ if (ret < 0)
+ return para_printf(&raad->pb, "%s: %s\n", name, para_strerror(-ret));
+ ret = para_printf(&raad->pb, "removed attribute %s\n", name);
+ raad->num_removed++;
+ raad->mask_of_removed_atts |= (1 << red.bitnum);
+ afs_event(ATTRIBUTE_REMOVE, &raad->pb, &red);
+ return ret;
+}
+
+static void com_rmatt_callback(int fd, const struct osl_object *query)
+{
+ struct remove_attribute_action_data raad = {
+ .num_removed = 0,
+ .pb = {
+ .max_size = SHMMAX,
+ .private_data = &fd,
+ .max_size_handler = pass_buffer_as_shm
+ }
+ };
+ int ret, ret2 = 0;
+ struct pattern_match_data pmd = {
+ .table = attribute_table,
+ .patterns = *query,
+ .loop_col_num = ATTCOL_BITNUM,
+ .match_col_num = ATTCOL_NAME,
+ .data = &raad,
+ .action = remove_attribute
+ };
+ ret = for_each_matching_row(&pmd);
+ if (ret < 0)
+ ret2 = para_printf(&raad.pb, "%s\n", para_strerror(-ret));
+ else if (!raad.num_removed)
+ ret2 = para_printf(&raad.pb, "no match -- nothing removed\n");
+ if (ret2 >= 0 && raad.pb.offset)
+ pass_buffer_as_shm(raad.pb.buf, raad.pb.offset, &fd);
+ free(raad.pb.buf);
+}
+
+int com_rmatt(int fd, int argc, char * const * const argv)
+{
+ int ret;
+