@@ -371,6 +371,7 @@ static umf_result_t devdax_allocation_merge(void *provider, void *lowPtr,
371
371
typedef struct devdax_ipc_data_t {
372
372
char path [PATH_MAX ]; // path to the /dev/dax
373
373
size_t size ; // size of the /dev/dax
374
+ unsigned protection ; // combination of OS-specific memory protection flags
374
375
size_t offset ; // offset of the data
375
376
} devdax_ipc_data_t ;
376
377
@@ -401,6 +402,7 @@ static umf_result_t devdax_get_ipc_handle(void *provider, const void *ptr,
401
402
strncpy (devdax_ipc_data -> path , devdax_provider -> path , PATH_MAX - 1 );
402
403
devdax_ipc_data -> path [PATH_MAX - 1 ] = '\0' ;
403
404
devdax_ipc_data -> size = devdax_provider -> size ;
405
+ devdax_ipc_data -> protection = devdax_provider -> protection ;
404
406
405
407
return UMF_RESULT_SUCCESS ;
406
408
}
@@ -454,22 +456,22 @@ static umf_result_t devdax_open_ipc_handle(void *provider,
454
456
455
457
// mmap /dev/dax with the MAP_SYNC xor MAP_SHARED flag (if MAP_SYNC fails)
456
458
char * base = utils_mmap_file (NULL , devdax_ipc_data -> size ,
457
- devdax_provider -> protection , map_sync_flag , fd ,
459
+ devdax_ipc_data -> protection , map_sync_flag , fd ,
458
460
0 /* offset */ );
459
461
if (base == NULL ) {
460
462
devdax_store_last_native_error (UMF_DEVDAX_RESULT_ERROR_ALLOC_FAILED ,
461
463
errno );
462
464
LOG_PERR ("devdax mapping failed (path: %s, size: %zu, protection: %i, "
463
465
"fd: %i)" ,
464
466
devdax_ipc_data -> path , devdax_ipc_data -> size ,
465
- devdax_provider -> protection , fd );
467
+ devdax_ipc_data -> protection , fd );
466
468
ret = UMF_RESULT_ERROR_MEMORY_PROVIDER_SPECIFIC ;
467
469
}
468
470
469
471
LOG_DEBUG ("devdax mapped (path: %s, size: %zu, protection: %i, fd: %i, "
470
472
"offset: %zu)" ,
471
473
devdax_ipc_data -> path , devdax_ipc_data -> size ,
472
- devdax_provider -> protection , fd , devdax_ipc_data -> offset );
474
+ devdax_ipc_data -> protection , fd , devdax_ipc_data -> offset );
473
475
474
476
(void )utils_close_fd (fd );
475
477
0 commit comments