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

Submitted by Vasily Averin on Sept. 20, 2020, 9:02 a.m.

Details

Message ID 202009200902.08K92HTV015694@vz7build.vvs.sw.ru
State New
Series "Series without cover letter"
Headers show

Commit Message

Vasily Averin Sept. 20, 2020, 9:02 a.m.
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@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@virtuozzo.com>
---
 drivers/block/ploop/io_kaio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

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 {