view tools/xenstore/xenstored_transaction.h @ 6946:e703abaf6e3d

Add behaviour to the remove methods to remove the transaction's path itself. This allows us to write Remove(path) to remove the specified path rather than having to slice the path ourselves.
author emellor@ewan
date Sun Sep 18 14:42:13 2005 +0100 (2005-09-18)
parents 3233e7ecfa9f
children 06d84bf87159
line source
1 /*
2 Transaction code for Xen Store Daemon.
3 Copyright (C) 2005 Rusty Russell IBM Corporation
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
21 #include "xenstored_core.h"
23 struct transaction;
25 void do_transaction_start(struct connection *conn, const char *node);
26 void do_transaction_end(struct connection *conn, const char *arg);
28 /* Is node covered by this transaction? */
29 bool within_transaction(struct transaction *trans, const char *node);
31 /* If a write op on this node blocked by another connections' transaction,
32 * mark conn, setup transaction timeout and return true.
33 */
34 bool transaction_block(struct connection *conn, const char *node);
36 /* Return transaction which covers this node. */
37 struct transaction *transaction_covering_node(const char *node);
39 /* Return directory of node within transaction t. */
40 char *node_dir_inside_transaction(struct transaction *t, const char *node);
42 /* This node was changed: can fail and longjmp. */
43 void add_change_node(struct transaction *trans, const char *node, bool recurse);
45 /* Get shortest timeout: leave tv unset if none. */
46 void shortest_transaction_timeout(struct timeval *tv);
48 /* Have any transactions timed out yet? */
49 void check_transaction_timeout(void);