aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2018-07-12 21:11:40 +0000
committerFranklin Wei <me@fwei.tk>2018-07-12 21:11:40 +0000
commit0c68f9899f91e15e5aa999ae98635429a6606870 (patch)
tree1f38c8926a4cd9f43129e45c249db03fd606ad60
parent9f29dd5464fd9cca2204fbba90e57dab8888f8d8 (diff)
downloadcsaa-0c68f9899f91e15e5aa999ae98635429a6606870.zip
csaa-0c68f9899f91e15e5aa999ae98635429a6606870.tar.gz
csaa-0c68f9899f91e15e5aa999ae98635429a6606870.tar.bz2
csaa-0c68f9899f91e15e5aa999ae98635429a6606870.tar.xz
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.
-rw-r--r--service_provider.c10
1 files changed, 4 insertions, 6 deletions
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);