Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
codes
codes
Commits
b98deb14
Commit
b98deb14
authored
Mar 05, 2015
by
Jonathan Jenkins
Browse files
lsm api switch to use annotations
parent
5af2ef2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
codes/local-storage-model.h
View file @
b98deb14
...
...
@@ -43,7 +43,10 @@ typedef enum lsm_event_e
*/
/* given LP sender, find the LSM device LP in the same group */
tw_lpid
lsm_find_local_device
(
tw_lp
*
sender
);
tw_lpid
lsm_find_local_device
(
const
char
*
annotation
,
int
ignore_annotations
,
tw_lpid
sender_gid
);
/*
* lsm_event_new
...
...
@@ -69,6 +72,21 @@ tw_event* lsm_event_new(const char* category,
size_t
message_bytes
,
tw_lp
*
sender
,
tw_stime
delay
);
/* equivalent to lsm_event_new, except it allows to specify an annotation to
* filter by. If ignore_annotations is nonzero, A null annotation parameter
* indicates that the lsm LP to issue to has no annotation */
tw_event
*
lsm_event_new_annotated
(
const
char
*
category
,
tw_lpid
dest_gid
,
uint64_t
io_object
,
int64_t
io_offset
,
uint64_t
io_size_bytes
,
int
io_type
,
size_t
message_bytes
,
tw_lp
*
sender
,
tw_stime
delay
,
const
char
*
annotation
,
int
ignore_annotations
);
void
lsm_event_new_reverse
(
tw_lp
*
sender
);
...
...
src/util/local-storage-model.c
View file @
b98deb14
...
...
@@ -266,42 +266,26 @@ static tw_lpid lsm_find_local_device_default(
return
rtn
;
}
/*
* lsm_find_local_device()
*
* returns the LP id of the lsm device connected to the caller
*
* TODO: currently ignores annotations
*/
tw_lpid
lsm_find_local_device
(
tw_lp
*
sender
)
{
return
lsm_find_local_device_default
(
NULL
,
1
,
sender
->
gid
);
tw_lpid
lsm_find_local_device
(
const
char
*
annotation
,
int
ignore_annotations
,
tw_lpid
sender_gid
)
{
return
lsm_find_local_device_default
(
annotation
,
ignore_annotations
,
sender_gid
);
}
/*
* lsm_event_new
* - creates a new event that is targeted for the corresponding
* LSM LP.
* - this event will allow wrapping the callers completion event
* - category: string name to identify the traffic category
* - dest_gid: the gid to send the callers event to
* - gid_offset: relative offset of the LSM LP to the originating LP
* - io_object: id of byte stream the caller will modify
* - io_offset: offset into byte stream
* - io_size_bytes: size in bytes of IO request
* - io_type: read or write request
* - message_bytes: size of the event message the caller will have
* - sender: id of the sender
*/
tw_event
*
lsm_event_new
(
const
char
*
category
,
tw_lpid
dest_gid
,
uint64_t
io_object
,
int64_t
io_offset
,
uint64_t
io_size_bytes
,
int
io_type
,
size_t
message_bytes
,
tw_lp
*
sender
,
tw_stime
delay
)
static
tw_event
*
lsm_event_new_base
(
const
char
*
category
,
tw_lpid
dest_gid
,
uint64_t
io_object
,
int64_t
io_offset
,
uint64_t
io_size_bytes
,
int
io_type
,
size_t
message_bytes
,
tw_lp
*
sender
,
tw_stime
delay
,
const
char
*
annotation
,
int
ignore_annotations
)
{
tw_event
*
e
;
lsm_message_t
*
m
;
...
...
@@ -314,7 +298,7 @@ tw_event* lsm_event_new(const char* category,
/* Generate an event for the local storage model, and send the
* event to an lsm LP.
*/
lsm_gid
=
lsm_find_local_device
(
sender
);
lsm_gid
=
lsm_find_local_device
(
annotation
,
ignore_annotations
,
sender
->
gid
);
delta
=
codes_local_latency
(
sender
)
+
delay
;
if
(
lsm_in_sequence
)
{
...
...
@@ -338,6 +322,51 @@ tw_event* lsm_event_new(const char* category,
return
e
;
}
/*
* lsm_event_new
* - creates a new event that is targeted for the corresponding
* LSM LP.
* - this event will allow wrapping the callers completion event
* - category: string name to identify the traffic category
* - dest_gid: the gid to send the callers event to
* - gid_offset: relative offset of the LSM LP to the originating LP
* - io_object: id of byte stream the caller will modify
* - io_offset: offset into byte stream
* - io_size_bytes: size in bytes of IO request
* - io_type: read or write request
* - message_bytes: size of the event message the caller will have
* - sender: id of the sender
*/
tw_event
*
lsm_event_new
(
const
char
*
category
,
tw_lpid
dest_gid
,
uint64_t
io_object
,
int64_t
io_offset
,
uint64_t
io_size_bytes
,
int
io_type
,
size_t
message_bytes
,
tw_lp
*
sender
,
tw_stime
delay
)
{
return
lsm_event_new_base
(
category
,
dest_gid
,
io_object
,
io_offset
,
io_size_bytes
,
io_type
,
message_bytes
,
sender
,
delay
,
NULL
,
1
);
}
tw_event
*
lsm_event_new_annotated
(
const
char
*
category
,
tw_lpid
dest_gid
,
uint64_t
io_object
,
int64_t
io_offset
,
uint64_t
io_size_bytes
,
int
io_type
,
size_t
message_bytes
,
tw_lp
*
sender
,
tw_stime
delay
,
const
char
*
annotation
,
int
ignore_annotations
)
{
return
lsm_event_new_base
(
category
,
dest_gid
,
io_object
,
io_offset
,
io_size_bytes
,
io_type
,
message_bytes
,
sender
,
delay
,
annotation
,
ignore_annotations
);
}
/*
* lsm_event_data
* - returns the pointer to the message data for the callers data
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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