1 #ifndef STORAGE_H 2 #define STORAGE_H 3 4 void storage_delete(void *e, item *it); 5 #ifdef EXTSTORE 6 #define STORAGE_delete(e, it) \ 7 do { \ 8 storage_delete(e, it); \ 9 } while (0) 10 #else 11 #define STORAGE_delete(...) 12 #endif 13 14 // API. 15 void storage_stats(ADD_STAT add_stats, void *c); 16 void process_extstore_stats(ADD_STAT add_stats, void *c); 17 bool storage_validate_item(void *e, item *it); 18 int storage_get_item(conn *c, item *it, mc_resp *resp); 19 20 // callback for the IO queue subsystem. 21 void storage_submit_cb(io_queue_t *q); 22 23 // Thread functions. 24 int start_storage_write_thread(void *arg); 25 void storage_write_pause(void); 26 void storage_write_resume(void); 27 int start_storage_compact_thread(void *arg); 28 void storage_compact_pause(void); 29 void storage_compact_resume(void); 30 31 // Init functions. 32 struct extstore_conf_file *storage_conf_parse(char *arg, unsigned int page_size); 33 void *storage_init_config(struct settings *s); 34 int storage_read_config(void *conf, char **subopt); 35 int storage_check_config(void *conf); 36 void *storage_init(void *conf); 37 38 // Ignore pointers and header bits from the CRC 39 #define STORE_OFFSET offsetof(item, nbytes) 40 41 #endif 42