hfsplus: add journal replay
------------------------------
Quoted 42 lines · GMT Sergei Antonov
Quoted 42 lines
fs/hfsplus/hfsplus_fs.h +5
-0@@ -166,6 +167,11 @@ struct hfsplus_sb_info { u32 total_blocks; u32 data_clump_blocks, rsrc_clump_blocks; + /* immutable data on the placement of the journal (if there is one) */ + u64 journal_offset; /* relative to volume start */ + u64 journal_size; /* relative to volume start */ + bool journal_swab; /* need swap bytes in journal */ + /* mutable data from the volume header, protected by alloc_mutex */ u32 free_blocks; struct mutex alloc_mutex;fs/hfsplus/hfsplus_raw.h +9
-1@@ -105,7 +105,7 @@ struct hfsplus_vh { __be16 version; __be32 attributes; __be32 last_mount_vers; - u32 reserved; + __be32 jrnl_info_block; __be32 create_date; __be32 modify_date;@@ -145,6 +145,69 @@ struct hfsplus_vh {#define HFSPLUS_VOL_JOURNALED (1 < 13)#define HFSPLUS_VOL_SOFTLOCK (1 < 15) +/* Journal info */ +struct hfs_jrnl_info { + __be32 flags; + u32 unused[8]; + __be64 journal_offset; /* Misaligned! relative to volume start */ + __be64 journal_size; /* Misaligned! relative to volume start */ +} __packed; +
Quoted 5 lines
Quoted 3 lines
Storing
journal_offsetandjournal_sizein two places seems redundant
- the journal info block is part of the volume header struct, which is accessible from the superblock struct.It is not in volume header. Only its block number is in header.
Hmm, would be make sense to hook them up? seems a bit strange
to have a smaller loose-hanging struct which is 2/3 of the superblock addition.
Quoted 10 lines
Quoted 4 lines
There are one or two spelling mistakes in one of the comments, as well as some grammar issues.
Thanks for spotting. Could you show them in a format like this?
- wrong text
+ corrected textI'd like to know of them.
'byte_len is a miltiple of journal block size'
<-> multiple
'converts it validates it'
<-> missing 'and'
Those are the two I noticed; obviously I wasn't particularly looking for them, as that sort of things aren't important in the bigger scheme of things.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 47 lines
Am 23.02.2014 um 07:03 schrieb Hin-Tak Leung <[email protected]>:
------------------------------
Quoted 42 lines · GMT Sergei Antonov
Quoted 42 lines
fs/hfsplus/hfsplus_fs.h +5
-0@@ -166,6 +167,11 @@ struct hfsplus_sb_info {u32 total_blocks;u32 data_clump_blocks, rsrc_clump_blocks; +/* immutable data on the placement of the journal (if there is one) */ +u64 journal_offset;/* relative to volume start */ +u64 journal_size;/* relative to volume start */ +bool journal_swab;/* need swap bytes in journal */ +/* mutable data from the volume header, protected by alloc_mutex */ u32 free_blocks;struct mutex alloc_mutex;fs/hfsplus/hfsplus_raw.h +9
-1@@ -105,7 +105,7 @@ struct hfsplus_vh {__be16 version;__be32 attributes;__be32 last_mount_vers; -u32 reserved; +__be32 jrnl_info_block;__be32 create_date;__be32 modify_date;@@ -145,6 +145,69 @@ struct hfsplus_vh {#define HFSPLUS_VOL_JOURNALED (1 < 13)#define HFSPLUS_VOL_SOFTLOCK (1 < 15) +/* Journal info */ +struct hfs_jrnl_info { +__be32 flags; +u32 unused[8 ]; +__be64 journal_offset;/* Misaligned! relative to volume start */ +__be64 journal_size;/* Misaligned! relative to volume start */ +} __packed; +
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Storing
journal_offsetandjournal_sizein two places seems redundant
- the journal info block is part of the volume header struct, which is accessible from the superblock struct.It is not in volume header. Only its block number is in header.
Hmm, would be make sense to hook them up? seems a bit strange
to have a smaller loose-hanging struct which is 2/3 of the superblock addition.
The structure has misaligned fields. It is only good for reading values through special misalignment-safe functions once. Temporal structure on a way to journal.