summaryrefslogtreecommitdiff
path: root/extstore.h
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2017-12-17 23:22:43 -0800
committerdormando <dormando@rydia.net>2017-12-17 23:22:43 -0800
commit44bff2924018fa69c33adaeb0fddd004c66f3e95 (patch)
treef19f150c1ef25dabdc3546f824231a523df886d3 /extstore.h
parentf44e1b1b53be29e08a20841a936f7908be8f01d3 (diff)
downloadmemcached-44bff2924018fa69c33adaeb0fddd004c66f3e95.tar.gz
extstore: better error handling for init.
can add more later; extremely unlikely to happen. can/should convert more functions to use extstore_err + codes.
Diffstat (limited to 'extstore.h')
-rw-r--r--extstore.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/extstore.h b/extstore.h
index 84157a0..a466562 100644
--- a/extstore.h
+++ b/extstore.h
@@ -76,7 +76,18 @@ struct _obj_io {
obj_io_cb cb;
};
-void *extstore_init(char *fn, struct extstore_conf *cf);
+enum extstore_res {
+ EXTSTORE_INIT_BAD_WBUF_SIZE = 1,
+ EXTSTORE_INIT_NEED_MORE_WBUF,
+ EXTSTORE_INIT_NEED_MORE_BUCKETS,
+ EXTSTORE_INIT_PAGE_WBUF_ALIGNMENT,
+ EXTSTORE_INIT_OOM,
+ EXTSTORE_INIT_OPEN_FAIL,
+ EXTSTORE_INIT_THREAD_FAIL
+};
+
+const char *extstore_err(enum extstore_res res);
+void *extstore_init(char *fn, struct extstore_conf *cf, enum extstore_res *res);
int extstore_write_request(void *ptr, unsigned int bucket, obj_io *io);
void extstore_write(void *ptr, obj_io *io);
int extstore_submit(void *ptr, obj_io *io);