Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp535982yba; Fri, 12 Apr 2019 08:29:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPT+mfGXaS4Scc40mOivNt1YZBkSuOE2NYgyOnBvIpCL8Uwu1MYQ20CaicbHJafF7JeUTm X-Received: by 2002:a17:902:e110:: with SMTP id cc16mr58243836plb.147.1555082941539; Fri, 12 Apr 2019 08:29:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555082941; cv=none; d=google.com; s=arc-20160816; b=fvrDVCHKlwY7gpCtGZDE3Q0eDyR0ypJjSUCTz3N+ZHDLc8zzZ9K0JYTaRZFWjdvNcc jFfY/30C6pW/Ztbj4+rCG8TR7zvbO+Q/cv3gmY7o75xyio/AW4FfHiNkf2NWK+P4Wo8s o3PORrAw+peT7kAvaB69eaOvKw0dSfUZvlw31S0Jupi080fhoQgE33M8Ke9PSASd0zWs DXvvb1QGCM3wPpyujuocKwKBSgB2GF+tYONBME0zE9QOs5tuXh8ftfUwseBvnjzoqPKQ AOqkxonV3qABKXjVG0fjGQE6mfHCa9me6lZoDnOb8D0dslDkkDi+BXy99CL8qfzE07aK nJng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=6gU0uM+j9Dt48qJc8XnASOU0e1ZMtNifgf9fcI+R0/Y=; b=p9beZ6c2WohRWAzVV1pfxGrJtT0dnbsHtGteN923JibNFLYFMyjxZKLcGRqojHsgru XztZR/fAFvtOBSnoIK8M9zldMNro3a9aAl00pZcpIRO4jz7F7uT/iyUKbCGb1sWLTAfr RwfmrR8yy1hAyloJbwC+E8TXk2DtHcyM18/wtRbPRBwxD8L6JWtO8CJvVh9uRIURwlRf gUNdiTxaUBbnDvQCrJvC//82XPvjtlnoczjdvQ5MKNDagOFFKHKrD/fi4Dzu5COm10jg QKGWsnaOKF3y348ynsm+QDw1mOuadQFcMbaIWzTgvftGJEcEQcAXIo2fdkLYW65FTcWv erOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14si14333626pgk.227.2019.04.12.08.28.44; Fri, 12 Apr 2019 08:29:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726843AbfDLP1u (ORCPT + 99 others); Fri, 12 Apr 2019 11:27:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37500 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726702AbfDLP1u (ORCPT ); Fri, 12 Apr 2019 11:27:50 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D00353002729; Fri, 12 Apr 2019 15:27:49 +0000 (UTC) Received: from dhcp16-201-219.khw1.lab.eng.bos.redhat.com (dhcp16-201-219.khw1.lab.eng.bos.redhat.com [10.16.201.219]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA8801001E7A; Fri, 12 Apr 2019 15:27:44 +0000 (UTC) From: Huaisheng Ye To: mpatocka@redhat.com, snitzer@redhat.com, agk@redhat.com Cc: prarit@redhat.com, chengnt@lenovo.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org, Huaisheng Ye Subject: [PATCH] dm-writecache: simplify the using of pointer wb Date: Fri, 12 Apr 2019 11:27:18 -0400 Message-Id: <20190412152718.27102-1-huye@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 12 Apr 2019 15:27:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huaisheng Ye In function __writecache_writeback_pmem, the pointer bio has been already there, it doesn't need to seek bio's address from pointer wb. Signed-off-by: Huaisheng Ye --- drivers/md/dm-writecache.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index f782287..5b4d1c1 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -1478,9 +1478,9 @@ static void __writecache_writeback_pmem(struct dm_writecache *wc, struct writeba bio = bio_alloc_bioset(GFP_NOIO, max_pages, &wc->bio_set); wb = container_of(bio, struct writeback_struct, bio); wb->wc = wc; - wb->bio.bi_end_io = writecache_writeback_endio; - bio_set_dev(&wb->bio, wc->dev->bdev); - wb->bio.bi_iter.bi_sector = read_original_sector(wc, e); + bio->bi_end_io = writecache_writeback_endio; + bio_set_dev(bio, wc->dev->bdev); + bio->bi_iter.bi_sector = read_original_sector(wc, e); wb->page_offset = PAGE_SIZE; if (max_pages <= WB_LIST_INLINE || unlikely(!(wb->wc_list = kmalloc_array(max_pages, sizeof(struct wc_entry *), @@ -1507,12 +1507,12 @@ static void __writecache_writeback_pmem(struct dm_writecache *wc, struct writeba wb->wc_list[wb->wc_list_n++] = f; e = f; } - bio_set_op_attrs(&wb->bio, REQ_OP_WRITE, WC_MODE_FUA(wc) * REQ_FUA); + bio_set_op_attrs(bio, REQ_OP_WRITE, WC_MODE_FUA(wc) * REQ_FUA); if (writecache_has_error(wc)) { bio->bi_status = BLK_STS_IOERR; - bio_endio(&wb->bio); + bio_endio(bio); } else { - submit_bio(&wb->bio); + submit_bio(bio); } __writeback_throttle(wc, wbl); -- 1.8.3.1