bake-bulk-server.h 1.02 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 * (C) 2016 The University of Chicago
 * 
 * See COPYRIGHT in top-level directory.
 */

#ifndef __BAKE_BULK_SERVER_H
#define __BAKE_BULK_SERVER_H

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

struct bake_bulk_root
{
    bake_target_id_t target_id;
};

19 20 21 22 23 24
struct bake_pool_info
{
    PMEMobjpool           *bb_pmem_pool;
    struct bake_bulk_root *bb_pmem_root;
};

25 26 27 28 29 30 31 32 33
/**
 * Register a bake server instance for a given Margo instance.
 *
 * @param[in] mid Margo instance identifier
 * @param[in] bb_pmem_pool libpmem pool to use for the bake storage service
 * @param[in] bb_pmem_root libpmem root for the bake pool
 */
void bake_server_register(
    margo_instance_id mid,
34
    struct bake_pool_info *pool_info);
35

36 37 38 39 40
/**
 * Convienence function to set up a PMEM backend.
 *
 * @param[in] poolname path to pmem backend file
 *
41 42
 * returns a pointer to an initialized `struct bake_pool_info` on sucess,
 * NULL if anything goes wrong
43
 */
44 45
struct bake_pool_info *bake_server_makepool(
	char *poolname);
46
#endif /* __BAKE_BULK_SERVER_H */