reiserfs: implement basic reiserfs 3.7
PATCH 1/1 reiserfs: implement basic reiserfs 3.7
This patch contains the basic implementation for reiserfs 3.7.
Specifically, it extends reiserfs 3.6 to allow feature compatibility bits. Since it extends v3.6, it assumes allowing a nonstandard journal, so some paths have been adjusted to test for a nonstandard journal instead of just having the JR superblock magic.
I don't have any large plans to extend beyond some very basic features, although extended attributes would be much more efficiently implemented if they were first class items instead of hidden files.
The next patch in the series adds support to allow v2 stat data items to describe the number of blocks in fs-blocksize blocks instead of 512 byte blocks.
--- fs/reiserfs/journal.c | 2 fs/reiserfs/prints.c | 6 + fs/reiserfs/procfs.c | 4 - fs/reiserfs/super.c | 140 ++++++++++++++++++++++++++++++++++++++++- include/linux/magic.h | 1 include/linux/reiserfs_fs.h | 11 ++- include/linux/reiserfs_fs_sb.h | 39 +++++++++++ 7 files changed, 196 insertions(+), 7 deletions(-)
fs/reiserfs/journal.c +1 -1
@@ -2850,7 +2850,7 @@ int journal_init(struct super_block *sb, jh = (struct reiserfs_journal_header *)(bhjh->b_data);/* make sure that journal matches to the super block */ -if (is_reiserfs_jr (rs) +if (has_nonstandard_journal (rs) && (le32_to_cpu (jh->jh_journal.jp_journal_magic) !=sb_jp_journal_magic (rs))) { reiserfs_warning(sb, "sh-460",
fs/reiserfs/prints.c +4 -2
@@ -532,6 +532,8 @@ static int print_super_block(struct buff }else if (is_reiserfs_jr (rs)) { version = ((sb_version (rs) ==REISERFS_VERSION_2 ) ?"3.6" :"3.5" ); + }else if (is_reiserfs_3_7 (rs)) { + version ="3.7" ; }else {return 1 ; }
@@ -547,12 +549,12 @@ static int print_super_block(struct buff// skipped = (bh->b_blocknr * bh->b_size) / sb_blocksize(rs); skipped = bh->b_blocknr; data_blocks =sb_block_count (rs) - skipped -1 -sb_bmap_nr (rs) - - (!is_reiserfs_jr (rs) ?sb_jp_journal_size (rs) + + (!has_nonstandard_journal (rs) ?sb_jp_journal_size (rs) +1 :sb_reserved_for_journal (rs)) -sb_free_blocks (rs);printk ("Busy blocks (skipped %d, bitmaps - %d, journal (or reserved) blocks - %d\n" "1 super block, %d data blocks\n" , skipped,sb_bmap_nr (rs), - (!is_reiserfs_jr (rs) ? (sb_jp_journal_size (rs) +1 ) : + (!has_nonstandard_journal (rs) ? (sb_jp_journal_size (rs) +1 ) :sb_reserved_for_journal (rs)), data_blocks);printk ("Root block %u\n" ,sb_root_block (rs));printk ("Journal block (first) %d\n" ,sb_jp_journal_1st_block (rs));
fs/reiserfs/procfs.c +3 -1
@@ -28,7 +28,9 @@ static int show_version(struct seq_file {char *format; -if (REISERFS_SB (sb)->s_properties & (1 <<REISERFS_3_6 )) { +if (REISERFS_SB (sb)->s_properties & (1 <<REISERFS_3_7 )) { + format ="3.7" ; + }else if (REISERFS_SB (sb)->s_properties & (1 <<REISERFS_3_6 )) { format ="3.6" ; }else if (REISERFS_SB (sb)->s_properties & (1 <<REISERFS_3_5 )) { format ="3.5" ;
fs/reiserfs/super.c +139 -1
188 lines not on this page · raw message
include/linux/magic.h +1 -0
@@ -46,6 +46,7 @@#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs" +#define REISERFS_37_SUPER_MAGIC_STRING "ReIsEr7Fs"#define SMB_SUPER_MAGIC 0x517B#define USBDEVICE_SUPER_MAGIC 0x9fa2
include/linux/reiserfs_fs.h +9 -2
@@ -263,7 +263,7 @@ struct reiserfs_super_block_v1 {__le16 s_bmap_nr;/* amount of bitmap blocks needed to address * each block of file system */ __le16 s_version;/* this field is only reliable on filesystem -* with non-standard journal */ +* with non-standard journal or reiserfs 3.7 */ __le16 s_reserved_for_journal;/* size in blocks of journal area on main * device, we need to keep after * making fs with non-standard journal */
@@ -282,7 +282,11 @@ struct reiserfs_super_block {__le16 s_max_mnt_count;/* Maximum mounts before check */ __le32 s_lastcheck;/* Timestamp of last fsck */ __le32 s_check_interval;/* Interval between checks */ -char s_unused[76 ];/* zero filled by mkreiserfs and +/* Only available in superblock v3/reiserfs 3.7 */ +__le32 s_feature_compat;/* compatible feature set */ +__le32 s_feature_incompat;/* incompatible feature set */ +__le32 s_feature_ro_compat;/* readonly-compatible feature set */ +char s_unused[64 ];/* zero filled by mkreiserfs and * reiserfs_convert_objectid_map_v1() * so any additions must be updated * there as well. */
@@ -292,6 +296,7 @@ struct reiserfs_super_block {#define REISERFS_VERSION_1 0#define REISERFS_VERSION_2 2 +#define REISERFS_VERSION_3 3// on-disk super block fields converted to cpu form #define SB_DISK_SUPER_BLOCK (s) (REISERFS_SB(s)->s_rs)
@@ -347,6 +352,8 @@ struct reiserfs_super_block {int is_reiserfs_3_5 (struct reiserfs_super_block *rs);int is_reiserfs_3_6 (struct reiserfs_super_block *rs);int is_reiserfs_jr (struct reiserfs_super_block *rs); +int is_reiserfs_3_7 (struct reiserfs_super_block *rs); +int has_nonstandard_journal (struct reiserfs_super_block *rs);/* ReiserFS leaves the first 64k unused, so that partition labels have enough space. If someone wants to write a fancy bootloader that
include/linux/reiserfs_fs_sb.h +39 -0
@@ -83,6 +83,17 @@ typedef enum {#define set_sb_reserved_for_journal (sbp,v) \ ((sbp)->s_v1.s_reserved_for_journal = cpu_to_le16(v)) +#define sb_feature_compat (sbp) (le32_to_cpu((sbp)->s_feature_compat)) +#define set_sb_feature_compat (sbp) ((sbp)->s_feature_compat = cpu_to_le32(v)) + +#define sb_feature_incompat (sbp) (le32_to_cpu((sbp)->s_feature_incompat)) +#define set_sb_feature_incompat (sbp) \ + ((sbp)->s_feature_incompat = cpu_to_le32(v)) + +#define sb_feature_ro_compat (sbp) (le32_to_cpu((sbp)->s_feature_ro_compat)) +#define set_sb_feature_ro_compat (sbp) \ + ((sbp)->s_feature_ro_compat = cpu_to_le32(v)) +/* LOGGING -- */ /* These all interelate for performance.
@@ -434,6 +445,7 @@ struct reiserfs_sb_info {#define REISERFS_3_5 0#define REISERFS_3_6 1#define REISERFS_OLD_FORMAT 2 +#define REISERFS_3_7 3enum reiserfs_mount_options {/* Mount options */
@@ -519,6 +531,33 @@ enum reiserfs_mount_options {#define reiserfs_error_panic (s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_PANIC))#define reiserfs_error_ro (s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_RO)) +/* reiserfs 3.7 features */ +#define REISERFS_HAS_COMPAT_FEATURE (sb, mask) \ + (REISERFS_SB(sb)->s_rs->s_feature_compat & cpu_to_le32(mask)) +#define REISERFS_HAS_INCOMPAT_FEATURE (sb, mask) \ + (REISERFS_SB(sb)->s_rs->s_feature_incompat & cpu_to_le32(mask)) +#define REISERFS_HAS_RO_COMPAT_FEATURE (sb, mask) \ + (REISERFS_SB(sb)->s_rs->s_feature_ro_compat & cpu_to_le32(mask)) + +#define REISERFS_SET_COMPAT_FEATURE (sb, mask) \ + (REISERFS_SB(sb)->s_rs->s_feature_compat |= cpu_to_le32(mask)) +#define REISERFS_SET_INCOMPAT_FEATURE (sb, mask) \ + (REISERFS_SB(sb)->s_rs->s_feature_incompat |= cpu_to_le32(mask)) +#define REISERFS_SET_RO_COMPAT_FEATURE (sb, mask) \ + (REISERFS_SB(sb)->s_rs->s_feature_ro_compat |= cpu_to_le32(mask)) + +#define REISERFS_CLEAR_COMPAT_FEATURE (sb, mask) \ + (REISERFS_SB(sb)->s_rs->s_feature_compat &= ~cpu_to_le32(mask)) +#define REISERFS_CLEAR_INCOMPAT_FEATURE (sb, mask) \ + (REISERFS_SB(sb)->s_rs->s_feature_incompat &= ~cpu_to_le32(mask)) +#define REISERFS_CLEAR_RO_COMPAT_FEATURE (sb, mask) \ + (REISERFS_SB(sb)->s_rs->s_feature_ro_compat &= ~cpu_to_le32(mask)) + +/* No features yet */ +#define REISERFS_FEATURE_COMPAT_SUPP 0 +#define REISERFS_FEATURE_INCOMPAT_SUPP 0 +#define REISERFS_FEATURE_RO_COMPAT_SUPP 0 +void reiserfs_file_buffer (struct buffer_head *bh,int list);extern struct file_system_type reiserfs_fs_type;int reiserfs_resize (struct super_block *,unsigned long );
Signature · 2 lines
Jeff Mahoney SUSE Labs
Quoted 29 lines · Jeff Mahoney
This patch contains the basic implementation for reiserfs 3.7.
Specifically, it extends reiserfs 3.6 to allow feature compatibility bits. Since it extends v3.6, it assumes allowing a nonstandard journal, so some paths have been adjusted to test for a nonstandard journal instead of just having the JR superblock magic.
I don't have any large plans to extend beyond some very basic features, although extended attributes would be much more efficiently implemented if they were first class items instead of hidden files.
The next patch in the series adds support to allow v2 stat data items to describe the number of blocks in fs-blocksize blocks instead of 512 byte blocks.
Signed-off-by Jeff Mahoney <[email protected]>--- fs/reiserfs/journal.c | 2 fs/reiserfs/prints.c | 6 + fs/reiserfs/procfs.c | 4 - fs/reiserfs/super.c | 140 ++++++++++++++++++++++++++++++++++++++++- include/linux/magic.h | 1 include/linux/reiserfs_fs.h | 11 ++- include/linux/reiserfs_fs_sb.h | 39 +++++++++++ 7 files changed, 196 insertions(+), 7 deletions(-)
fs/reiserfs/journal.c int journal_init(struct super_block *sb, · line 2854
Quoted 6 lines
fs/reiserfs/journal.c +1
-1@@ -2850,7 +2850,7 @@ int journal_init(struct super_block *sb, jh = (struct reiserfs_journal_header *)(bhjh->b_data);/* make sure that journal matches to the super block */ - if (is_reiserfs_jr(rs) + if (has_nonstandard_journal(rs)
Nup.
Should be:
if ((is_reiserfs_jr(rs) || is_reiserfs_3_7)
Quoted 15 lines
fs/reiserfs/journal.c +0
-0&& (le32_to_cpu(jh->jh_journal.jp_journal_magic) != sb_jp_journal_magic(rs))) {fs/reiserfs/journal.c +0
-0reiserfs_warning(sb, "sh-460",fs/reiserfs/prints.c +2
-0@@ -532,6 +532,8 @@ static int print_super_block(struct buff }else if (is_reiserfs_jr (rs)) { version = ((sb_version (rs) ==REISERFS_VERSION_2 ) ?"3.6" :"3.5" ); + }else if (is_reiserfs_3_7 (rs)) { + version ="3.7" ; }else {return 1 ; }
fs/reiserfs/prints.c static int print_super_block(struct buff · line 553
Quoted 6 lines
fs/reiserfs/prints.c +1
-1@@ -547,12 +549,12 @@ static int print_super_block(struct buff// skipped = (bh->b_blocknr * bh->b_size) / sb_blocksize(rs); skipped = bh->b_blocknr; data_blocks = sb_block_count(rs) - skipped - 1 - sb_bmap_nr(rs) - - (!is_reiserfs_jr(rs) ? sb_jp_journal_size(rs) + + (!has_nonstandard_journal(rs) ? sb_jp_journal_size(rs) +
ditto
fs/reiserfs/prints.c static int print_super_block(struct buff
Quoted 7 lines
fs/reiserfs/prints.c +1
-11 : sb_reserved_for_journal(rs)) - sb_free_blocks(rs); printk ("Busy blocks (skipped %d, bitmaps - %d, journal (or reserved) blocks - %d\n" "1 super block, %d data blocks\n", skipped, sb_bmap_nr(rs), - (!is_reiserfs_jr(rs) ? (sb_jp_journal_size(rs) + 1) : + (!has_nonstandard_journal(rs) ? (sb_jp_journal_size(rs) + 1) :
ditto
Quoted 44 lines
fs/reiserfs/prints.c +0
-0sb_reserved_for_journal(rs)), data_blocks);fs/reiserfs/prints.c +0
-0printk ("Root block %u\n" ,sb_root_block (rs));printk ("Journal block (first) %d\n" ,sb_jp_journal_1st_block (rs));fs/reiserfs/procfs.c +3
-1@@ -28,7 +28,9 @@ static int show_version(struct seq_file {char *format; -if (REISERFS_SB (sb)->s_properties & (1 <<REISERFS_3_6 )) { +if (REISERFS_SB (sb)->s_properties & (1 <<REISERFS_3_7 )) { + format ="3.7" ; + }else if (REISERFS_SB (sb)->s_properties & (1 <<REISERFS_3_6 )) { format ="3.6" ; }else if (REISERFS_SB (sb)->s_properties & (1 <<REISERFS_3_5 )) { format ="3.5" ;fs/reiserfs/super.c +7
-1@@ -35,6 +35,7 @@ struct file_system_type reiserfs_fs_typestatic const char reiserfs_3_5_magic_string[] =REISERFS_SUPER_MAGIC_STRING ;static const char reiserfs_3_6_magic_string[] =REISER2FS_SUPER_MAGIC_STRING ;static const char reiserfs_jr_magic_string[] =REISER2FS_JR_SUPER_MAGIC_STRING ; +static const char reiserfs_3_7_magic_string[] =REISERFS_37_SUPER_MAGIC_STRING ;int is_reiserfs_3_5 (struct reiserfs_super_block *rs) {@@ -48,6 +49,12 @@ int is_reiserfs_3_6(struct reiserfs_supe strlen(reiserfs_3_6_magic_string)); } +int is_reiserfs_3_7 (struct reiserfs_super_block *rs) +{ +return !strncmp (rs->s_v1.s_magic, reiserfs_3_7_magic_string, +strlen (reiserfs_3_7_magic_string)); +} +int is_reiserfs_jr (struct reiserfs_super_block *rs) { return !strncmp(rs->s_v1.s_magic, reiserfs_jr_magic_string,@@ -57,7 +64,13 @@ int is_reiserfs_jr(struct reiserfs_superstatic int is_any_reiserfs_magic_string (struct reiserfs_super_block *rs) { return (is_reiserfs_3_5(rs) || is_reiserfs_3_6(rs) || -is_reiserfs_jr (rs));
fs/reiserfs/super.c int is_reiserfs_jr(struct reiserfs_super · line 76
Quoted 10 lines
fs/reiserfs/super.c +7
-0+ is_reiserfs_3_7(rs) || is_reiserfs_jr(rs)); +} + +int has_nonstandard_journal (struct reiserfs_super_block *rs) +{ +return is_reiserfs_jr (rs) || + (is_reiserfs_3_7 (rs) && rs->s_v1.s_journal.jp_journal_dev); }
Actually the function above is brain damaged.
Journal is non-standard _iff_ it is "relocated" or has length (excluding journal
header) different from 8192. So it can happen that a partition is "jr" (with REISER2FS_JR_SUPER_MAGIC_STRING), but has _standard_ journal.
Quoted 17 lines
static int
reiserfs_remount(struct super_block *s, int *flags, char *data);fs/reiserfs/super.c +4
-0@@ -1397,6 +1410,10 @@ static int read_super_block(struct super "non-standard magic", sb_version(rs));return 1 ; } + }else if (is_reiserfs_3_7 (rs)) { +reiserfs_info (s,"found reiserfs format \"3.7\" " +"with %sstandard journal\n" , +sb_jp_journal_dev (rs) ?"non-" :"" ); }else /* s_version of standard format may contain incorrect information, so we just look at the magic string */ @@ -1404,6 +1421,7 @@ static int read_super_block(struct super"found reiserfs format \"%s\" with standard journal\n" , is_reiserfs_3_5(rs) ? "3.5" : "3.6");
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 16 lines · Edward Shishkin
fs/reiserfs/super.c int is_reiserfs_jr(struct reiserfs_super · line 74
Quoted 9 lines · Jeff Mahoney
This patch contains the basic implementation for reiserfs 3.7.
fs/reiserfs/super.c +4
-0+int has_nonstandard_journal (struct reiserfs_super_block *rs) +{ +return is_reiserfs_jr (rs) || + (is_reiserfs_3_7 (rs) && rs->s_v1.s_journal.jp_journal_dev); }Actually the function above is brain damaged.
Journal is non-standard _iff_ it is "relocated" or has length (excluding journal
header) different from 8192. So it can happen that a partition is "jr" (withREISER2FS_JR_SUPER_MAGIC_STRING), but has _standard_ journal.
Ok. I was under the impression that reiserfs_jr implied a nonstandard journal. I guess that's mistaken. It seems to me that the only thing wrong with the patch is the dev check and the name of the function. Perhaps it should be may_have_nonstandard_journal(). The idea wasn't to identify nonstandard journals but to extend the existing jr checks to include 3.7 checks as well.
- -Jeff
- --
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/
iEYEARECAAYFAkz0CL8ACgkQLPWxlyuTD7KpOgCdGkzb5GvbXXPEck1qx5AN1Qcg xHgAn3KmHQGC/cxxoKrswuovhGR8Qq9f
=ZQMq
-----END PGP SIGNATURE-----
Quoted 15 lines · Jeff Mahoney
Quoted 14 lines · Edward Shishkin
fs/reiserfs/super.c int is_reiserfs_jr(struct reiserfs_super · line 74
Quoted 9 lines · Jeff Mahoney
This patch contains the basic implementation for reiserfs 3.7.
fs/reiserfs/super.c +4
-0+int has_nonstandard_journal (struct reiserfs_super_block *rs) +{ +return is_reiserfs_jr (rs) || + (is_reiserfs_3_7 (rs) && rs->s_v1.s_journal.jp_journal_dev); }Actually the function above is brain damaged.
Journal is non-standard _iff_ it is "relocated" or has length (excluding journal
header) different from 8192. So it can happen that a partition is
Quoted 5 lines
"jr" (with
Quoted 1 line
REISER2FS_JR_SUPER_MAGIC_STRING), but has _standard_ journal.Ok. I was under the impression that
reiserfs_jrimplied a nonstandard journal. I guess that's mistaken.
IMHO the trick is that there are "super-magics" and "super-formats" (it is not the same).JR_SUPER_MAGIC_STRING indicates some super-format 3.X (X = 5, 6,...) with "possibly non-standard journal".
By default mkfs installs 3_X_SUPER_MAGIC_STRING (X = 5, 6,...). In particular, such magic string indicates that your journal is "untouched" (valid).JR_SUPER_MAGIC_STRING is set by mkfs when specifying non-standard journal parameters, or by reiserfstune when changing journal parameters. If JR_SUPER_MAGIC_STRING is set, then actual super-format (3.X) is located at special field sb_version.
Once JR_SUPER_MAGIC_STRING is installed, you must check journal magic in mount time, as your journal can be invalid (replaying invalid journal is disaster).
So I guess we need two things:
1) REISERFS_3_7_SUPER_MAGIC_STRING
2) REISERFS_FORMAT_3_7.
Next version of reiserfsprogs (3.6.22, I guess) will install REISERFS_3_7_SUPER_MAGIC_STRING by default. Also we need to make sure that correct super-format is installed to sb_version when updating to JR_SUPER_MAGIC_STRING.
Quoted 2 lines
It seems to me that the only thing
wrong with the patch is the dev check and the name of the function.
I think, we don't need to change things with "jr" at all: the property to be "jr" is common for all 3.x
Quoted 1 line
Perhaps it should be
may_have_nonstandard_journal().
is_reiserfs_jr() means exactly "may have non-standard journal" for all 3.x
Quoted 6 lines
The idea wasn't to
identify nonstandard journals but to extend the existing jr checks to include 3.7 checks as well.-Jeff
Quoted 33 lines · Edward Shishkin
Quoted 31 lines · Jeff Mahoney
This patch contains the basic implementation for reiserfs 3.7.
Specifically, it extends reiserfs 3.6 to allow feature compatibility bits. Since it extends v3.6, it assumes allowing a nonstandard journal, so some paths have been adjusted to test for a nonstandard journal instead of just having the JR superblock magic.
I don't have any large plans to extend beyond some very basic features, although extended attributes would be much more efficiently implemented if they were first class items instead of hidden files.
The next patch in the series adds support to allow v2 stat data items to describe the number of blocks in fs-blocksize blocks instead of 512 byte blocks.
Signed-off-by Jeff Mahoney <[email protected]>--- fs/reiserfs/journal.c | 2 fs/reiserfs/prints.c | 6 + fs/reiserfs/procfs.c | 4 - fs/reiserfs/super.c | 140 ++++++++++++++++++++++++++++++++++++++++- include/linux/magic.h | 1 include/linux/reiserfs_fs.h | 11 ++- include/linux/reiserfs_fs_sb.h | 39 +++++++++++ 7 files changed, 196 insertions(+), 7 deletions(-)fs/reiserfs/journal.c +0
-0@@ -2850,7 +2850,7 @@ int journal_init(struct super_block *sb, jh = (struct reiserfs_journal_header *)(bhjh->b_data);
Quoted 10 lines
fs/reiserfs/journal.c int journal_init(struct super_block *sb,
Quoted 5 lines
fs/reiserfs/journal.c +1
-1/* make sure that journal matches to the super block */ - if (is_reiserfs_jr(rs) + if (has_nonstandard_journal(rs)Nup.
Should be:
if ((is_reiserfs_jr(rs)||is_reiserfs_3_7)
I was wrong here: this should be untouched
Quoted 83 lines
Quoted 16 lines
fs/reiserfs/journal.c +0
-0&& (le32_to_cpu(jh->jh_journal.jp_journal_magic) !=fs/reiserfs/journal.c +0
-0sb_jp_journal_magic(rs))) { reiserfs_warning(sb, "sh-460",fs/reiserfs/prints.c +2
-0@@ -532,6 +532,8 @@ static int print_super_block(struct buff }else if (is_reiserfs_jr (rs)) { version = ((sb_version (rs) ==REISERFS_VERSION_2 ) ?"3.6" :"3.5" ); + }else if (is_reiserfs_3_7 (rs)) { + version ="3.7" ; }else {return 1 ; }fs/reiserfs/prints.c static int print_super_block(struct buff · line 554
Quoted 7 lines
fs/reiserfs/prints.c +1
-1@@ -547,12 +549,12 @@ static int print_super_block(struct buff// skipped = (bh->b_blocknr * bh->b_size) / sb_blocksize(rs); skipped = bh->b_blocknr; data_blocks = sb_block_count(rs) - skipped - 1 - sb_bmap_nr(rs) - - (!is_reiserfs_jr(rs) ? sb_jp_journal_size(rs) + + (!has_nonstandard_journal(rs) ? sb_jp_journal_size(rs) +ditto
fs/reiserfs/prints.c static int print_super_block(struct buff
Quoted 8 lines
fs/reiserfs/prints.c +1
-11 : sb_reserved_for_journal(rs)) - sb_free_blocks(rs); printk ("Busy blocks (skipped %d, bitmaps - %d, journal (or reserved) blocks - %d\n" "1 super block, %d data blocks\n", skipped, sb_bmap_nr(rs), - (!is_reiserfs_jr(rs) ? (sb_jp_journal_size(rs) + 1) : + (!has_nonstandard_journal(rs) ? (sb_jp_journal_size(rs) + 1) :ditto
Quoted 47 lines
fs/reiserfs/prints.c +0
-0sb_reserved_for_journal(rs)), data_blocks);printk ("Root block %u\n" ,sb_root_block (rs));printk ("Journal block (first) %d\n" ,sb_jp_journal_1st_block (rs));fs/reiserfs/procfs.c +3
-1@@ -28,7 +28,9 @@ static int show_version(struct seq_file {char *format; -if (REISERFS_SB (sb)->s_properties & (1 <<REISERFS_3_6 )) { +if (REISERFS_SB (sb)->s_properties & (1 <<REISERFS_3_7 )) { + format ="3.7" ; + }else if (REISERFS_SB (sb)->s_properties & (1 <<REISERFS_3_6 )) { format ="3.6" ; }else if (REISERFS_SB (sb)->s_properties & (1 <<REISERFS_3_5 )) { format ="3.5" ;fs/reiserfs/super.c +10
-1@@ -35,6 +35,7 @@ struct file_system_type reiserfs_fs_typestatic const char reiserfs_3_5_magic_string[] =REISERFS_SUPER_MAGIC_STRING ;static const char reiserfs_3_6_magic_string[] =REISER2FS_SUPER_MAGIC_STRING ;static const char reiserfs_jr_magic_string[] =REISER2FS_JR_SUPER_MAGIC_STRING ; +static const char reiserfs_3_7_magic_string[] =REISERFS_37_SUPER_MAGIC_STRING ;int is_reiserfs_3_5 (struct reiserfs_super_block *rs) {@@ -48,6 +49,12 @@ int is_reiserfs_3_6(struct reiserfs_supe strlen(reiserfs_3_6_magic_string)); } +int is_reiserfs_3_7 (struct reiserfs_super_block *rs) +{ +return !strncmp (rs->s_v1.s_magic, reiserfs_3_7_magic_string, +strlen (reiserfs_3_7_magic_string)); +} +int is_reiserfs_jr (struct reiserfs_super_block *rs) { return !strncmp(rs->s_v1.s_magic, reiserfs_jr_magic_string,@@ -57,7 +64,13 @@ int is_reiserfs_jr(struct reiserfs_superstatic int is_any_reiserfs_magic_string (struct reiserfs_super_block *rs) {return (is_reiserfs_3_5 (rs) ||is_reiserfs_3_6 (rs) || -is_reiserfs_jr (rs)); +is_reiserfs_3_7 (rs) ||is_reiserfs_jr (rs)); +} +
Quoted 10 lines
fs/reiserfs/super.c int is_reiserfs_jr(struct reiserfs_super
Quoted 8 lines
fs/reiserfs/super.c +4
-0+int has_nonstandard_journal (struct reiserfs_super_block *rs) +{ +return is_reiserfs_jr (rs) || + (is_reiserfs_3_7 (rs) && rs->s_v1.s_journal.jp_journal_dev); }
Actualy this is the same as is_reiserfs_jr(rs), just because (is_reiserfs_3_7(rs) && rs->s_v1.s_journal.jp_journal_dev) is always false, so let's better avoid this stuff..
Quoted 28 lines
Actually the function above is brain damaged.
Journal is non-standard _iff_ it is "relocated" or has length (excluding journal
header) different from 8192. So it can happen that a partition is "jr" (withREISER2FS_JR_SUPER_MAGIC_STRING), but has _standard_ journal.Quoted 18 lines
static int
reiserfs_remount(struct super_block *s, int *flags, char *data);fs/reiserfs/super.c +4
-0@@ -1397,6 +1410,10 @@ static int read_super_block(struct super "non-standard magic", sb_version(rs));return 1 ; } + }else if (is_reiserfs_3_7 (rs)) { +reiserfs_info (s,"found reiserfs format \"3.7\" " +"with %sstandard journal\n" , +sb_jp_journal_dev (rs) ?"non-" :"" ); }else /* s_version of standard format may contain incorrect information, so we just look at the magic string */ @@ -1404,6 +1421,7 @@ static int read_super_block(struct super"found reiserfs format \"%s\" with standard journal\n" , is_reiserfs_3_5(rs) ? "3.5" : "3.6");
Quoted 3 lines · Jeff Mahoney
This patch contains the basic implementation for reiserfs 3.7.
Specifically, it extends reiserfs 3.6 to allow feature compatibility
bits.
Quoted 1 line
Since it extends v3.6, it assumes allowing a nonstandard journal, so
some
Quoted 7 lines
paths have been adjusted to test for a nonstandard journal instead of just having the JR superblock magic.
I don't have any large plans to extend beyond some very basic features, although extended attributes would be much more efficiently implemented if they were first class items instead of hidden files.
Quoted 5 lines
The next patch in the series adds support to allow v2 stat data items to describe the number of blocks in fs-blocksize blocks instead of 512 byte blocks.
Signed-off-by Jeff Mahoney <[email protected]>
Thanks for the information. Is the module available for testing?. If so, where can I get the module from and can it be used it with the opensuse factory series?
Cheers Glenn
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 18 lines · On 12/08/2010 08:13 AM, [email protected] wrote:
Quoted 3 lines · Jeff Mahoney
This patch contains the basic implementation for reiserfs 3.7.
Specifically, it extends reiserfs 3.6 to allow feature compatibility
bits.
Quoted 1 line
Since it extends v3.6, it assumes allowing a nonstandard journal, so
some
Quoted 11 lines
paths have been adjusted to test for a nonstandard journal instead of just having the JR superblock magic.
I don't have any large plans to extend beyond some very basic features, although extended attributes would be much more efficiently implemented if they were first class items instead of hidden files.
The next patch in the series adds support to allow v2 stat data items to describe the number of blocks in fs-blocksize blocks instead of 512 byte blocks.
Quoted 5 lines
Quoted 1 line
Signed-off-by Jeff Mahoney <[email protected]>Thanks for the information. Is the module available for testing?. If so, where can I get the module from and can it be used it with the opensuse factory series?
No, outside of the posting on this list, I haven't published it yet.
- -Jeff
- --
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/
iEYEARECAAYFAk0A/G8ACgkQLPWxlyuTD7LqywCfYKIL5U5pgak3WehG+1k0WI9y GMoAn1/3805vsF8fB6V5YMoPBbn6P7Zz
=0FPw
-----END PGP SIGNATURE-----