1 | /* |
2 | * write.h |
3 | * |
4 | * Copyright (C) 2016 Aerospike, Inc. |
5 | * |
6 | * Portions may be licensed to Aerospike, Inc. under one or more contributor |
7 | * license agreements. |
8 | * |
9 | * This program is free software: you can redistribute it and/or modify it under |
10 | * the terms of the GNU Affero General Public License as published by the Free |
11 | * Software Foundation, either version 3 of the License, or (at your option) any |
12 | * later version. |
13 | * |
14 | * This program is distributed in the hope that it will be useful, but WITHOUT |
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
16 | * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more |
17 | * details. |
18 | * |
19 | * You should have received a copy of the GNU Affero General Public License |
20 | * along with this program. If not, see http://www.gnu.org/licenses/ |
21 | */ |
22 | |
23 | #pragma once |
24 | |
25 | //========================================================== |
26 | // Includes. |
27 | // |
28 | |
29 | #include "citrusleaf/alloc.h" |
30 | |
31 | #include "base/predexp.h" |
32 | #include "base/transaction.h" |
33 | |
34 | |
35 | //========================================================== |
36 | // Forward declarations. |
37 | // |
38 | |
39 | struct as_transaction_s; |
40 | struct cl_msg_s; |
41 | struct predexp_eval_base_s; |
42 | |
43 | |
44 | //========================================================== |
45 | // Typedefs & constants. |
46 | // |
47 | |
48 | typedef void (*iops_cb)(void* udata, int result); |
49 | |
50 | typedef struct iops_origin_s { |
51 | struct cl_msg_s* msgp; |
52 | struct predexp_eval_base_s* predexp; |
53 | iops_cb cb; |
54 | void* udata; |
55 | } iops_origin; |
56 | |
57 | |
58 | //========================================================== |
59 | // Public API. |
60 | // |
61 | |
62 | transaction_status as_write_start(struct as_transaction_s* tr); |
63 | |
64 | static inline void |
65 | iops_origin_destroy(iops_origin* origin) |
66 | { |
67 | predexp_destroy(origin->predexp); |
68 | cf_free(origin->msgp); |
69 | } |
70 | |