1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #include <src/include/pmix_config.h>
17 #include <pmix_common.h>
18
19 #include "src/include/pmix_globals.h"
20 #include "src/mca/gds/base/base.h"
21 #include "src/mca/pshmem/base/base.h"
22
23 #include "dstore_common.h"
24
25 #ifndef DSTORE_SEGMENT_H
26 #define DSTORE_SEGMENT_H
27
28
29
30
31
32
33
34 typedef struct pmix_dstore_seg_desc_t pmix_dstore_seg_desc_t;
35
36 typedef enum {
37 PMIX_DSTORE_INITIAL_SEGMENT,
38 PMIX_DSTORE_NS_META_SEGMENT,
39 PMIX_DSTORE_NS_DATA_SEGMENT,
40 PMIX_DSTORE_NS_LOCK_SEGMENT,
41 } pmix_dstore_segment_type;
42
43 struct pmix_dstore_seg_desc_t {
44 pmix_dstore_segment_type type;
45 pmix_pshmem_seg_t seg_info;
46 uint32_t id;
47 pmix_dstore_seg_desc_t *next;
48 };
49
50 PMIX_EXPORT int pmix_common_dstor_getpagesize(void);
51 PMIX_EXPORT size_t pmix_common_dstor_getcacheblocksize(void);
52 PMIX_EXPORT void pmix_common_dstor_init_segment_info(size_t initial_segment_size,
53 size_t meta_segment_size,
54 size_t data_segment_size);
55 PMIX_EXPORT pmix_dstore_seg_desc_t *pmix_common_dstor_create_new_segment(pmix_dstore_segment_type type,
56 const char *base_path, const char *name, uint32_t id,
57 uid_t uid, bool setuid);
58 PMIX_EXPORT pmix_dstore_seg_desc_t *pmix_common_dstor_attach_new_segment(pmix_dstore_segment_type type,
59 const char *base_path,
60 const char *name, uint32_t id);
61 PMIX_EXPORT pmix_dstore_seg_desc_t *pmix_common_dstor_extend_segment(pmix_dstore_seg_desc_t *segdesc,
62 const char *base_path,
63 const char *name, uid_t uid, bool setuid);
64 PMIX_EXPORT void pmix_common_dstor_delete_sm_desc(pmix_dstore_seg_desc_t *desc);
65 PMIX_EXPORT pmix_dstore_seg_desc_t *pmix_common_dstor_create_new_lock_seg(const char *base_path, size_t size,
66 const char *name, uint32_t id, uid_t uid, bool setuid);
67 PMIX_EXPORT pmix_dstore_seg_desc_t *pmix_common_dstor_attach_new_lock_seg(const char *base_path,
68 size_t size, const char *name, uint32_t id);
69
70 #endif