File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ fn increment_value(shmem_flink: &str, thread_num: usize) {
5757 let is_init: & mut AtomicU8 ;
5858
5959 unsafe {
60- is_init = & mut * ( raw_ptr as * mut u8 as * mut AtomicU8 ) ;
60+ is_init = & mut * ( raw_ptr as * mut AtomicU8 ) ;
6161 raw_ptr = raw_ptr. add ( 8 ) ;
6262 } ;
6363
Original file line number Diff line number Diff line change 11use std:: num:: NonZeroUsize ;
22use std:: os:: unix:: io:: RawFd ;
33use std:: ptr:: null_mut;
4+ use std:: os:: unix:: fs:: OpenOptionsExt ;
5+ use std:: os:: unix:: io:: AsRawFd ;
46
57use crate :: log:: * ;
68use nix:: fcntl:: OFlag ;
@@ -245,8 +247,6 @@ pub fn create_mapping_tmpfs(
245247 map_size : usize ,
246248 mode : Option < Mode > ,
247249) -> Result < MapData , ShmemError > {
248- use std:: os:: unix:: fs:: OpenOptionsExt ;
249- use std:: os:: unix:: io:: AsRawFd ;
250250
251251 let nz_map_size = NonZeroUsize :: new ( map_size) . ok_or ( ShmemError :: MapSizeZero ) ?;
252252 let mode_bits = mode. unwrap_or ( Mode :: S_IRUSR | Mode :: S_IWUSR ) . bits ( ) ;
@@ -258,7 +258,7 @@ pub fn create_mapping_tmpfs(
258258 . create_new ( true )
259259 . read ( true )
260260 . write ( true )
261- . mode ( mode_bits)
261+ . mode ( mode_bits. into ( ) )
262262 . open ( file_path)
263263 . map_err ( |e| match e. kind ( ) {
264264 std:: io:: ErrorKind :: AlreadyExists => ShmemError :: MappingIdExists ,
You can’t perform that action at this time.
0 commit comments