From 0c68f9899f91e15e5aa999ae98635429a6606870 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Thu, 12 Jul 2018 21:11:40 +0000 Subject: Make sp_createfile() allocate ACL IOMT in memory, rather than DB sp_request() will copy it into the database anyway, so there's no point in doing twice the work. --- service_provider.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'service_provider.c') diff --git a/service_provider.c b/service_provider.c index 956d2d9..9445b8a 100644 --- a/service_provider.c +++ b/service_provider.c @@ -773,12 +773,9 @@ struct tm_request sp_createfile(struct service_provider *sp, int *file_orders; hash_t *file_comp = merkle_complement(sp->iomt, i, &file_orders); - struct iomt *acl = iomt_new_from_db(sp->db, - "ACLNodes", "ACLLeaves", - "FileIdx", sp->next_fileidx, - NULL, 0, - ACL_LOGLEAVES); - + /* We create the ACL IOMT in memory first; sp_request() will copy + it into the database. */ + struct iomt *acl = iomt_new(1); sp->next_fileidx++; iomt_update_leaf_full(acl, @@ -805,6 +802,7 @@ struct tm_request sp_createfile(struct service_provider *sp, acl); sp->n_placeholders--; + /* sp_request() has made a copy of the ACL */ iomt_free(acl); free(file_comp); free(file_orders); -- cgit v1.1