Skip to content

Remove unneeded headers #741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/provider/provider_devdax_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <string.h>

#include "base_alloc_global.h"
#include "provider_devdax_memory_internal.h"
#include "provider_os_memory_internal.h"
#include "utils_common.h"
#include "utils_concurrency.h"
Expand All @@ -28,6 +27,15 @@

#define TLS_MSG_BUF_LEN 1024

typedef struct devdax_memory_provider_t {
char path[PATH_MAX]; // a path to the device DAX
size_t size; // size of the file used for memory mapping
void *base; // base address of memory mapping
size_t offset; // offset in the file used for memory mapping
os_mutex_t lock; // lock of ptr and offset
unsigned protection; // combination of OS-specific protection flags
} devdax_memory_provider_t;

typedef struct devdax_last_native_error_t {
int32_t native_error;
int errno_value;
Expand Down
32 changes: 0 additions & 32 deletions src/provider/provider_devdax_memory_internal.h

This file was deleted.

27 changes: 26 additions & 1 deletion src/provider/provider_file_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#include "base_alloc_global.h"
#include "critnib.h"
#include "provider_file_memory_internal.h"
#include "provider_os_memory_internal.h"
#include "utils_common.h"
#include "utils_concurrency.h"
Expand All @@ -27,6 +26,32 @@

#define TLS_MSG_BUF_LEN 1024

typedef struct file_memory_provider_t {
os_mutex_t lock; // lock for file parameters (size and offsets)

char path[PATH_MAX]; // a path to the file
int fd; // file descriptor for memory mapping
size_t size_fd; // size of the file used for memory mappings
size_t offset_fd; // offset in the file used for memory mappings

void *base_mmap; // base address of the current memory mapping
size_t size_mmap; // size of the current memory mapping
size_t offset_mmap; // data offset in the current memory mapping

unsigned protection; // combination of OS-specific protection flags
unsigned visibility; // memory visibility mode
size_t page_size; // minimum page size

critnib *mmaps; // a critnib map storing mmap mappings (addr, size)

// A critnib map storing (ptr, fd_offset + 1) pairs. We add 1 to fd_offset
// in order to be able to store fd_offset equal 0, because
// critnib_get() returns value or NULL, so a value cannot equal 0.
// It is needed mainly in the get_ipc_handle and open_ipc_handle hooks
// to mmap a specific part of a file.
critnib *fd_offset_map;
} file_memory_provider_t;

typedef struct file_last_native_error_t {
int32_t native_error;
int errno_value;
Expand Down
50 changes: 0 additions & 50 deletions src/provider/provider_file_memory_internal.h

This file was deleted.

Loading