[Devel] [PATCH RHEL7 COMMIT] ploop: Remove unused argument of __map_extent()

Konstantin Khorenko khorenko at virtuozzo.com
Tue Feb 26 13:18:28 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.1.3.vz7.83.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.1.3.vz7.83.14
------>
commit 3d6d4f2debf4ddffe646df65a0e185fde623b7aa
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Tue Feb 26 13:18:26 2019 +0300

    ploop: Remove unused argument of __map_extent()
    
    @create is always 0, so let's kill it.
    Also, __map_extent() never returns NULL, so kill !em check too.
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/block/ploop/io_direct_map.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/block/ploop/io_direct_map.c b/drivers/block/ploop/io_direct_map.c
index 3a1c32a183fb..f7784aa32cfa 100644
--- a/drivers/block/ploop/io_direct_map.c
+++ b/drivers/block/ploop/io_direct_map.c
@@ -671,31 +671,27 @@ static struct extent_map *__map_extent_bmap(struct ploop_io *io,
 
 static struct extent_map *__map_extent(struct ploop_io *io,
 				       struct address_space *mapping,
-				       sector_t start, sector_t len, int create,
+				       sector_t start, sector_t len,
 				       gfp_t gfp_mask)
 {
-	if (create)
-		/* create flag not supported by bmap implementation */
-		return ERR_PTR(-EINVAL);
-
 	return __map_extent_bmap(io, mapping, start,len, gfp_mask);
 }
 
 static struct extent_map *map_extent_get_block(struct ploop_io *io,
 					       struct address_space *mapping,
 					       sector_t start, sector_t len,
-					       int create, gfp_t gfp_mask)
+					       gfp_t gfp_mask)
 {
 	struct extent_map *em;
 	sector_t last;
 	sector_t map_ahead_len = 0;
 
-	em = __map_extent(io, mapping, start, len, create, gfp_mask);
+	em = __map_extent(io, mapping, start, len, gfp_mask);
 
 	/*
 	 * if we're doing a write or we found a large extent, return it
 	 */
-	if (IS_ERR(em) || !em || create || start + len < em->end) {
+	if (IS_ERR(em) || start + len < em->end) {
 		return em;
 	}
 
@@ -711,7 +707,7 @@ static struct extent_map *map_extent_get_block(struct ploop_io *io,
 
 		last = em->end;
 		ploop_extent_put(em);
-		em = __map_extent(io, mapping, last, len, create, gfp_mask);
+		em = __map_extent(io, mapping, last, len, gfp_mask);
 		if (IS_ERR(em) || !em)
 			break;
 		map_ahead_len += em->end - last;
@@ -723,7 +719,7 @@ static struct extent_map *map_extent_get_block(struct ploop_io *io,
 	    start + len > em->end) {
 		if (em && !IS_ERR(em))
 			ploop_extent_put(em);
-		em = __map_extent(io, mapping, start, len, create, gfp_mask);
+		em = __map_extent(io, mapping, start, len, gfp_mask);
 	}
 	return em;
 }
@@ -735,7 +731,7 @@ struct extent_map *extent_lookup_create(struct ploop_io *io,
 	struct extent_map_tree *tree = io->files.em_tree;
 
 	return map_extent_get_block(io, tree->mapping,
-				    start, len, 0, mapping_gfp_mask(tree->mapping));
+				    start, len, mapping_gfp_mask(tree->mapping));
 }
 
 static int drop_extent_map(struct extent_map_tree *tree)



More information about the Devel mailing list