diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2005-09-23 14:25:01 +0100 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2005-09-23 14:25:01 +0100 |
commit | f11f68cd1157d84615621edcd7321a6d0a09b158 (patch) | |
tree | becbcc239c8b8c0f26e08428b4ac798fa5bdb4fc /tools/xenstore/xenstored_transaction.h | |
parent | 7c7896249b7ffa3a0e6c1c749c8c3b08edf2ae70 (diff) | |
download | xen-f11f68cd1157d84615621edcd7321a6d0a09b158.tar.gz xen-f11f68cd1157d84615621edcd7321a6d0a09b158.tar.bz2 xen-f11f68cd1157d84615621edcd7321a6d0a09b158.zip |
Make xenstored use tdb, transactions can soft-fail (EAGAIN)
Transactions no longer take root dir, no longer lock & block: commit can fail spuriously with EAGAIN, not ETIMEDOUT.
Speeds up transactions by over 1000 times, should be NFS safe.
New program: xs_tdb_dump to dump raw TDB contents.
Don't do failure testing: we are no longer robust against all ENOMEM 8(
Introduce "struct node" which contains perms, children and data.
Make struct xs_permissions unpadded, so we can write to tdb w/o valgrind complaints.
Gently modify TDB to use talloc, not do alloc on tdb_delete.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'tools/xenstore/xenstored_transaction.h')
-rw-r--r-- | tools/xenstore/xenstored_transaction.h | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/tools/xenstore/xenstored_transaction.h b/tools/xenstore/xenstored_transaction.h index 6abc8a2d19..2617339940 100644 --- a/tools/xenstore/xenstored_transaction.h +++ b/tools/xenstore/xenstored_transaction.h @@ -22,29 +22,14 @@ struct transaction; -void do_transaction_start(struct connection *conn, const char *node); +void do_transaction_start(struct connection *conn, struct buffered_data *node); void do_transaction_end(struct connection *conn, const char *arg); -/* Is node covered by this transaction? */ -bool within_transaction(struct transaction *trans, const char *node); - -/* If a write op on this node blocked by another connections' transaction, - * mark conn, setup transaction timeout and return true. - */ -bool transaction_block(struct connection *conn, const char *node); - -/* Return transaction which covers this node. */ -struct transaction *transaction_covering_node(const char *node); - -/* Return directory of node within transaction t. */ -char *node_dir_inside_transaction(struct transaction *t, const char *node); +bool transaction_block(struct connection *conn); /* This node was changed: can fail and longjmp. */ void add_change_node(struct transaction *trans, const char *node, bool recurse); -/* Get shortest timeout: leave tv unset if none. */ -void shortest_transaction_timeout(struct timeval *tv); - -/* Have any transactions timed out yet? */ -void check_transaction_timeout(void); +/* Return tdb context to use for this connection. */ +TDB_CONTEXT *tdb_transaction_context(struct transaction *trans); #endif /* _XENSTORED_TRANSACTION_H */ |