Skip to content

Clean up ext4's block free code paths

Theodore Ts'o linux-ext4 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8ext4: move ext4_forget() to ext4_jbd2.cfs/ext4/ext4.h fs/ext4/ext4_jbd2.c fs/ext4/ext4_jbd2.h +1 more+63 -530 replies
2/8ext4: fold ext4_journal_revoke() into ext4_forget()fs/ext4/ext4_jbd2.c fs/ext4/ext4_jbd2.h+12 -270 replies
3/8ext4: fold ext4_journal_forget() into ext4_forget()fs/ext4/ext4_jbd2.c fs/ext4/ext4_jbd2.h fs/ext4/inode.c+19 -250 replies
4/8ext4: fold ext4_free_blocks() and ext4_mb_free_blocks()fs/ext4/balloc.c fs/ext4/ext4.h fs/ext4/mballoc.c+26 -490 replies
5/8ext4: call ext4_forget() from ext4_free_blocks()fs/ext4/ext4.h fs/ext4/extents.c fs/ext4/inode.c +4 more+109 -882 replies
6/8ext4: print i_mode in octal in ext4 tracepointsinclude/trace/events/ext4.h+4 -40 replies
7/8ext4: add check for wraparound in ext4_data_block_valid()fs/ext4/block_validity.c+1 -00 replies
8/8ext4: use ext4_data_block_valid() in ext4_free_blocks()fs/ext4/mballoc.c+1 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/8] Clean up ext4's block free code paths

This patch series cleans up functions involved with freeing blocks. It removes functions that are only called by a single caller and folds them into their caller, and makes the code a little easier to read. It also reduces ext4's code foot print slightly (by 136 bytes).

Finally, it fixes a bug in the extents migration function, which was missing calls to ext4_forget() when it frees the indirect blocks after converting an inode to using extents. This avoids potential file system corruption after a crash while converting an entire filesystem to use extents via "chattr -R +e /mntpt".

- Ted

Theodore Ts'o (8):
ext4: move ext4_forget() to ext4_jbd2.c
ext4: fold ext4_journal_revoke() into ext4_forget()
ext4: fold ext4_journal_forget() into ext4_forget()
ext4: fold ext4_free_blocks() and ext4_mb_free_blocks()
ext4: call ext4_forget() from ext4_free_blocks()
ext4: print i_mode in octal in ext4 tracepoints
ext4: add check for wraparound in ext4_data_block_valid()
ext4: use ext4_data_block_valid() in ext4_free_blocks()

 fs/ext4/balloc.c            |   38 --------------
 fs/ext4/block_validity.c    |    1 +
 fs/ext4/ext4.h              |   15 +++--
 fs/ext4/ext4_jbd2.c         |   82 ++++++++++++++++++++++---------
 fs/ext4/ext4_jbd2.h         |   23 +++------
 fs/ext4/extents.c           |   24 +++------
 fs/ext4/inode.c             |  116 +++++++++++--------------------------------
 fs/ext4/mballoc.c           |   61 ++++++++++++++++++-----
 fs/ext4/migrate.c           |   23 ++++++---
 fs/ext4/xattr.c             |    8 ++-
 include/trace/events/ext4.h |   24 +++++----
 11 files changed, 198 insertions(+), 217 deletions(-)