Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933475AbaGOTjp (ORCPT ); Tue, 15 Jul 2014 15:39:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3378 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933003AbaGOTjn (ORCPT ); Tue, 15 Jul 2014 15:39:43 -0400 Date: Tue, 15 Jul 2014 15:39:18 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: "Alasdair G. Kergon" , Mike Snitzer , Jonathan Brassow , Edward Thornber , "Martin K. Petersen" , Jens Axboe , Christoph Hellwig cc: dm-devel@redhat.com, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [PATCH 7/15] dm: remove num_write_bios In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ this isn't connected to XCOPY, but it is requires for the following device mapper patches to apply cleanly ] The target can set the function num_write_bios - dm will issue this callback to ask the target how many bios does it want to receive. This was intended for the dm-cache target, but it is not useable due to a race condition (see the description of e2e74d617eadc15f601983270c4f4a6935c5a943). num_write_bios is unused, so we remove it. Note that we deliberately leave the for loop in __clone_and_map_data_bio - it will be used in the next patch. Signed-off-by: Mikulas Patocka --- drivers/md/dm.c | 6 ------ include/linux/device-mapper.h | 15 --------------- 2 files changed, 21 deletions(-) Index: linux-3.16-rc5/drivers/md/dm.c =================================================================== --- linux-3.16-rc5.orig/drivers/md/dm.c 2014-07-14 16:25:01.000000000 +0200 +++ linux-3.16-rc5/drivers/md/dm.c 2014-07-14 16:25:29.000000000 +0200 @@ -1315,12 +1315,6 @@ static void __clone_and_map_data_bio(str unsigned target_bio_nr; unsigned num_target_bios = 1; - /* - * Does the target want to receive duplicate copies of the bio? - */ - if (bio_data_dir(bio) == WRITE && ti->num_write_bios) - num_target_bios = ti->num_write_bios(ti, bio); - for (target_bio_nr = 0; target_bio_nr < num_target_bios; target_bio_nr++) { tio = alloc_tio(ci, ti, 0, target_bio_nr); tio->len_ptr = len; Index: linux-3.16-rc5/include/linux/device-mapper.h =================================================================== --- linux-3.16-rc5.orig/include/linux/device-mapper.h 2014-07-14 16:25:07.000000000 +0200 +++ linux-3.16-rc5/include/linux/device-mapper.h 2014-07-14 16:25:29.000000000 +0200 @@ -184,14 +184,6 @@ struct target_type { #define DM_TARGET_IMMUTABLE 0x00000004 #define dm_target_is_immutable(type) ((type)->features & DM_TARGET_IMMUTABLE) -/* - * Some targets need to be sent the same WRITE bio severals times so - * that they can send copies of it to different devices. This function - * examines any supplied bio and returns the number of copies of it the - * target requires. - */ -typedef unsigned (*dm_num_write_bios_fn) (struct dm_target *ti, struct bio *bio); - struct dm_target { struct dm_table *table; struct target_type *type; @@ -231,13 +223,6 @@ struct dm_target { */ unsigned per_bio_data_size; - /* - * If defined, this function is called to find out how many - * duplicate bios should be sent to the target when writing - * data. - */ - dm_num_write_bios_fn num_write_bios; - /* target specific data */ void *private; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/