[Devel] [PATCH RHEL7 COMMIT] ploop: introduce dio_may_fallocate() helper

Konstantin Khorenko khorenko at virtuozzo.com
Wed Mar 6 14:22:42 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.1.3.vz7.93.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.1.3.vz7.83.17
------>
commit 45da613028de610f8b80c509cd5d330e7b63af8b
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Wed Mar 6 14:22:40 2019 +0300

    ploop: introduce dio_may_fallocate() helper
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    =====================
    Patchset description:
    
    ploop: Add online discard support for dio engine
    
    The first part of patchset is preparations to make code
    a bit readable.
    
    The second part adds online discard support for dio engine.
    DIO engine tracks entents, so discard code will use that
    for its needs.
    
    https://pmc.acronis.com/browse/VSTOR-19972
    
    Kirill Tkhai (12):
          ploop: introduce dio_may_fallocate() helper
          ploop: Export whole_block()
          ploop: Add cluster_size_in_bytes() helper
          ploop: Add cluster_size_in_sec() helper
          ploop: Add local variable into dio_submit()
          ploop: Add cluster_log local variable
          ploop: Add trim_extent_mappings_tail() helper
          ploop: Introduce local variable in ploop_start()
          ploop: Never merge discard requests
          ploop: Set up discard limits
          ploop: Introduce ploop_can_issue_discard() helper
          ploop: Online discard support for dio engine
---
 drivers/block/ploop/io_direct.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/block/ploop/io_direct.c b/drivers/block/ploop/io_direct.c
index dab0b1393cb8..f257a2770bcc 100644
--- a/drivers/block/ploop/io_direct.c
+++ b/drivers/block/ploop/io_direct.c
@@ -46,6 +46,12 @@ atomic_long_t ploop_io_images_size = ATOMIC_LONG_INIT(0);
  * Holes in image file are not allowed.
  */
 
+static bool dio_may_fallocate(struct ploop_io *io)
+{
+	return io->files.file->f_op->fallocate &&
+	       io->files.flags & EXT4_EXTENTS_FL;
+}
+
 static inline sector_t
 dio_isec_to_phys(struct extent_map * em, sector_t isec)
 {
@@ -354,8 +360,7 @@ cached_submit(struct ploop_io *io, iblock_t iblk, struct ploop_request * preq,
 	struct bio_iter biter;
 	loff_t new_size;
 	loff_t used_pos;
-	bool may_fallocate = io->files.file->f_op->fallocate &&
-		io->files.flags & EXT4_EXTENTS_FL;
+	bool may_fallocate = dio_may_fallocate(io);
 
 	trace_cached_submit(preq);
 



More information about the Devel mailing list