@@ -113,6 +113,35 @@ where
113
113
S : for < ' a > FileSystems < ' a > + Send + Sync + ' static ,
114
114
for < ' a > <<S as FileSystems < ' a > >:: Iter as IntoIterator >:: IntoIter : Send ,
115
115
{
116
+ fn readlink ( & self , path : & Path ) -> crate :: Result < PathBuf > {
117
+ // Whiteout files can not be read, they are just markers
118
+ if ops:: is_white_out ( path) . is_some ( ) {
119
+ return Err ( FsError :: EntryNotFound ) ;
120
+ }
121
+
122
+ // Check if the file is in the primary
123
+ match self . primary . readlink ( path) {
124
+ Ok ( meta) => return Ok ( meta) ,
125
+ Err ( e) if should_continue ( e) => { }
126
+ Err ( e) => return Err ( e) ,
127
+ }
128
+
129
+ // There might be a whiteout, search for this
130
+ if ops:: has_white_out ( & self . primary , path) {
131
+ return Err ( FsError :: EntryNotFound ) ;
132
+ }
133
+
134
+ // Otherwise scan the secondaries
135
+ for fs in self . secondaries . filesystems ( ) {
136
+ match fs. readlink ( path) {
137
+ Err ( e) if should_continue ( e) => continue ,
138
+ other => return other,
139
+ }
140
+ }
141
+
142
+ Err ( FsError :: EntryNotFound )
143
+ }
144
+
116
145
fn read_dir ( & self , path : & Path ) -> Result < ReadDir , FsError > {
117
146
let mut entries = Vec :: new ( ) ;
118
147
let mut had_at_least_one_success = false ;
@@ -328,6 +357,35 @@ where
328
357
Err ( FsError :: EntryNotFound )
329
358
}
330
359
360
+ fn symlink_metadata ( & self , path : & Path ) -> crate :: Result < Metadata > {
361
+ // Whiteout files can not be read, they are just markers
362
+ if ops:: is_white_out ( path) . is_some ( ) {
363
+ return Err ( FsError :: EntryNotFound ) ;
364
+ }
365
+
366
+ // Check if the file is in the primary
367
+ match self . primary . symlink_metadata ( path) {
368
+ Ok ( meta) => return Ok ( meta) ,
369
+ Err ( e) if should_continue ( e) => { }
370
+ Err ( e) => return Err ( e) ,
371
+ }
372
+
373
+ // There might be a whiteout, search for this
374
+ if ops:: has_white_out ( & self . primary , path) {
375
+ return Err ( FsError :: EntryNotFound ) ;
376
+ }
377
+
378
+ // Otherwise scan the secondaries
379
+ for fs in self . secondaries . filesystems ( ) {
380
+ match fs. symlink_metadata ( path) {
381
+ Err ( e) if should_continue ( e) => continue ,
382
+ other => return other,
383
+ }
384
+ }
385
+
386
+ Err ( FsError :: EntryNotFound )
387
+ }
388
+
331
389
fn remove_file ( & self , path : & Path ) -> Result < ( ) , FsError > {
332
390
// It is not possible to delete whiteout files directly, instead
333
391
// one must delete the original file
0 commit comments