]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Remove minor gfs2_journaled_truncate inefficiencies
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 12 Dec 2017 15:47:20 +0000 (16:47 +0100)
committerBob Peterson <rpeterso@redhat.com>
Wed, 17 Jan 2018 13:35:47 +0000 (06:35 -0700)
commit3f61bb08d585c828e62d7114c213313d2f5622b8
treeccad68cc5cc6cb7c9406f9b46125f2455ec0b18b
parentc4958c8e173d220ce3ab23ce801add8c16f6b5c8
gfs2: Remove minor gfs2_journaled_truncate inefficiencies

First, this function truncates the file in chunks.  When the original
file size isn't block aligned, each chunk that is truncated will remain
be misaligned.  This is inefficient.

Second, this function doesn't recognize where holes are, so it loops
through them.  For each chunk of a hole, it creates a new transaction.
At least avoid creating another transactions whe the current one is
still empty.  (An better fix would be to skip large holes, of course.)

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/bmap.c