Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bake
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sds
bake
Commits
bb887d86
Commit
bb887d86
authored
May 07, 2016
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create pmemobj object
parent
4f8196f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
5 deletions
+33
-5
src/bake-bulk-rpc.c
src/bake-bulk-rpc.c
+27
-4
src/bake-bulk-server.c
src/bake-bulk-server.c
+5
-1
src/bb-copy-to.c
src/bb-copy-to.c
+1
-0
No files found.
src/bake-bulk-rpc.c
View file @
bb887d86
...
...
@@ -5,8 +5,15 @@
*/
#include <assert.h>
#include <libpmemobj.h>
#include "bake-bulk-rpc.h"
/* TODO: this should not be global in the long run; server may provide access
* to multiple targets
*/
extern
PMEMobjpool
*
pmem_pool
;
/* service a remote RPC that instructs the server daemon to shut down */
static
void
bake_bulk_shutdown_ult
(
hg_handle_t
handle
)
{
...
...
@@ -39,16 +46,32 @@ DEFINE_MARGO_RPC_HANDLER(bake_bulk_shutdown_ult)
static
void
bake_bulk_create_ult
(
hg_handle_t
handle
)
{
bake_bulk_create_out_t
out
;
bake_bulk_create_in_t
in
;
PMEMoid
oid
;
hg_return_t
hret
;
printf
(
"Got RPC request to create bulk region.
\n
"
);
memset
(
&
out
,
0
,
sizeof
(
out
));
out
.
ret
=
-
1
;
HG_Respond
(
handle
,
NULL
,
NULL
,
&
out
);
hret
=
HG_Get_input
(
handle
,
&
in
);
if
(
hret
!=
HG_SUCCESS
)
{
out
.
ret
=
-
1
;
HG_Respond
(
handle
,
NULL
,
NULL
,
&
out
);
HG_Destroy
(
handle
);
return
;
}
HG_Destroy
(
handle
);
out
.
ret
=
pmemobj_alloc
(
pmem_pool
,
&
oid
,
in
.
region_size
,
0
,
NULL
,
NULL
);
if
(
out
.
ret
==
0
)
{
/* TODO: real translation functions for opaque type */
memcpy
(
&
out
.
rid
,
&
oid
,
sizeof
(
oid
));
}
HG_Respond
(
handle
,
NULL
,
NULL
,
&
out
);
HG_Destroy
(
handle
);
return
;
}
DEFINE_MARGO_RPC_HANDLER
(
bake_bulk_create_ult
)
...
...
src/bake-bulk-server.c
View file @
bb887d86
...
...
@@ -14,6 +14,11 @@
#include "bake-bulk-rpc.h"
/* TODO: this should not be global in the long run; server may provide access
* to multiple targets
*/
PMEMobjpool
*
pmem_pool
;
int
main
(
int
argc
,
char
**
argv
)
{
int
ret
;
...
...
@@ -22,7 +27,6 @@ int main(int argc, char **argv)
ABT_pool
handler_pool
;
hg_context_t
*
hg_context
;
hg_class_t
*
hg_class
;
PMEMobjpool
*
pmem_pool
;
if
(
argc
!=
3
)
{
...
...
src/bb-copy-to.c
View file @
bb887d86
...
...
@@ -52,6 +52,7 @@ int main(int argc, char **argv)
/* TODO: create appropriate size region */
ret
=
bake_bulk_create
(
bti
,
1024
,
&
rid
);
if
(
ret
!=
0
)
{
fprintf
(
stderr
,
"Error: bake_bulk_create()
\n
"
);
return
(
-
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment