+ }
+ return send_lls_callback_request(com_addatt_callback, cmd, lpr, cc);
+}
+EXPORT_SERVER_CMD_HANDLER(addatt);
+
+static int com_mvatt_callback(struct afs_callback_arg *aca)
+{
+ const struct lls_command *cmd = SERVER_CMD_CMD_PTR(MVATT);
+ const char *old, *new;
+ struct osl_object obj;
+ struct osl_row *row;
+ int ret;
+
+ ret = lls(lls_deserialize_parse_result(aca->query.data, cmd, &aca->lpr));
+ assert(ret >= 0);
+ old = lls_input(0, aca->lpr);
+ new = lls_input(1, aca->lpr);
+ obj.data = (char *)old;
+ obj.size = strlen(old) + 1;
+ ret = osl(osl_get_row(attribute_table, ATTCOL_NAME, &obj, &row));
+ if (ret < 0)
+ goto out;
+ obj.data = (char *)new;
+ obj.size = strlen(new) + 1;
+ /* The update fails if the destination attribute exists. */
+ ret = osl(osl_update_object(attribute_table, row, ATTCOL_NAME, &obj));
+out:
+ if (ret < 0)
+ para_printf(&aca->pbout, "cannot rename %s to %s\n", old, new);
+ else
+ ret = afs_event(ATTRIBUTE_RENAME, &aca->pbout, NULL);
+ lls_free_parse_result(aca->lpr, cmd);
+ return ret;