From: Edward Shishkin <edward.shishkin@gmail.com>
To: Jeff Mahoney <jeffm@suse.com>
Cc: ReiserFS Mailing List <reiserfs-devel@vger.kernel.org>
Subject: Re: [PATCH] reiserfs: implement basic reiserfs 3.7
Date: Sat, 27 Nov 2010 04:34:59 +0100 [thread overview]
Message-ID: <4CF07C63.40408@gmail.com> (raw)
In-Reply-To: <4CE7F21B.4050605@suse.com>
Jeff Mahoney wrote:
> 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 <jeffm@suse.com>
> ---
> 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(-)
>
> --- a/fs/reiserfs/journal.c
> +++ b/fs/reiserfs/journal.c
> @@ -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)
> && (le32_to_cpu(jh->jh_journal.jp_journal_magic) !=
> sb_jp_journal_magic(rs))) {
> reiserfs_warning(sb, "sh-460",
> --- a/fs/reiserfs/prints.c
> +++ b/fs/reiserfs/prints.c
> @@ -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) +
>
ditto
> 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) :
>
ditto
> 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));
> --- a/fs/reiserfs/procfs.c
> +++ b/fs/reiserfs/procfs.c
> @@ -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";
> --- a/fs/reiserfs/super.c
> +++ b/fs/reiserfs/super.c
> @@ -35,6 +35,7 @@ struct file_system_type reiserfs_fs_type
> static 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_super
> static 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));
> +}
> +
> +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.
> static int reiserfs_remount(struct super_block *s, int *flags, char *data);
> @@ -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");
>
>
next prev parent reply other threads:[~2010-11-27 3:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-20 16:06 [PATCH] reiserfs: implement basic reiserfs 3.7 Jeff Mahoney
2010-11-27 3:34 ` Edward Shishkin [this message]
2010-11-29 20:10 ` Jeff Mahoney
2010-11-30 0:31 ` Edward Shishkin
2010-11-30 2:11 ` Edward Shishkin
2010-12-08 13:13 ` doiggl
2010-12-09 15:57 ` Jeff Mahoney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CF07C63.40408@gmail.com \
--to=edward.shishkin@gmail.com \
--cc=jeffm@suse.com \
--cc=reiserfs-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.