Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3026053rwb; Mon, 15 Aug 2022 16:24:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR5FyNmaUROH274HAoSadyNRJ8bUqpypznfJZYe0dxVQbBeaGzVP7C7Y0Hf58lPF4dEp/t3u X-Received: by 2002:a05:6a00:1588:b0:52f:a5bb:b992 with SMTP id u8-20020a056a00158800b0052fa5bbb992mr18032109pfk.38.1660605846178; Mon, 15 Aug 2022 16:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605846; cv=none; d=google.com; s=arc-20160816; b=al9hflE4QcwG0gtaSl91WOu6z+Q4oa0ZiUzs7XQZH+l9cX06Q/Joyd+GP5h1lv4Pon pdYYnHpT2ioIeOmai3tINa7nTfC+zouCNtU+TAFoj8pzl571y6N3omYmr39Q3gORPmWt wD9N9uokaXsNa32aTc8xGyQsf2UvaNtavjvvz2tBvIyW2XT/fDsvanlk4VtqS5lDZiSU k4rGYZnXJADX4EAYA2b+/7rOp9oLM/By3lm2YV5Es2PwnqkJ61zZUiIGQKcmGd3HHDa3 dXOU16XAI6d3HyRikix6eDqLMo0k+Baz4VGJw8yCQFutiQP3DIufwqfZvWvceoMG2o3T 6S9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zwoDDkhkmF6RPA+QuFUtcZXVjRiLj8UGiScCbZn407A=; b=WM1D0v/jAOKzG34ZuGi5vg2unce70dz1bbC03ACzQ5BoH+0N9HSf1XOfcKbvK7QqjH n0ICAubXwJgBuY8PIQ+CpR5RppgRcmT+h8FsyHQKLNXjSxFqOxSATMYR3+KVa7DZvtDH w9h94gZPZMvUWblmFLlasKSJYMRdBRwFVJiyKOwLE3A1/wAoDiN4jMxoqnAIxEZ3N52p QM4vJZGJ2gLMr4SAfwNp+q9EfYJ7fKtJCJ6nwzkPvMM4aPGigRchC2hjRpJaaeEpEm+W aR5qDvS+hV+HikmmV+3jpmb16EFKUw3pnKmP4FJPhScFtCQioQJkLWQMVZudwkyQ2YPV pLLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QslqtIYR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w11-20020a170902d3cb00b0017275762141si2078204plb.355.2022.08.15.16.23.54; Mon, 15 Aug 2022 16:24:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QslqtIYR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242750AbiHOUpW (ORCPT + 99 others); Mon, 15 Aug 2022 16:45:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347686AbiHOUnD (ORCPT ); Mon, 15 Aug 2022 16:43:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A7CCB56C5; Mon, 15 Aug 2022 12:08:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B5A98B81062; Mon, 15 Aug 2022 19:08:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE8FBC433C1; Mon, 15 Aug 2022 19:08:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590485; bh=RJpMtkSYG/vXtAkOfRgXlbOp7ynizIaZM8ijsH0shiQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QslqtIYRUkBewZbgB+JBPr1ED1tJPygrOmVuDK13eG0BjbJ/kYBYt0vqumMWzal6i AJCylFKoxSZ2u1skNaLy6Trvcn2dZzDcFGqEzGS/vkWq/VxZf9vc6apnO0pkEpmKCo rNn9OYdnznEOoPBH5NSY4TXjRv0z/aZQmHGgW6s0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mikulas Patocka , Mike Snitzer , Sasha Levin Subject: [PATCH 5.18 0275/1095] dm writecache: return void from functions Date: Mon, 15 Aug 2022 19:54:34 +0200 Message-Id: <20220815180441.138418446@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mikulas Patocka [ Upstream commit 9bc0c92e4b82adb017026dbb2aa816b1ac2bef31 ] The functions writecache_map_remap_origin and writecache_bio_copy_ssd only return a single value, thus they can be made to return void. This helps simplify the following IO accounting changes. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- drivers/md/dm-writecache.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 5630b470ba42..688b6b3bcd7b 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -1328,8 +1328,8 @@ enum wc_map_op { WC_MAP_ERROR, }; -static enum wc_map_op writecache_map_remap_origin(struct dm_writecache *wc, struct bio *bio, - struct wc_entry *e) +static void writecache_map_remap_origin(struct dm_writecache *wc, struct bio *bio, + struct wc_entry *e) { if (e) { sector_t next_boundary = @@ -1337,8 +1337,6 @@ static enum wc_map_op writecache_map_remap_origin(struct dm_writecache *wc, stru if (next_boundary < bio->bi_iter.bi_size >> SECTOR_SHIFT) dm_accept_partial_bio(bio, next_boundary); } - - return WC_MAP_REMAP_ORIGIN; } static enum wc_map_op writecache_map_read(struct dm_writecache *wc, struct bio *bio) @@ -1365,14 +1363,15 @@ static enum wc_map_op writecache_map_read(struct dm_writecache *wc, struct bio * map_op = WC_MAP_REMAP; } } else { - map_op = writecache_map_remap_origin(wc, bio, e); + writecache_map_remap_origin(wc, bio, e); + map_op = WC_MAP_REMAP_ORIGIN; } return map_op; } -static enum wc_map_op writecache_bio_copy_ssd(struct dm_writecache *wc, struct bio *bio, - struct wc_entry *e, bool search_used) +static void writecache_bio_copy_ssd(struct dm_writecache *wc, struct bio *bio, + struct wc_entry *e, bool search_used) { unsigned bio_size = wc->block_size; sector_t start_cache_sec = cache_sector(wc, e); @@ -1418,8 +1417,6 @@ static enum wc_map_op writecache_bio_copy_ssd(struct dm_writecache *wc, struct b } else { writecache_schedule_autocommit(wc); } - - return WC_MAP_REMAP; } static enum wc_map_op writecache_map_write(struct dm_writecache *wc, struct bio *bio) @@ -1457,7 +1454,8 @@ static enum wc_map_op writecache_map_write(struct dm_writecache *wc, struct bio direct_write: wc->stats.writes_around++; e = writecache_find_entry(wc, bio->bi_iter.bi_sector, WFE_RETURN_FOLLOWING); - return writecache_map_remap_origin(wc, bio, e); + writecache_map_remap_origin(wc, bio, e); + return WC_MAP_REMAP_ORIGIN; } wc->stats.writes_blocked_on_freelist++; writecache_wait_on_freelist(wc); @@ -1468,10 +1466,12 @@ static enum wc_map_op writecache_map_write(struct dm_writecache *wc, struct bio wc->uncommitted_blocks++; wc->stats.writes_allocate++; bio_copy: - if (WC_MODE_PMEM(wc)) + if (WC_MODE_PMEM(wc)) { bio_copy_block(wc, bio, memory_data(wc, e)); - else - return writecache_bio_copy_ssd(wc, bio, e, search_used); + } else { + writecache_bio_copy_ssd(wc, bio, e, search_used); + return WC_MAP_REMAP; + } } while (bio->bi_iter.bi_size); if (unlikely(bio->bi_opf & REQ_FUA || wc->uncommitted_blocks >= wc->autocommit_blocks)) -- 2.35.1