• Alex Tomas's avatar
    [PATCH] JBD: log space management optimization · 9338e33f
    Alex Tomas authored
    during truncate ext3 calls journal_forget() for freed blocks, but before
    these blocks go to the transaction and jbd reserves space in log for them
    (->t_outstanding_credits).  also, journal_forget() removes these blocks
    from the transaction, but doesn't correct log space reservation.  for
    example, removal of 500MB file reserves 136 blocks, but only 10 blocks go
    to the log.  a commit is expensive and correct reservation allows us to
    avoid needless commits.  here is the patch.  tested on UP.
    Signed-off-by: default avatarAlex Tomas <alex@clusterfs.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    9338e33f
transaction.c 60 KB