bake-server.h 1022 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
/*
 * (C) 2016 The University of Chicago
 * 
 * See COPYRIGHT in top-level directory.
 */

#ifndef __BAKE_SERVER_H
#define __BAKE_SERVER_H

#include <margo.h>
#include <libpmemobj.h>
#include "bake.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Creates a BAKE pool to use for backend PMEM storage.
 * 
 * NOTE: This function must be called on a pool before the pool
 * can be passed to 'bake_server_init'.
 *
 * @param[in] pool_name path to PMEM backend file
 * @param[in] pool_size size of the created pool
 * @param[in] pool_mode mode of the created pool
 * @returns 0 on success, -1 otherwise
 */
int bake_server_makepool(
    const char *pool_name,
    size_t pool_size,
    mode_t pool_mode);

/**
 * Initializes a BAKE server instance.
 *
 * @param[in] mid Margo instance identifier
 * @param[in] pool_name path to PMEM backend file
 * @returns 0 on success, -1 otherwise
 */
int bake_server_init(
    margo_instance_id mid,
    const char *pool_name);

#ifdef __cplusplus
}
#endif

#endif /* __BAKE_SERVER_H */