From patchwork Mon Oct 15 20:09:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 1596041 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by patchwork2.kernel.org (Postfix) with ESMTP id 97592DFB34 for ; Mon, 15 Oct 2012 20:14:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q9FKBRJH006969; Mon, 15 Oct 2012 16:11:27 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q9FKAuEM027302 for ; Mon, 15 Oct 2012 16:10:56 -0400 Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.19]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9FKAp9I026772 for ; Mon, 15 Oct 2012 16:10:51 -0400 Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9FK9qef013584 for ; Mon, 15 Oct 2012 16:10:51 -0400 Received: by mail-pa0-f46.google.com with SMTP id hz1so5214261pad.33 for ; Mon, 15 Oct 2012 13:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=nliFf3QZMlwd1rQKV13cFrbL+orZKlr5klmFTWJkr1o=; b=LhR6k79yLuLCebpgmrXdgMiIIEcv8wxUUexyI8ogOXBkDO+0x7jkvf3rQ79sNfCWPU X3IAsClF9l1vtrlC5jxsKcaYGPv4B8c5URJfqmmDKz0DdXcWmlVte1yld5sQmPhcl1kr q7BrbBcMZDBxXozrq9wiFfE+bHBX21XMo7hbjFBdAmy4tVNdGBkd5V2gJfVWA8WBUT/1 xIPZQzl2JQJcEpqdvlIJgJwVdafVXDNf6neN4QFUuUz0tSgW2QISa8Clqg1/uQmFT4g1 +MhhBCcK2WifnFHw+80OuGfWVnBL1Vc8xLJNOoPW4TeGtFxziz9Vi2Xk30GSJZ8qRB89 86vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=nliFf3QZMlwd1rQKV13cFrbL+orZKlr5klmFTWJkr1o=; b=AY8kz4qcvoZGZu8KMCOYGNPS7MDApT82dW/Fw0fwp/DyW+uc25ZDgZQywVN3jets+f ZFuQgjrC1Bw6AQcw08W7s3hF/STZKQDZPkf2s2X2gjLIBVWSIYVB+kn78DcCMa5CUHYx gZc8INUGIcDjoEMuhvWU+Xj0nODv3baYD4eG9Mknr/ma7Dkd9mG4gAj5sz6azBMc+1Mz j0B0b6DsL9wy+H7Id+6cs6qYbwSbi0+r0kqh+o+716vuP9KLHKuwGjNBdgDqD54K795r cr2Nselj4CLZclX96poM6WqxGxLstMS9bM0DUiKXqxfiZWYOQ2ac2k/sW8cPZI8O15Xd zAMw== Received: by 10.68.189.233 with SMTP id gl9mr73728pbc.166.1350331850808; Mon, 15 Oct 2012 13:10:50 -0700 (PDT) Received: from formenos.mtv.corp.google.com (formenos.mtv.corp.google.com [172.18.110.66]) by mx.google.com with ESMTPS id k9sm3021703paz.22.2012.10.15.13.10.49 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Oct 2012 13:10:50 -0700 (PDT) From: Kent Overstreet To: linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com Date: Mon, 15 Oct 2012 13:09:20 -0700 Message-Id: <1350331769-14856-47-git-send-email-koverstreet@google.com> In-Reply-To: <1350331769-14856-1-git-send-email-koverstreet@google.com> References: <1350331769-14856-1-git-send-email-koverstreet@google.com> X-Gm-Message-State: ALoCoQlKs5d9lQNPR/bL45UGTt+fuF+XB3zCnhRTzhmwa4sffc7j8c7OrJOu0CcEG7SFb0Lqz+lFmHQtXVh3JySyUirjZNF+XuLsQC1mY3BCsLOEdUzeUsrFZCZgLqSUmdDfvPoAB2MqLUMXCjAY8MTm1TK5pYqjj71u8X079veGazbFTF+5J8gclObZ3udsBORBvTgIJIb4 X-RedHat-Spam-Score: -3.072 (BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.19 X-loop: dm-devel@redhat.com Cc: tj@kernel.org, axboe@kernel.dk, Kent Overstreet , Jiri Kosina Subject: [dm-devel] [PATCH v2 17/26] pktcdvd: Use bio_reset() in disabled code to kill bi_idx usage X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com In the short term this'll help with code auditing, and if this code ever gets used now it's converted :) Signed-off-by: Kent Overstreet CC: Jiri Kosina --- drivers/block/pktcdvd.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 1079a77..5318ad39 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -1156,16 +1156,15 @@ static int pkt_start_recovery(struct packet_data *pkt) new_sector = new_block * (CD_FRAMESIZE >> 9); pkt->sector = new_sector; + bio_reset(pkt->bio); + pkt->bio->bi_bdev = pd->bdev; + pkt->bio->bi_rw = REQ_WRITE; pkt->bio->bi_sector = new_sector; - pkt->bio->bi_next = NULL; - pkt->bio->bi_flags = 1 << BIO_UPTODATE; - pkt->bio->bi_idx = 0; - - BUG_ON(pkt->bio->bi_rw != REQ_WRITE); - BUG_ON(pkt->bio->bi_vcnt != pkt->frames); - BUG_ON(pkt->bio->bi_size != pkt->frames * CD_FRAMESIZE); - BUG_ON(pkt->bio->bi_end_io != pkt_end_io_packet_write); - BUG_ON(pkt->bio->bi_private != pkt); + pkt->bio->bi_size = pkt->frames * CD_FRAMESIZE; + pkt->bio->bi_vcnt = pkt->frames; + + pkt->bio->bi_end_io = pkt_end_io_packet_write; + pkt->bio->bi_private = pkt; drop_super(sb); return 1;