diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-10-10 15:38:01 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-10-10 15:38:01 +0100 |
commit | bddd41366dca057dfbd5204193931f78dbd686a6 (patch) | |
tree | 38f078024a96ca8510ad90ff137966878dd05197 /tools/xenstore/utils.h | |
parent | 5910d2c4608435ea13a95f2955496a0cdb8d97a9 (diff) | |
download | xen-bddd41366dca057dfbd5204193931f78dbd686a6.tar.gz xen-bddd41366dca057dfbd5204193931f78dbd686a6.tar.bz2 xen-bddd41366dca057dfbd5204193931f78dbd686a6.zip |
xenstored now supports multiple concurrent transactions per
connection, plus interleaving of transactional and
non-transactional accesses. A transaction identifier is added
to the xsd_sockmsg header structure (0 means 'not in context
of a transaction'). The user and kernel xs interfaces accept
a pointer to a transaction handle where appropriate --
currently this is directly cast to an integer identifier in
the client library / kernel driver, but will allow for keeping
extra dynamic client-side state in future if we need to.
The transaction mutex has now gone. It's replaced with a
read-write mutex, but this is only acquired for exclusive
access during suspend/resume, to ensure there are no in-progress
transactions.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/xenstore/utils.h')
-rw-r--r-- | tools/xenstore/utils.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/xenstore/utils.h b/tools/xenstore/utils.h index 5fbfceeaa9..df82c1c5ef 100644 --- a/tools/xenstore/utils.h +++ b/tools/xenstore/utils.h @@ -55,4 +55,34 @@ void xprintf(const char *fmt, ...); #define dprintf(_fmt, _args...) ((void)0) #endif +/* + * Mux errno values onto returned pointers. + */ + +static inline void *ERR_PTR(long error) +{ + return (void *)error; +} + +static inline long PTR_ERR(const void *ptr) +{ + return (long)ptr; +} + +static inline long IS_ERR(const void *ptr) +{ + return ((unsigned long)ptr > (unsigned long)-1000L); +} + + #endif /* _UTILS_H */ + +/* + * Local variables: + * c-file-style: "linux" + * indent-tabs-mode: t + * c-indent-level: 8 + * c-basic-offset: 8 + * tab-width: 8 + * End: + */ |