linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valerie Aurora <vaurora@redhat.com>
To: Theodore Tso <tytso@mit.edu>
Cc: Julia Lawall <julia@diku.dk>,
	linux-ext4@vger.kernel.org, Eric Sandeen <sandeen@redhat.com>,
	Ric Wheeler <rwheeler@redhat.com>,
	Jesper Andersen <jespera@diku.dk>
Subject: Re: spatch for 64-bit e2fsprogs (was Re: Fix device too big bug in mainline?)
Date: Tue, 4 Aug 2009 14:18:51 -0400	[thread overview]
Message-ID: <20090804181850.GF9324@shell> (raw)
In-Reply-To: <20090804144846.GE28678@mit.edu>

[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]

On Tue, Aug 04, 2009 at 10:48:46AM -0400, Theodore Tso wrote:
> 
> If you want to start preparing for the semantic patches by preparing
> and testing the receipes, and then helping to flag those patches that
> contain some changes that contain some changes that can't be applied
> via spatch, that would be helpful.
> 
> Does that sound like a plan?

That sounds great.  We won't be able to automate everything, but after
this exercise, I bet spatch will be able to automate most of it.

Jesper, the patches you'll be interested in can be found in the
shared-64bit branch of:

git://git.kernel.org/pub/scm/fs/ext2/val/e2fsprogs.git

If getting these out of git is at any trouble at all, please ask and
I'll send them as plain patches.  The obvious candidates are things
like:

Author: Valerie Aurora Henson <vaurora@redhat.com>
Date:   Tue Feb 3 13:15:19 2009 -0800

    parse_num_blocks() -> parse_num_blocks2()

More difficult and interesting projects include:

Author: Valerie Aurora Henson <vaurora@redhat.com>
Date:   Tue Feb 3 13:15:19 2009 -0800

    New accessor functions for block group descriptor variables.

And the following three patches.  I attached a (huge) .cocci script
that I used to do part of that conversion.  I'm looking forward to
your professional version of it. :) This is a good patch for testing
newline fixup features.

-VAL

[-- Attachment #2: group_desc.cocci --]
[-- Type: text/plain, Size: 5190 bytes --]

// Checksum
@@
ext2_filsys fs;
expression group, flag;
@@

-fs->group_desc[group].bg_checksum
+ext2fs_bg_checksum(fs, group)


// Get/set block/inode counts
@@
ext2_filsys fs;
expression group;
identifier blk;
expression E;
@@
(
// Free blocks
-blk = fs->group_desc[group].bg_free_blocks_count
+blk = ext2fs_bg_free_blocks_count(fs, group)
|
-fs->group_desc[group].bg_free_blocks_count = E
+ext2fs_bg_free_blocks_count_set(fs, group, E)
|
// Free inodes
-blk = fs->group_desc[group].bg_free_inodes_count
+blk = ext2fs_bg_free_inodes_count(fs, group)
|
-fs->group_desc[group].bg_free_inodes_count = E
+ext2fs_bg_free_inodes_count_set(fs, group, E)
|
// Used dirs
-blk = fs->group_desc[group].bg_used_dirs_count
+blk = ext2fs_bg_used_dirs_count(fs, group)
|
-fs->group_desc[group].bg_used_dirs_count = E
+ext2fs_bg_used_dirs_count_set(fs, group, E)
|
// Unused inode table blocks
-blk = fs->group_desc[group].bg_itable_unused
+blk = ext2fs_bg_itable_unused(fs, group)
|
-fs->group_desc[group].bg_itable_unused = E
+ext2fs_bg_itable_unused_set(fs, group, E)
)

// Increment/decrement block/inode counts
// I tried to create an isomorphism for this, but I failed.
@@
ext2_filsys fs;
expression group, i;
@@
(
// Free blocks
-fs->group_desc[group].bg_free_blocks_count++
+ext2fs_bg_free_blocks_count_set(fs, group, ext2fs_bg_free_blocks_count(fs, group)+1)
|
-fs->group_desc[group].bg_free_blocks_count--
+ext2fs_bg_free_blocks_count_set(fs, group, ext2fs_bg_free_blocks_count(fs, group)-1)
|
-fs->group_desc[group].bg_free_blocks_count += i
+ext2fs_bg_free_blocks_count_set(fs, group, ext2fs_bg_free_blocks_count(fs, group)+i)
|
-fs->group_desc[group].bg_free_blocks_count -= i
+ext2fs_bg_free_blocks_count_set(fs, group, ext2fs_bg_free_blocks_count(fs, group)-i)
|
// Free inodes
-fs->group_desc[group].bg_free_inodes_count++
+ext2fs_bg_free_inodes_count_set(fs, group, ext2fs_bg_free_inodes_count(fs, group)+1)
|
-fs->group_desc[group].bg_free_inodes_count--
+ext2fs_bg_free_inodes_count_set(fs, group, ext2fs_bg_free_inodes_count(fs, group)-1)
|
-fs->group_desc[group].bg_free_inodes_count += i
+ext2fs_bg_free_inodes_count_set(fs, group, ext2fs_bg_free_inodes_count(fs, group)+i)
|
-fs->group_desc[group].bg_free_inodes_count -= i
+ext2fs_bg_free_inodes_count_set(fs, group, ext2fs_bg_free_inodes_count(fs, group)-i)
|
// Used dirs
-fs->group_desc[group].bg_used_dirs_count++
+ext2fs_bg_used_dirs_count_set(fs, group, ext2fs_bg_used_dirs_count(fs, group)+1)
|
-fs->group_desc[group].bg_used_dirs_count--
+ext2fs_bg_used_dirs_count_set(fs, group, ext2fs_bg_used_dirs_count(fs, group)-1)
|
-fs->group_desc[group].bg_used_dirs_count += i
+ext2fs_bg_used_dirs_count_set(fs, group, ext2fs_bg_used_dirs_count(fs, group)+i)
|
-fs->group_desc[group].bg_used_dirs_count -= i
+ext2fs_bg_used_dirs_count_set(fs, group, ext2fs_bg_used_dirs_count(fs, group)-i)
|
// Unused inode table blocks
-fs->group_desc[group].bg_itable_unused++
+ext2fs_bg_itable_unused_set(fs, group, ext2fs_bg_itable_unused(fs, group)+1)
|
-fs->group_desc[group].bg_itable_unused--
+ext2fs_bg_itable_unused_set(fs, group, ext2fs_bg_itable_unused(fs, group)-1)
|
-fs->group_desc[group].bg_itable_unused += i
+ext2fs_bg_itable_unused_set(fs, group, ext2fs_bg_itable_unused(fs, group)+i)
|
-fs->group_desc[group].bg_itable_unused -= i
+ext2fs_bg_itable_unused_set(fs, group, ext2fs_bg_itable_unused(fs, group)-i)
)

// Get a pointer to a whole dang descriptor
@@
ext2_filsys fs;
expression group;
@@
-&fs->group_desc[group]
+ext2fs_group_desc(fs, fs->group_desc, group)

// Block group flags
@@
ext2_filsys fs;
expression group, flag;
@@
(
-fs->group_desc[group].bg_flags & flag
+ext2fs_bg_flag_test(fs, group, flag)
|
-fs->group_desc[group].bg_flags &= ~flag
+ext2fs_bg_flag_clear(fs, group, flag)
|
-fs->group_desc[group].bg_flags |= flag
+ext2fs_bg_flag_set(fs, group, flag)
|
-fs->group_desc[group].bg_flags = 0
+ext2fs_bg_flags_clear(fs, group, 0)
)

// Block group bitmap/table locations
@@
ext2_filsys fs;
expression group, E;
@@
(
-fs->group_desc[group].bg_block_bitmap = E
+ext2fs_block_bitmap_loc_set(fs, group, E)
|
-fs->group_desc[group].bg_block_bitmap
+ext2fs_block_bitmap_loc(fs, group)
|
-fs->group_desc[group].bg_inode_bitmap = E
+ext2fs_inode_bitmap_loc_set(fs, group, E)
|
-fs->group_desc[group].bg_inode_bitmap
+ext2fs_inode_bitmap_loc(fs, group)
|
-fs->group_desc[group].bg_inode_table = E
+ext2fs_inode_table_loc_set(fs, group, E)
|
-fs->group_desc[group].bg_inode_table
+ext2fs_inode_table_loc(fs, group)
|
-fs->group_desc[group].bg_free_blocks = E
+ext2fs_bg_free_blocks_count_set(fs, group, E)
|
-fs->group_desc[group].bg_free_blocks_count
+ext2fs_bg_free_blocks_count(fs, group)
|
-fs->group_desc[group].bg_free_inodes_count = E
+ext2fs_bg_free_inodes_count_set(fs, group, E)
|
-fs->group_desc[group].bg_free_inodes_count
+ext2fs_bg_free_inodes_count(fs, group)
|
-fs->group_desc[group].bg_used_dirs_count = E
+ext2fs_bg_used_dirs_count_set(fs, group, E)
|
-fs->group_desc[group].bg_used_dirs_count
+ext2fs_bg_used_dirs_count(fs, group)
|
-fs->group_desc[group].bg_itable_unused = E
+ext2fs_bg_itable_unused_set(fs, group, E)
|
-fs->group_desc[group].bg_itable_unused
+ext2fs_bg_itable_unused(fs, group)
)

  reply	other threads:[~2009-08-04 18:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-30 21:53 Fix device too big bug in mainline? Valerie Aurora
2009-08-02  0:28 ` Theodore Tso
2009-08-02  2:22   ` Theodore Tso
2009-08-02  3:49     ` Theodore Tso
2009-08-03 20:11     ` Valerie Aurora
2009-08-03 20:27     ` spatch for 64-bit e2fsprogs (was Re: Fix device too big bug in mainline?) Valerie Aurora
2009-08-03 22:56       ` Valerie Aurora
2009-08-04  6:40       ` Julia Lawall
2009-08-04 14:48       ` Theodore Tso
2009-08-04 18:18         ` Valerie Aurora [this message]
2009-08-04 19:24           ` Andreas Dilger
2009-08-04 19:58             ` Valerie Aurora
2009-08-04 20:32           ` Theodore Tso
2009-08-04 18:28     ` Fix device too big bug in mainline? Valerie Aurora
2009-08-04 20:41       ` Theodore Tso
2009-08-04 21:29         ` Valerie Aurora
2009-08-04 22:12           ` Theodore Tso
2009-08-04 23:56       ` Theodore Tso
2009-08-03 18:04   ` Valerie Aurora

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=20090804181850.GF9324@shell \
    --to=vaurora@redhat.com \
    --cc=jespera@diku.dk \
    --cc=julia@diku.dk \
    --cc=linux-ext4@vger.kernel.org \
    --cc=rwheeler@redhat.com \
    --cc=sandeen@redhat.com \
    --cc=tytso@mit.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).