Skip to content

Commit 6464f5a

Browse files
authored
Merge pull request #741 from ldorau/Remove_unneeded_headers
Remove unneeded headers
2 parents e9b0630 + 883a548 commit 6464f5a

File tree

4 files changed

+35
-84
lines changed

4 files changed

+35
-84
lines changed

src/provider/provider_devdax_memory.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <string.h>
1515

1616
#include "base_alloc_global.h"
17-
#include "provider_devdax_memory_internal.h"
1817
#include "provider_os_memory_internal.h"
1918
#include "utils_common.h"
2019
#include "utils_concurrency.h"
@@ -28,6 +27,15 @@
2827

2928
#define TLS_MSG_BUF_LEN 1024
3029

30+
typedef struct devdax_memory_provider_t {
31+
char path[PATH_MAX]; // a path to the device DAX
32+
size_t size; // size of the file used for memory mapping
33+
void *base; // base address of memory mapping
34+
size_t offset; // offset in the file used for memory mapping
35+
os_mutex_t lock; // lock of ptr and offset
36+
unsigned protection; // combination of OS-specific protection flags
37+
} devdax_memory_provider_t;
38+
3139
typedef struct devdax_last_native_error_t {
3240
int32_t native_error;
3341
int errno_value;

src/provider/provider_devdax_memory_internal.h

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/provider/provider_file_memory.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
#include "base_alloc_global.h"
1717
#include "critnib.h"
18-
#include "provider_file_memory_internal.h"
1918
#include "provider_os_memory_internal.h"
2019
#include "utils_common.h"
2120
#include "utils_concurrency.h"
@@ -27,6 +26,32 @@
2726

2827
#define TLS_MSG_BUF_LEN 1024
2928

29+
typedef struct file_memory_provider_t {
30+
os_mutex_t lock; // lock for file parameters (size and offsets)
31+
32+
char path[PATH_MAX]; // a path to the file
33+
int fd; // file descriptor for memory mapping
34+
size_t size_fd; // size of the file used for memory mappings
35+
size_t offset_fd; // offset in the file used for memory mappings
36+
37+
void *base_mmap; // base address of the current memory mapping
38+
size_t size_mmap; // size of the current memory mapping
39+
size_t offset_mmap; // data offset in the current memory mapping
40+
41+
unsigned protection; // combination of OS-specific protection flags
42+
unsigned visibility; // memory visibility mode
43+
size_t page_size; // minimum page size
44+
45+
critnib *mmaps; // a critnib map storing mmap mappings (addr, size)
46+
47+
// A critnib map storing (ptr, fd_offset + 1) pairs. We add 1 to fd_offset
48+
// in order to be able to store fd_offset equal 0, because
49+
// critnib_get() returns value or NULL, so a value cannot equal 0.
50+
// It is needed mainly in the get_ipc_handle and open_ipc_handle hooks
51+
// to mmap a specific part of a file.
52+
critnib *fd_offset_map;
53+
} file_memory_provider_t;
54+
3055
typedef struct file_last_native_error_t {
3156
int32_t native_error;
3257
int errno_value;

src/provider/provider_file_memory_internal.h

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)