File tree 4 files changed +15
-1
lines changed
4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -831,6 +831,9 @@ impl Bootstrap {
831
831
if ctx. conversion_type == ConversionType :: TarToTarfs {
832
832
ext_sb. set_tarfs_mode ( ) ;
833
833
}
834
+ if ctx. conversion_type == ConversionType :: TargzToRef {
835
+ ext_sb. set_targz_ref_mode ( ) ;
836
+ }
834
837
bootstrap_ctx
835
838
. writer
836
839
. seek_offset ( ( EROFS_SUPER_OFFSET + EROFS_SUPER_BLOCK_SIZE ) as u64 )
Original file line number Diff line number Diff line change @@ -83,6 +83,10 @@ impl DirectMappingState {
83
83
self . meta . flags . contains ( RafsSuperFlags :: TARTFS_MODE )
84
84
}
85
85
86
+ fn is_zran ( & self ) -> bool {
87
+ self . meta . flags . contains ( RafsSuperFlags :: TARGZ_REF_MODE )
88
+ }
89
+
86
90
fn block_size ( & self ) -> u64 {
87
91
if self . is_tarfs ( ) {
88
92
EROFS_BLOCK_SIZE_512
@@ -1349,7 +1353,7 @@ impl RafsInodeExt for OndiskInodeWrapper {
1349
1353
blob_index, chunk_index
1350
1354
) )
1351
1355
} )
1352
- } else if state. is_tarfs ( ) || state. meta . has_inlined_chunk_digest ( ) {
1356
+ } else if state. is_tarfs ( ) || state. is_zran ( ) {
1353
1357
let size = if idx == self . get_chunk_count ( ) - 1 {
1354
1358
( self . size ( ) % self . chunk_size ( ) as u64 ) as u32
1355
1359
} else {
Original file line number Diff line number Diff line change @@ -559,6 +559,10 @@ impl RafsV6SuperBlockExt {
559
559
self . s_flags |= RafsSuperFlags :: TARTFS_MODE . bits ( ) ;
560
560
}
561
561
562
+ pub fn set_targz_ref_mode ( & mut self ) {
563
+ self . s_flags |= RafsSuperFlags :: TARGZ_REF_MODE . bits ( ) ;
564
+ }
565
+
562
566
/// Set message digest algorithm to handle chunk of the Rafs filesystem.
563
567
pub fn set_digester ( & mut self , digester : digest:: Algorithm ) {
564
568
let c: RafsSuperFlags = digester. into ( ) ;
Original file line number Diff line number Diff line change @@ -301,6 +301,9 @@ bitflags! {
301
301
const INLINED_CHUNK_DIGEST = 0x0000_0100 ;
302
302
/// RAFS works in Tarfs mode, which directly uses tar streams as data blobs.
303
303
const TARTFS_MODE = 0x0000_0200 ;
304
+
305
+ const TARGZ_REF_MODE = 0x0000_0400 ;
306
+
304
307
/// Data chunks are not encrypted.
305
308
const ENCRYPTION_NONE = 0x0100_0000 ;
306
309
/// Data chunks are encrypted with AES-128-XTS.
You can’t perform that action at this time.
0 commit comments