@@ -53,9 +53,6 @@ const FMODE_EXEC: i32 = 0x20;
53
53
54
54
// const MAX_NAME_LENGTH: u32 = 255 - ENCRYPT_FILENAME_OVERHEAD_CHARS as u32;
55
55
56
- // Flags returned by the open request
57
- const FOPEN_DIRECT_IO : u32 = 1 << 0 ; // bypass page cache for this open file
58
-
59
56
pub struct DirectoryEntryIterator ( crate :: encryptedfs:: DirectoryEntryIterator , u64 ) ;
60
57
61
58
impl Iterator for DirectoryEntryIterator {
@@ -133,34 +130,17 @@ impl Iterator for DirectoryEntryPlusIterator {
133
130
134
131
pub struct EncryptedFsFuse3 {
135
132
fs : Arc < EncryptedFs > ,
136
- direct_io : bool ,
137
- suid_support : bool ,
138
133
}
139
134
140
135
impl EncryptedFsFuse3 {
141
136
pub async fn new (
142
137
data_dir : PathBuf ,
143
138
password_provider : Box < dyn PasswordProvider > ,
144
139
cipher : Cipher ,
145
- direct_io : bool ,
146
- #[ allow( unused_variables) ] suid_support : bool ,
147
140
) -> FsResult < Self > {
148
- // #[cfg(feature = "abi-7-26")]
149
- // {
150
- // Ok(Self {
151
- // fs: EncryptedFs::new(data_dir, password_provider, cipher).await?,
152
- // direct_io,
153
- // suid_support,
154
- // })
155
- // }
156
- // #[cfg(not(feature = "abi-7-26"))]
157
- // {
158
141
Ok ( Self {
159
142
fs : EncryptedFs :: new ( data_dir, password_provider, cipher) . await ?,
160
- direct_io,
161
- suid_support,
162
143
} )
163
- // }
164
144
}
165
145
166
146
fn get_fs ( & self ) -> Arc < EncryptedFs > {
@@ -169,11 +149,7 @@ impl EncryptedFsFuse3 {
169
149
170
150
#[ allow( clippy:: cast_possible_truncation) ]
171
151
const fn creation_mode ( & self , mode : u32 ) -> u16 {
172
- if self . suid_support {
173
- mode as u16
174
- } else {
175
- ( mode & !( libc:: S_ISUID | libc:: S_ISGID ) ) as u16
176
- }
152
+ ( mode & !( libc:: S_ISUID | libc:: S_ISGID ) ) as u16
177
153
}
178
154
179
155
#[ instrument( skip( self , name) , fields( name = name. to_str( ) . unwrap( ) ) , err( level = Level :: WARN ) , ret( level = Level :: DEBUG ) ) ]
@@ -933,7 +909,6 @@ impl Filesystem for EncryptedFsFuse3 {
933
909
EIO
934
910
} ) ?;
935
911
}
936
- let open_flags = if self . direct_io { FOPEN_DIRECT_IO } else { 0 } ;
937
912
let fh = self
938
913
. get_fs ( )
939
914
. open ( inode, read, write)
@@ -942,10 +917,7 @@ impl Filesystem for EncryptedFsFuse3 {
942
917
error ! ( err = %err) ;
943
918
EIO
944
919
} ) ?;
945
- Ok ( ReplyOpen {
946
- fh,
947
- flags : open_flags,
948
- } )
920
+ Ok ( ReplyOpen { fh, flags : 0 } )
949
921
} else {
950
922
return Err ( EACCES . into ( ) ) ;
951
923
}
@@ -1102,10 +1074,9 @@ impl Filesystem for EncryptedFsFuse3 {
1102
1074
} ;
1103
1075
1104
1076
if check_access ( attr. uid , attr. gid , attr. perm , req. uid , req. gid , access_mask) {
1105
- let open_flags = if self . direct_io { FOPEN_DIRECT_IO } else { 0 } ;
1106
1077
Ok ( ReplyOpen {
1107
1078
fh : 0 , // we don't use handles for directories
1108
- flags : open_flags ,
1079
+ flags : 0 ,
1109
1080
} )
1110
1081
} else {
1111
1082
return Err ( EACCES . into ( ) ) ;
@@ -1485,8 +1456,7 @@ async fn mount_fuse(
1485
1456
info ! ( "Checking password and mounting FUSE filesystem" ) ;
1486
1457
Ok ( Session :: new ( mount_options)
1487
1458
. mount_with_unprivileged (
1488
- EncryptedFsFuse3 :: new ( data_dir, password_provider, cipher, direct_io, suid_support)
1489
- . await ?,
1459
+ EncryptedFsFuse3 :: new ( data_dir, password_provider, cipher) . await ?,
1490
1460
mount_path,
1491
1461
)
1492
1462
. await ?)
0 commit comments