summaryrefslogtreecommitdiffstats
path: root/src/storage-mmap.h
diff options
context:
space:
mode:
authorJiri Olsa <Jiri Olsa jolsa@redhat.com>2010-04-02 18:28:35 +0200
committerJiri Olsa <Jiri Olsa jolsa@redhat.com>2010-04-02 18:28:35 +0200
commitacc5795db9fd1af91690d80ec483c745ad558f28 (patch)
treeff385c7dcfd1c7287fe56bedb8cc94c0c96c779c /src/storage-mmap.h
parenta9b34fd9216367d6f959f979d318b52e00d58118 (diff)
downloadtsnif-acc5795db9fd1af91690d80ec483c745ad558f28.tar.gz
tsnif-acc5795db9fd1af91690d80ec483c745ad558f28.tar.xz
tsnif-acc5795db9fd1af91690d80ec483c745ad558f28.zip
added read support for storage_mmap
Diffstat (limited to 'src/storage-mmap.h')
-rw-r--r--src/storage-mmap.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/storage-mmap.h b/src/storage-mmap.h
index c05bbd0..db45cb0 100644
--- a/src/storage-mmap.h
+++ b/src/storage-mmap.h
@@ -4,8 +4,12 @@
struct tsnif_storage_header_mmap {
struct tsnif_storage_header common;
+ /* max size of the file */
uint32_t size_max;
+ /* number of records stored */
uint32_t cnt;
+ /* offset of the first chunk */
+ uint32_t offset_start;
};
struct tsnif_storage_rec_mmap {
@@ -31,10 +35,14 @@ struct tsnif_storage_chunk {
off_t offset;
void *current_data;
uint32_t *current_index;
+
+ /* for read interface only */
+ int read_index;
};
struct tsnif_storage_handle {
int fd;
+
struct tsnif_storage_opts *opts;
/* file header */
@@ -42,6 +50,10 @@ struct tsnif_storage_handle {
/* active chunk */
struct tsnif_storage_chunk active_chunk;
+
+ /* for READ mode only */
+ off_t file_size;
+
};
#endif /* STORAGE_MMAP_H */