[Devel] [PATCH RHEL7 COMMIT] ploop: Kaio simplify truncate() in kaio_fsync_thread()

Vasily Averin vvs at virtuozzo.com
Sun Sep 20 12:02:17 MSK 2020


The commit is pushed to "branch-rh7-3.10.0-1127.18.2.vz7.163.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1127.18.2.vz7.163.26
------>
commit 9e84fa4fe25567d05a4b3b132ac0ec21e510c957
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Sun Sep 20 12:02:17 2020 +0300

    ploop: Kaio simplify truncate() in kaio_fsync_thread()
    
    Doing both >> and << is useless since length is aligned
    to cluster size.
    
    https://jira.sw.ru/browse/PSBM-108008
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/block/ploop/io_kaio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/ploop/io_kaio.c b/drivers/block/ploop/io_kaio.c
index f85dac1..00316e7 100644
--- a/drivers/block/ploop/io_kaio.c
+++ b/drivers/block/ploop/io_kaio.c
@@ -528,8 +528,8 @@ static int kaio_fsync_thread(void * data)
 			isize = i_size_read(io->files.inode);
 			if (WARN_ON_ONCE(preq->prealloc_size < isize))
 				goto out;
-			err = kaio_truncate(io, io->files.file,
-					    preq->prealloc_size >> (plo->cluster_log + 9));
+			err = __kaio_truncate(io, io->files.file,
+					      preq->prealloc_size);
 			if (err)
 				PLOOP_REQ_SET_ERROR(preq, -EIO);
 		} else {


More information about the Devel mailing list