@@ -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
}
@@ -438,8 +440,6 @@ static umf_result_t devdax_open_ipc_handle(void *provider,
438
440
return UMF_RESULT_ERROR_INVALID_ARGUMENT ;
439
441
}
440
442
441
- devdax_memory_provider_t * devdax_provider =
442
- (devdax_memory_provider_t * )provider ;
443
443
devdax_ipc_data_t * devdax_ipc_data = (devdax_ipc_data_t * )providerIpcData ;
444
444
445
445
umf_result_t ret = UMF_RESULT_SUCCESS ;
@@ -454,22 +454,22 @@ static umf_result_t devdax_open_ipc_handle(void *provider,
454
454
455
455
// mmap /dev/dax with the MAP_SYNC xor MAP_SHARED flag (if MAP_SYNC fails)
456
456
char * base = utils_mmap_file (NULL , devdax_ipc_data -> size ,
457
- devdax_provider -> protection , map_sync_flag , fd ,
457
+ devdax_ipc_data -> protection , map_sync_flag , fd ,
458
458
0 /* offset */ );
459
459
if (base == NULL ) {
460
460
devdax_store_last_native_error (UMF_DEVDAX_RESULT_ERROR_ALLOC_FAILED ,
461
461
errno );
462
462
LOG_PERR ("devdax mapping failed (path: %s, size: %zu, protection: %i, "
463
463
"fd: %i)" ,
464
464
devdax_ipc_data -> path , devdax_ipc_data -> size ,
465
- devdax_provider -> protection , fd );
465
+ devdax_ipc_data -> protection , fd );
466
466
ret = UMF_RESULT_ERROR_MEMORY_PROVIDER_SPECIFIC ;
467
467
}
468
468
469
469
LOG_DEBUG ("devdax mapped (path: %s, size: %zu, protection: %i, fd: %i, "
470
470
"offset: %zu)" ,
471
471
devdax_ipc_data -> path , devdax_ipc_data -> size ,
472
- devdax_provider -> protection , fd , devdax_ipc_data -> offset );
472
+ devdax_ipc_data -> protection , fd , devdax_ipc_data -> offset );
473
473
474
474
(void )utils_close_fd (fd );
475
475
0 commit comments