From patchwork Thu Oct 3 01:15:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13820604 X-Patchwork-Delegate: mpatocka@redhat.com Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F58E4437C; Thu, 3 Oct 2024 01:16:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918182; cv=none; b=KuNZD8RufjKc8haoZ5nj64sWJDpSc0JIKxpK15ecXrI1Wf1gfLSxdReRRU3F14EoW7WpvobfdNPc4HZSQkxacGyqdVGoELQ95p2OsPQTB3aCc/ISNVV4GAsGexRtH+qM1Ecstc060mV8/qzcIX3KIS7gS/3zs2iYokzxZisSMus= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918182; c=relaxed/simple; bh=O4wWmZOmnQDTIfnLRfHJgK8ZZRDyEqiBvAdnnVSOIGU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bCmbbjb38cEMtRB9p5F0mIBcS/bJ8SKDwhNBaj7QkKEXjO6vvSBuLRYZwAy69IaubhZDvhtg1/LiqtZ9QD/PAtBZPNlUSKHVgso0aKnfYJOgLTsw6vAjZ8pTsXiAOSFZ1bDgomdA2HF95FdGwzt/C3kLCMQL+waTks1QLacaI+g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=Pi1PpPM1; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="Pi1PpPM1" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=3EfSajfBqzhPSYPG8IWTbiTKuq4G6Jjw1zAYEzHhRaA=; b=Pi1PpPM13tT6rRms +7ZGRvhuo4Hj5xfN2K4pqiNs5eMfleMJQ0jnqppUGnX6ZpaSwr+2KreOnsDLsPVpSB2AwGxc1WO9t G5X8VGY2pTxCGJs6flRcySbO6wLGbjb8qEe/RVPP/HpEiSDnOibemZRUz8WkJaXTYog4MZ5wZ7afQ HCO7o0kjv1KkJzIBR/NBUqquCfT4S3xL6chOQRLwr32hxZKaqKDs5zWZd11fgcf2m2rpC7nZ9ShFG mz4bRUFsSmbjzn64MxRzH8QQV89LKMoP2WsJIxNvsdTNdjGcpj/c8aFTB6hwLBovMfMTB3iBUxt6G sCK6WUaLtuVY/x3J8A==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1swARs-008Zju-2W; Thu, 03 Oct 2024 01:16:08 +0000 From: linux@treblig.org To: agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com, msakai@redhat.com Cc: dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 1/9] dm cache: Remove unused btracker_nr_writebacks_queued Date: Thu, 3 Oct 2024 02:15:46 +0100 Message-ID: <20241003011554.266654-2-linux@treblig.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241003011554.266654-1-linux@treblig.org> References: <20241003011554.266654-1-linux@treblig.org> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" btracker_nr_writebacks_queued() has been unused since commit 2e63309507c8 ("dm cache policy smq: don't do any writebacks unless IDLE") Remove it. Signed-off-by: Dr. David Alan Gilbert --- drivers/md/dm-cache-background-tracker.c | 6 ------ drivers/md/dm-cache-background-tracker.h | 1 - 2 files changed, 7 deletions(-) diff --git a/drivers/md/dm-cache-background-tracker.c b/drivers/md/dm-cache-background-tracker.c index 9c5308298cf1..504299bb7310 100644 --- a/drivers/md/dm-cache-background-tracker.c +++ b/drivers/md/dm-cache-background-tracker.c @@ -156,12 +156,6 @@ static void update_stats(struct background_tracker *b, struct policy_work *w, in } } -unsigned int btracker_nr_writebacks_queued(struct background_tracker *b) -{ - return atomic_read(&b->pending_writebacks); -} -EXPORT_SYMBOL_GPL(btracker_nr_writebacks_queued); - unsigned int btracker_nr_demotions_queued(struct background_tracker *b) { return atomic_read(&b->pending_demotes); diff --git a/drivers/md/dm-cache-background-tracker.h b/drivers/md/dm-cache-background-tracker.h index 5b8f5c667b81..7e66ad58efa6 100644 --- a/drivers/md/dm-cache-background-tracker.h +++ b/drivers/md/dm-cache-background-tracker.h @@ -42,7 +42,6 @@ struct background_tracker *btracker_create(unsigned int max_work); */ void btracker_destroy(struct background_tracker *b); -unsigned int btracker_nr_writebacks_queued(struct background_tracker *b); unsigned int btracker_nr_demotions_queued(struct background_tracker *b); /* From patchwork Thu Oct 3 01:15:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13820598 X-Patchwork-Delegate: mpatocka@redhat.com Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01CCE17BB6; Thu, 3 Oct 2024 01:16:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918177; cv=none; b=A6b4R0nzKvzy2rszN6pUsOIz9sUF6YS9hx1mFVjN8BYnZ4S876lc5B+UzfOn4u6RRPkJ0X5cVHN0a4qt5BsOgPI3iPywo8y8qBEg1VeOyfrO31Pl+Zhsrg4zwtHK9oYKwX+CX4+fuHDZtt94yls1i9YtY6zvCCbHM7msXOGH0iY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918177; c=relaxed/simple; bh=EpYZoNR/IU1qKBDFNxBkkRtrmlKPw9YQyQdWkhpZN4I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iukUz9Y+jlDBTuO6HTpdW+MFuBCbNj0VJFmBd7zsxMWMujP+3GSGiAptL8f7VOVq0Cse8JyU2zciZ9rxDWI32ZErnjpnJ5QpH35S39iMsRIuWmOY1uNTAb6kTBShtHiMxoLVbi0/AVfLLa3kt4fIxIrUnGF3jnkMz4KJcn+ASGI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=BcprqNvu; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="BcprqNvu" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=H3JQLHPWDS2GmOiIkpOwMQLDiiaYcGQvArj/9yvjlMA=; b=BcprqNvuIVseM5cj wfBzZ8KH/EcF9O3SBSTlEFe6vKGe4bdyJZCfmSLSjHTwMyzw2opdx4U1y+5fxba/4Frc9PM1yRgSK wr3PiC7yWwHMPI/CipX97GvvuEpVSWOXp4joOlmchHHjJkEJ7hNDRVCMQWfsS3E+EseoUTPu/GM/s Scahh/l2zeFZ0YEVidT7eG5TLuNqiXeLOUdTfInnTb966WQLpnY2IuXGvfQW/0vDl/KAKkL3cwdL0 jDh1R6WF315W1DD9nGxV7Eh5Ullzy+JAlBMc74GoOhzFQOxbQUnHmwLkaq6PtlX6omz6P0lZFsPcE NmZuUIi59W3nSppkTA==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1swARt-008Zju-1M; Thu, 03 Oct 2024 01:16:09 +0000 From: linux@treblig.org To: agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com, msakai@redhat.com Cc: dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 2/9] dm cache: Remove unused dm_cache_dump Date: Thu, 3 Oct 2024 02:15:47 +0100 Message-ID: <20241003011554.266654-3-linux@treblig.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241003011554.266654-1-linux@treblig.org> References: <20241003011554.266654-1-linux@treblig.org> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" dm_cache_dump() has been unused since the original commit c6b4fcbad044 ("dm: add cache target") Remove it. Signed-off-by: Dr. David Alan Gilbert --- drivers/md/dm-cache-metadata.c | 24 ------------------------ drivers/md/dm-cache-metadata.h | 2 -- 2 files changed, 26 deletions(-) diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c index 24cd87fddf75..5c757603ab36 100644 --- a/drivers/md/dm-cache-metadata.c +++ b/drivers/md/dm-cache-metadata.c @@ -1507,30 +1507,6 @@ int dm_cache_load_mappings(struct dm_cache_metadata *cmd, return r; } -static int __dump_mapping(void *context, uint64_t cblock, void *leaf) -{ - __le64 value; - dm_oblock_t oblock; - unsigned int flags; - - memcpy(&value, leaf, sizeof(value)); - unpack_value(value, &oblock, &flags); - - return 0; -} - -static int __dump_mappings(struct dm_cache_metadata *cmd) -{ - return dm_array_walk(&cmd->info, cmd->root, __dump_mapping, NULL); -} - -void dm_cache_dump(struct dm_cache_metadata *cmd) -{ - READ_LOCK_VOID(cmd); - __dump_mappings(cmd); - READ_UNLOCK(cmd); -} - int dm_cache_changed_this_transaction(struct dm_cache_metadata *cmd) { int r; diff --git a/drivers/md/dm-cache-metadata.h b/drivers/md/dm-cache-metadata.h index 57afc7047947..3e5472173baa 100644 --- a/drivers/md/dm-cache-metadata.h +++ b/drivers/md/dm-cache-metadata.h @@ -123,8 +123,6 @@ int dm_cache_get_free_metadata_block_count(struct dm_cache_metadata *cmd, int dm_cache_get_metadata_dev_size(struct dm_cache_metadata *cmd, dm_block_t *result); -void dm_cache_dump(struct dm_cache_metadata *cmd); - /* * The policy is invited to save a 32bit hint value for every cblock (eg, * for a hit count). These are stored against the policy name. If From patchwork Thu Oct 3 01:15:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13820605 X-Patchwork-Delegate: mpatocka@redhat.com Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BD9C54FAD; Thu, 3 Oct 2024 01:16:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918184; cv=none; b=V4cJlZPR5Pq4iZ0doHNknA+YUGZ2TQrFJm3Q2VtTxq/gpxezMdRCCBgwB02utOFG0I0A2DSE8948GSV8mbrlF7T91Z7TM3F7hLIPPCPQMCMkgXMjI4BVQ+FMssC7EtUjcMBe3YJyao/BUQI306s+DCPeG6+i37fQQUW8z/WqzFs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918184; c=relaxed/simple; bh=yRyRu09rjWWRWVV1/aff06NT17wDw3k6NqMkdlOVvWs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T+y1KoGfP78MtyQFiDp2srkRZD0U77mRW1JYQW5F/B2UQ2sAtraO64nXlK/0UMqQFZdS80YUy0tDKW8wCRGd1Ev9IdD+1rJ4HxdqPRgRcpw7HpEBYm/BnKz9k4PD7f9qjWqo9BLGQqNVn9Rp4znIEfJ6qtob/7H0v9UilyrnkEA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=Plu6LJo0; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="Plu6LJo0" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=PdU9COH57s3vSHoEOCAqWIpM+hbAu2HfjusrmOZfRXM=; b=Plu6LJo0UcIThH5g oi4hWfeLULlgjGuzO4UNU+KhEQoudNFc725ZkUskq3ZO9PmGJhmz+Fp0NdBBV++o7jPT03cZw06kb B/mL20z9F94+rvmDgtYlCta5dRLlIq33ZhFNXEaVJezOTPFdEHUTSong/DMW76nAKm31OPtB3r+iQ dHn8EczfYIcDdqAEpjym/HeYG0jMWwliKZItW0OJWS91neZtB2tIgn0Yy6fsAADpyYXWI+WcMCEyl /VPmfKZGMyFOgyCW0ugeMH2gzsPcL0UET5YHlgnn4KXEkcK/QTYypIn2ugyXBfPEbRMdkvJGQ950t t/YE6BFzwc1EPUuqjw==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1swARu-008Zju-07; Thu, 03 Oct 2024 01:16:10 +0000 From: linux@treblig.org To: agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com, msakai@redhat.com Cc: dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 3/9] dm cache: Remove unused dm_cache_size Date: Thu, 3 Oct 2024 02:15:48 +0100 Message-ID: <20241003011554.266654-4-linux@treblig.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241003011554.266654-1-linux@treblig.org> References: <20241003011554.266654-1-linux@treblig.org> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" dm_cache_size() has been unused since the original commit c6b4fcbad044 ("dm: add cache target") Remove it. Signed-off-by: Dr. David Alan Gilbert --- drivers/md/dm-cache-metadata.c | 9 --------- drivers/md/dm-cache-metadata.h | 1 - 2 files changed, 10 deletions(-) diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c index 5c757603ab36..a9a1ab284076 100644 --- a/drivers/md/dm-cache-metadata.c +++ b/drivers/md/dm-cache-metadata.c @@ -1218,15 +1218,6 @@ int dm_cache_load_discards(struct dm_cache_metadata *cmd, return r; } -int dm_cache_size(struct dm_cache_metadata *cmd, dm_cblock_t *result) -{ - READ_LOCK(cmd); - *result = cmd->cache_blocks; - READ_UNLOCK(cmd); - - return 0; -} - static int __remove(struct dm_cache_metadata *cmd, dm_cblock_t cblock) { int r; diff --git a/drivers/md/dm-cache-metadata.h b/drivers/md/dm-cache-metadata.h index 3e5472173baa..5f77890207fe 100644 --- a/drivers/md/dm-cache-metadata.h +++ b/drivers/md/dm-cache-metadata.h @@ -71,7 +71,6 @@ void dm_cache_metadata_close(struct dm_cache_metadata *cmd); * origin blocks to map to. */ int dm_cache_resize(struct dm_cache_metadata *cmd, dm_cblock_t new_cache_size); -int dm_cache_size(struct dm_cache_metadata *cmd, dm_cblock_t *result); int dm_cache_discard_bitset_resize(struct dm_cache_metadata *cmd, sector_t discard_block_size, From patchwork Thu Oct 3 01:15:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13820606 X-Patchwork-Delegate: mpatocka@redhat.com Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C50CE10940; Thu, 3 Oct 2024 01:16:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918184; cv=none; b=qbz5xXHdYcouXQRv7ljHbEXNXrYZJ1y6hKuQGQPIkUcVCqOMo64Dl6xLWJoOozbq0/deQQZHMJFeQfACr1BQ/J3Hco3aewiE47JyfD9b0v6I0e7RoImrq5sQ1nVqqhNJZ8Q48wb95goFQFe+Hf2JcliaOAVvNZDKSrIjBdUlTZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918184; c=relaxed/simple; bh=TN42O+dPCc9rpN7i5uzpW1iB7+KL+xeALQWTXTx2TB4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X+Tbr1yXl3Y2nbbrAy49ZJrtC86H7hJryA6uqRhEKkulBD7AmO6IQJu400OWTlIm0Mqdwg6pzwA1xhNWWslASZdQydMUHoE9ar/nXiRTaTlGncODYfAAsiaZ/8hBS1p0CCJcJFuRxs23qM7g4vrBQSsitXzOUlwgjuPyy/ju47g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=fd4gtFQt; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="fd4gtFQt" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=h8lTTXfuK6RUBS+BUnUa8xbmT/8DZa1iUX/wpjTb1G0=; b=fd4gtFQt2HSZtktr MY3ZQKUr7AQK5YpTfMuLGleyUxPPi2c7U9VAfIQ4DkapknjFEolid1ylqintkqlLC8t21gBpME9hX Uz6mp0ddKnSnKYXlc9qJ/bT1tfwdTI8sor2jyZp0QHMxQsfOcyJnbNrRIl7iFEXilNw6ayPahg186 CXze/Ib04s6PYaXgE2vzZeZNQ9qWEwTdazKV4hY/teXOzh3mpuj8ZPEMt2TvP8zi0elqdDjP00u6+ zDCo3j7qW0McbSV9N9rpYuxrgyvqxjZ+zmVjL0chKn6BbBe6T+gcE5iXv3GTcq1rswFuw4SfmVN1j sePiF8l8xC4t1W9kcg==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1swARu-008Zju-22; Thu, 03 Oct 2024 01:16:10 +0000 From: linux@treblig.org To: agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com, msakai@redhat.com Cc: dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 4/9] dm cache: Remove unused functions in bio-prison-v1 Date: Thu, 3 Oct 2024 02:15:49 +0100 Message-ID: <20241003011554.266654-5-linux@treblig.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241003011554.266654-1-linux@treblig.org> References: <20241003011554.266654-1-linux@treblig.org> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" dm_cache_size() and dm_cache_dump() are unused since commit b29d4986d0da ("dm cache: significant rework to leverage dm-bio-prison-v2") Remove them. Signed-off-by: Dr. David Alan Gilbert --- drivers/md/dm-bio-prison-v1.c | 35 ----------------------------------- drivers/md/dm-bio-prison-v1.h | 24 ------------------------ 2 files changed, 59 deletions(-) diff --git a/drivers/md/dm-bio-prison-v1.c b/drivers/md/dm-bio-prison-v1.c index bca0f39e15b8..b4d1c4329df3 100644 --- a/drivers/md/dm-bio-prison-v1.c +++ b/drivers/md/dm-bio-prison-v1.c @@ -198,15 +198,6 @@ int dm_bio_detain(struct dm_bio_prison *prison, } EXPORT_SYMBOL_GPL(dm_bio_detain); -int dm_get_cell(struct dm_bio_prison *prison, - struct dm_cell_key *key, - struct dm_bio_prison_cell *cell_prealloc, - struct dm_bio_prison_cell **cell_result) -{ - return bio_detain(prison, key, NULL, cell_prealloc, cell_result); -} -EXPORT_SYMBOL_GPL(dm_get_cell); - /* * @inmates must have been initialised prior to this call */ @@ -288,32 +279,6 @@ void dm_cell_visit_release(struct dm_bio_prison *prison, } EXPORT_SYMBOL_GPL(dm_cell_visit_release); -static int __promote_or_release(struct rb_root *root, - struct dm_bio_prison_cell *cell) -{ - if (bio_list_empty(&cell->bios)) { - rb_erase(&cell->node, root); - return 1; - } - - cell->holder = bio_list_pop(&cell->bios); - return 0; -} - -int dm_cell_promote_or_release(struct dm_bio_prison *prison, - struct dm_bio_prison_cell *cell) -{ - int r; - unsigned l = lock_nr(&cell->key, prison->num_locks); - - spin_lock_irq(&prison->regions[l].lock); - r = __promote_or_release(&prison->regions[l].cell, cell); - spin_unlock_irq(&prison->regions[l].lock); - - return r; -} -EXPORT_SYMBOL_GPL(dm_cell_promote_or_release); - /*----------------------------------------------------------------*/ #define DEFERRED_SET_SIZE 64 diff --git a/drivers/md/dm-bio-prison-v1.h b/drivers/md/dm-bio-prison-v1.h index 2a097ed0d85e..d39706c48447 100644 --- a/drivers/md/dm-bio-prison-v1.h +++ b/drivers/md/dm-bio-prison-v1.h @@ -72,17 +72,6 @@ struct dm_bio_prison_cell *dm_bio_prison_alloc_cell(struct dm_bio_prison *prison void dm_bio_prison_free_cell(struct dm_bio_prison *prison, struct dm_bio_prison_cell *cell); -/* - * Creates, or retrieves a cell that overlaps the given key. - * - * Returns 1 if pre-existing cell returned, zero if new cell created using - * @cell_prealloc. - */ -int dm_get_cell(struct dm_bio_prison *prison, - struct dm_cell_key *key, - struct dm_bio_prison_cell *cell_prealloc, - struct dm_bio_prison_cell **cell_result); - /* * Returns false if key is beyond BIO_PRISON_MAX_RANGE or spans a boundary. */ @@ -117,19 +106,6 @@ void dm_cell_visit_release(struct dm_bio_prison *prison, void (*visit_fn)(void *, struct dm_bio_prison_cell *), void *context, struct dm_bio_prison_cell *cell); -/* - * Rather than always releasing the prisoners in a cell, the client may - * want to promote one of them to be the new holder. There is a race here - * though between releasing an empty cell, and other threads adding new - * inmates. So this function makes the decision with its lock held. - * - * This function can have two outcomes: - * i) An inmate is promoted to be the holder of the cell (return value of 0). - * ii) The cell has no inmate for promotion and is released (return value of 1). - */ -int dm_cell_promote_or_release(struct dm_bio_prison *prison, - struct dm_bio_prison_cell *cell); - /*----------------------------------------------------------------*/ /* From patchwork Thu Oct 3 01:15:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13820597 X-Patchwork-Delegate: mpatocka@redhat.com Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BF6C17BBF; Thu, 3 Oct 2024 01:16:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918177; cv=none; b=B/14Kr9ghnKg8r8o0oLhjH8xtPm7zF6cmm7XNyHDelrcrHgZeJKQeZkoDb00YELFJ9N6QCOfzYyXgZs7fULgbzl3OVLj41J/4ohiZwh1Wm0B9MRczPBr6aT34djuhj5FCvnSN4DmOQr0pDlwGkhggEcK0SUOzfTbbQXye5SeUZk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918177; c=relaxed/simple; bh=JRC906exSE9WB+qYkiBV4/PRS03ooo6xcMkMgYsjK/4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QCsYNRQ6bGtoRvY6dSac9nToKUSr/ZqvFJK70W01LcpczTqQ4IBxVmw9+5GbbNYygR/dI/3VLtAgRq7zHZ13Y0lmqb7zLnGz0I5Yd/rCSXwwo/0rhaY/Ww9tfAeY//DDZboVLtpkDeO4SuJzJknbKIr8O3XoG9fuy2qmwkW+/vE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=TUavmXh3; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="TUavmXh3" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=Xf623GrtvbUSnaBJBS1171I3r1qDM08Bu2TkB7MDTSE=; b=TUavmXh34z0zrjDs 4cfzYhRq19BmQfINPpax0gYvN2rbI4v23Fcfl6fsfadsE5Yac5H34UOoXnTiQhM8XLnTx02ryeMdq ZEhtOOerz8pCdTfPTBj4wMRkvCNp4A5yvzJa7pA42wygfjDQAIHNK7RF+hzWxja7NBwU+E6tbpvPf 4fj1yPvIR6+d1twhanLDHbO1nDw837w6T0a3HMPcW+/ztQxPMoJM6aP/uyk/3KvKjCXOLT6hO4mhT RIspBR6R16OadclTVpgyOw8wy7eGzJ29XtjVnJphKvKbfuF02wC/US3xT+EpMNreCNm74lkImjA00 /HL6ewudxBFKkMIzdg==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1swARv-008Zju-0Y; Thu, 03 Oct 2024 01:16:11 +0000 From: linux@treblig.org To: agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com, msakai@redhat.com Cc: dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 5/9] dm: Remove unused dm_set_md_type Date: Thu, 3 Oct 2024 02:15:50 +0100 Message-ID: <20241003011554.266654-6-linux@treblig.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241003011554.266654-1-linux@treblig.org> References: <20241003011554.266654-1-linux@treblig.org> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" dm_set_md_type() has been unused since commit ba30585936b0 ("dm: move setting md->type into dm_setup_md_queue") Remove it. Signed-off-by: Dr. David Alan Gilbert --- drivers/md/dm.c | 6 ------ drivers/md/dm.h | 1 - 2 files changed, 7 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index ff4a6b570b76..6630e89cea4a 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2515,12 +2515,6 @@ void dm_unlock_md_type(struct mapped_device *md) mutex_unlock(&md->type_lock); } -void dm_set_md_type(struct mapped_device *md, enum dm_queue_mode type) -{ - BUG_ON(!mutex_is_locked(&md->type_lock)); - md->type = type; -} - enum dm_queue_mode dm_get_md_type(struct mapped_device *md) { return md->type; diff --git a/drivers/md/dm.h b/drivers/md/dm.h index 8ad782249af8..d4062c3154db 100644 --- a/drivers/md/dm.h +++ b/drivers/md/dm.h @@ -76,7 +76,6 @@ bool dm_table_request_based(struct dm_table *t); void dm_lock_md_type(struct mapped_device *md); void dm_unlock_md_type(struct mapped_device *md); -void dm_set_md_type(struct mapped_device *md, enum dm_queue_mode type); enum dm_queue_mode dm_get_md_type(struct mapped_device *md); struct target_type *dm_get_immutable_target_type(struct mapped_device *md); From patchwork Thu Oct 3 01:15:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13820599 X-Patchwork-Delegate: mpatocka@redhat.com Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D542617C77; Thu, 3 Oct 2024 01:16:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918178; cv=none; b=kNtmBtBFD7HK49kH5Pw3cEybzjVjGZi5fQaYaqQssOmz2OLCJ+IKlVo7vQq5FS/C0DtxNGNgCKCeeeaXT91ueg7Yowglio6iKPfDc4cFnpcllXFI98SLmx/1GRTOWgc7GKYU6ayo63AExVq+V5AaqQWStnxxgXEGyhJ0PYqwWUs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918178; c=relaxed/simple; bh=5vYfkV/BEoRV+gZGk8qqcYOUr6IAnwQOVC6W2k3CjD8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t6a64yikvgCml3Z+mctOYKTYDH9cPlbQwVIsBxBPe/AmR3WoMZX/qV5XZXBaQDDgikNLXEorN4H0E4PUq+8RvNz0tjijmAdxSOwlUhtrMJeiOEZD2PdQ1yZyDmnC1SrujkvZJnAa1H78vSU5FG1mGLoOi3PB9BysGMpRP3JjT0c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=VKZjdCB5; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="VKZjdCB5" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=nf46B3GWSY0de6DHLWA9w92fJi3N5OrQUGfozYC/6Zg=; b=VKZjdCB5hyXyjFer zdG7BQmw3y16CovNJEqWcegBri9tFagJ1P4D5haEz/vSrjifHX3CroBi34VNnw2wWwqLppb5Oxr+3 u3dMJgwWxirXnCfdYgfrXQXJU3cn+gd6TX9f7/peLRCDQODJZt0Tli8zzTjl6/H3XHWPpBDqC6UUH roikSU+t85W8nPfFOVk4lhJMbURpjSv1aZBZvIfKe6NkCuoQiG5Z4fmKEcHi9x7zSea9PDRwobS/1 Q5+7NScWf7WVs0sEhvE5VMchyO13pR/Tk0E7/KMrJpNENseka8iZcL1e6DAy8sk5vaTIwHyb/v8wC IUzAHUVBf1UfUQSfnA==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1swARv-008Zju-2M; Thu, 03 Oct 2024 01:16:11 +0000 From: linux@treblig.org To: agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com, msakai@redhat.com Cc: dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 6/9] dm: Remove unused dm_table_bio_based Date: Thu, 3 Oct 2024 02:15:51 +0100 Message-ID: <20241003011554.266654-7-linux@treblig.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241003011554.266654-1-linux@treblig.org> References: <20241003011554.266654-1-linux@treblig.org> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" dm_table_bio_based() is unused since commit 29dec90a0f1d ("dm: fix bio_set allocation") Remove it. Signed-off-by: Dr. David Alan Gilbert --- drivers/md/dm-table.c | 5 ----- drivers/md/dm.h | 1 - 2 files changed, 6 deletions(-) diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index dbd39b9722b9..bd8b796ae683 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -1033,11 +1033,6 @@ struct dm_target *dm_table_get_wildcard_target(struct dm_table *t) return NULL; } -bool dm_table_bio_based(struct dm_table *t) -{ - return __table_type_bio_based(dm_table_get_type(t)); -} - bool dm_table_request_based(struct dm_table *t) { return __table_type_request_based(dm_table_get_type(t)); diff --git a/drivers/md/dm.h b/drivers/md/dm.h index d4062c3154db..a0a8ff119815 100644 --- a/drivers/md/dm.h +++ b/drivers/md/dm.h @@ -71,7 +71,6 @@ enum dm_queue_mode dm_table_get_type(struct dm_table *t); struct target_type *dm_table_get_immutable_target_type(struct dm_table *t); struct dm_target *dm_table_get_immutable_target(struct dm_table *t); struct dm_target *dm_table_get_wildcard_target(struct dm_table *t); -bool dm_table_bio_based(struct dm_table *t); bool dm_table_request_based(struct dm_table *t); void dm_lock_md_type(struct mapped_device *md); From patchwork Thu Oct 3 01:15:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13820600 X-Patchwork-Delegate: mpatocka@redhat.com Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AE4517C98; Thu, 3 Oct 2024 01:16:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918178; cv=none; b=OZ1etKO16w2a5YqcErBjM6muaqmGArhmU0bsh5TzWBWzPkp4ueKhMd1YRzlAOhJLMlC8zgGXHvb2vHfSF0Yl3E+RQDqPCLFwZuECfLHLngUQBOmzHW5WwMle7qHCcYPK261z3UwGaGvi667FL7PqawPzIZ1NCWkcuJrMpdwDi7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918178; c=relaxed/simple; bh=eaSJLNLPMGgaZ7Hm0PkTjhFdrJccaWT0Vr7021A2J2E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nk0QwvUKY/0ijV0TcfEBEqS+azJcaGEdlXgiIE5qemiEDmvcUj4rT+qlpPwDW9MRMLwoyXFgdTB5XtYi7zy0/tpTG+HNRtMn+ckDw55GotCtWgdam9w55nT+Gtz2X4ty9d8f/ElNj1pSVOHX3LD63gklAP1DSgOTEg9J1qWBhmM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=L6agMQxP; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="L6agMQxP" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=bMs5sCW3AIt+TA9E46n5r8V+O+7TgYy4TKjdM6BV0Hc=; b=L6agMQxPaevo90kg 1geRxu/lY3YfB8XyE3cGnHPtUPdlpjkcCnP1dYUFLZR/U5YmInEFMAaM3WvuIlcD3WL1bAve8rpJj QmEDV9iC6k3a+ZpGTGFAyv+dRUujv5X301UdmhyqDrpXuJvx9j7cLtz5GM7U/dRH3jD6o/c6Z7dmy gEDh2wVKI5CcHXKTF8jNLPb3WuF43stWCIVnIQBxBUS1hrlmlYLeE0xGAAlPBok9TDQTwpMrKhnIF NbK7Sw5OEEbTFPeEGBvpoO2Zh1W1RqyQaRPK2gGUR0Z7Rx74hl92deXTrAqankFlcChsxwnTKaqPa jBHeaoBnILyf9IN0yw==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1swARw-008Zju-16; Thu, 03 Oct 2024 01:16:12 +0000 From: linux@treblig.org To: agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com, msakai@redhat.com Cc: dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 7/9] dm: zoned: Remove unused functions Date: Thu, 3 Oct 2024 02:15:52 +0100 Message-ID: <20241003011554.266654-8-linux@treblig.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241003011554.266654-1-linux@treblig.org> References: <20241003011554.266654-1-linux@treblig.org> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" dmz_resume_metadata() is unused since it was added in commit 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target") dmz_zone_nr_blocks_shift is unused since it was added in commit 368205601375 ("dm zoned: move fields from struct dmz_dev to dmz_metadata") Remove them. Signed-off-by: Dr. David Alan Gilbert --- drivers/md/dm-zoned-metadata.c | 50 ---------------------------------- drivers/md/dm-zoned.h | 2 -- 2 files changed, 52 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index 8156881a31de..deff22ecccbb 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -245,11 +245,6 @@ unsigned int dmz_zone_nr_blocks(struct dmz_metadata *zmd) return zmd->zone_nr_blocks; } -unsigned int dmz_zone_nr_blocks_shift(struct dmz_metadata *zmd) -{ - return zmd->zone_nr_blocks_shift; -} - unsigned int dmz_zone_nr_sectors(struct dmz_metadata *zmd) { return zmd->zone_nr_sectors; @@ -3005,48 +3000,3 @@ void dmz_dtr_metadata(struct dmz_metadata *zmd) dmz_cleanup_metadata(zmd); kfree(zmd); } - -/* - * Check zone information on resume. - */ -int dmz_resume_metadata(struct dmz_metadata *zmd) -{ - struct dm_zone *zone; - sector_t wp_block; - unsigned int i; - int ret; - - /* Check zones */ - for (i = 0; i < zmd->nr_zones; i++) { - zone = dmz_get(zmd, i); - if (!zone) { - dmz_zmd_err(zmd, "Unable to get zone %u", i); - return -EIO; - } - wp_block = zone->wp_block; - - ret = dmz_update_zone(zmd, zone); - if (ret) { - dmz_zmd_err(zmd, "Broken zone %u", i); - return ret; - } - - if (dmz_is_offline(zone)) { - dmz_zmd_warn(zmd, "Zone %u is offline", i); - continue; - } - - /* Check write pointer */ - if (!dmz_is_seq(zone)) - zone->wp_block = 0; - else if (zone->wp_block != wp_block) { - dmz_zmd_err(zmd, "Zone %u: Invalid wp (%llu / %llu)", - i, (u64)zone->wp_block, (u64)wp_block); - zone->wp_block = wp_block; - dmz_invalidate_blocks(zmd, zone, zone->wp_block, - zmd->zone_nr_blocks - zone->wp_block); - } - } - - return 0; -} diff --git a/drivers/md/dm-zoned.h b/drivers/md/dm-zoned.h index 265494d3f711..59ba0aaa9531 100644 --- a/drivers/md/dm-zoned.h +++ b/drivers/md/dm-zoned.h @@ -192,7 +192,6 @@ enum { int dmz_ctr_metadata(struct dmz_dev *dev, int num_dev, struct dmz_metadata **zmd, const char *devname); void dmz_dtr_metadata(struct dmz_metadata *zmd); -int dmz_resume_metadata(struct dmz_metadata *zmd); void dmz_lock_map(struct dmz_metadata *zmd); void dmz_unlock_map(struct dmz_metadata *zmd); @@ -230,7 +229,6 @@ unsigned int dmz_nr_unmap_rnd_zones(struct dmz_metadata *zmd, int idx); unsigned int dmz_nr_seq_zones(struct dmz_metadata *zmd, int idx); unsigned int dmz_nr_unmap_seq_zones(struct dmz_metadata *zmd, int idx); unsigned int dmz_zone_nr_blocks(struct dmz_metadata *zmd); -unsigned int dmz_zone_nr_blocks_shift(struct dmz_metadata *zmd); unsigned int dmz_zone_nr_sectors(struct dmz_metadata *zmd); unsigned int dmz_zone_nr_sectors_shift(struct dmz_metadata *zmd); From patchwork Thu Oct 3 01:15:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13820601 X-Patchwork-Delegate: mpatocka@redhat.com Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D144A10940; Thu, 3 Oct 2024 01:16:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918179; cv=none; b=qy6tz309rkMrly4fSTMDsaVpeZ4jkX27gdweBFGegy9vE6A9mcmuSfXRm/HmWfpW11Etje/B4n6aLY/Ee0tNLiLMZ/DNxpHZuqYqd4GjOklxNl++GfHTmgv7IuACMoW6oVvvhwgJiDUcEaPPlVBRVvJ/aZA6WLhVr/3Y5j224pg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918179; c=relaxed/simple; bh=qYM7kw7E6NnGTdVJpMSnkfoBcFLwnnbnKBFmv331Qzo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RR1it4yXrFRmb9OBuiRVHjLGoYF+Kd6bG/+E/3e8spe/QtRoUxD9k8qbLNxSlu4+Mnf6ic3j5f4li3bU3MiREztnZIInaHLCcbUI4LmEGKjTjeF8qI60NoKB6z70Wn+3Pj7RLXt3DtkUYdREpHm+eo050vjjBdIxEnyr4Qc/J0Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=ZPT7KupU; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="ZPT7KupU" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=GM9PtILR3a+Jl7Go3vn6KDGhUKYvUmZxnnhAKHmPXaQ=; b=ZPT7KupU3hTz5tCE RiCmYIO3rmPD9kcQWHrMbwKdmOsnehNDb6+frm1cqbWR+w3am//FB8pX39sUcDrHrFYndOn0/alHG KgPtMYFjBYiXMPjxel1BAmvR4v2/8I+SSN1N+KQYIJWhDkGF9A6WhnDg1c8l6kz/8OHJJoB49deDy Ie5ikZNtVkO+1Kr4LUEAgAAjI1ZiHwOc7wXWRkDFPcMAifXmiIjAtyC5OOsVTaAhNEZkVRRYxIDhC HXDJUn+fqRRWNS0L+6+cj92i2Vuxmyuj9fCWd3dN+XuUmst8zPpSUwF628mG7k8LvwT+K5NRZQRRV av4mmr1l/in/uh9ZFw==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1swARw-008Zju-31; Thu, 03 Oct 2024 01:16:13 +0000 From: linux@treblig.org To: agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com, msakai@redhat.com Cc: dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 8/9] dm vdo: Remove unused functions Date: Thu, 3 Oct 2024 02:15:53 +0100 Message-ID: <20241003011554.266654-9-linux@treblig.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241003011554.266654-1-linux@treblig.org> References: <20241003011554.266654-1-linux@treblig.org> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" get_data_vio_pool_active_discards() get_data_vio_pool_discard_limit() get_data_vio_pool_maximum_discards() set_data_vio_pool_discard_limit() are all unused since commit a9da0fb6d8c6 ("dm vdo: remove all sysfs interfaces") Remove them. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Matthew Sakai --- drivers/md/dm-vdo/data-vio.c | 29 ----------------------------- drivers/md/dm-vdo/data-vio.h | 5 ----- 2 files changed, 34 deletions(-) diff --git a/drivers/md/dm-vdo/data-vio.c b/drivers/md/dm-vdo/data-vio.c index 0d502f6a86ad..2b489e37538e 100644 --- a/drivers/md/dm-vdo/data-vio.c +++ b/drivers/md/dm-vdo/data-vio.c @@ -1074,35 +1074,6 @@ void dump_data_vio_pool(struct data_vio_pool *pool, bool dump_vios) spin_unlock(&pool->lock); } -data_vio_count_t get_data_vio_pool_active_discards(struct data_vio_pool *pool) -{ - return READ_ONCE(pool->discard_limiter.busy); -} - -data_vio_count_t get_data_vio_pool_discard_limit(struct data_vio_pool *pool) -{ - return READ_ONCE(pool->discard_limiter.limit); -} - -data_vio_count_t get_data_vio_pool_maximum_discards(struct data_vio_pool *pool) -{ - return READ_ONCE(pool->discard_limiter.max_busy); -} - -int set_data_vio_pool_discard_limit(struct data_vio_pool *pool, data_vio_count_t limit) -{ - if (get_data_vio_pool_request_limit(pool) < limit) { - // The discard limit may not be higher than the data_vio limit. - return -EINVAL; - } - - spin_lock(&pool->lock); - pool->discard_limiter.limit = limit; - spin_unlock(&pool->lock); - - return VDO_SUCCESS; -} - data_vio_count_t get_data_vio_pool_active_requests(struct data_vio_pool *pool) { return READ_ONCE(pool->limiter.busy); diff --git a/drivers/md/dm-vdo/data-vio.h b/drivers/md/dm-vdo/data-vio.h index 25926b6cd98b..067b983bb291 100644 --- a/drivers/md/dm-vdo/data-vio.h +++ b/drivers/md/dm-vdo/data-vio.h @@ -336,11 +336,6 @@ void drain_data_vio_pool(struct data_vio_pool *pool, struct vdo_completion *comp void resume_data_vio_pool(struct data_vio_pool *pool, struct vdo_completion *completion); void dump_data_vio_pool(struct data_vio_pool *pool, bool dump_vios); -data_vio_count_t get_data_vio_pool_active_discards(struct data_vio_pool *pool); -data_vio_count_t get_data_vio_pool_discard_limit(struct data_vio_pool *pool); -data_vio_count_t get_data_vio_pool_maximum_discards(struct data_vio_pool *pool); -int __must_check set_data_vio_pool_discard_limit(struct data_vio_pool *pool, - data_vio_count_t limit); data_vio_count_t get_data_vio_pool_active_requests(struct data_vio_pool *pool); data_vio_count_t get_data_vio_pool_request_limit(struct data_vio_pool *pool); data_vio_count_t get_data_vio_pool_maximum_requests(struct data_vio_pool *pool); From patchwork Thu Oct 3 01:15:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13820602 X-Patchwork-Delegate: mpatocka@redhat.com Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEF6C17BCE; Thu, 3 Oct 2024 01:16:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918180; cv=none; b=fCUUtiQt8WdciqBkcFO4O6mFxqjOrqA4BTxbzaNJfKUL+ORuptpI29b3AXPK6OaUhDQ4rw5OywHVmeKVzyjWOFa23xvlkq4N8UKT/+P65OWS0IHba/QLZnXDUJVTYQN/pWvb4DaC4ePKFryjus0gqHK+zpmSKHZwG9vLj32/t0c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727918180; c=relaxed/simple; bh=qVfQLDLGMSl6jEtK1Mx9+oBBF1tpV7JAUVMDfbCCyFI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dQmTXez58N7uqBGXyUg7oo5SE1c1QnkD8x+DTI1ntvmOJCmYmp19UiLcMfPbZz0xgcdAlrH67RE9XYDcPP6JiY8S8eBVmyn40Qt1tj0c6BhAz5EiAqcSGh40ZQpC0sQEqavHyVxx6S7VqBA3Pr9Whyg9sPMN+LaoEKSpbY74X70= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=SwRkD8cM; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="SwRkD8cM" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=T38uohCYX7hSayOdEiQEq9Wgaxht+5HAYWTxt6lFNlI=; b=SwRkD8cMwuCCvj00 L/GMI0swR8B885UDt3HlXBsKt4UvL0D6CVTvrKUns49xxqx4lul6Gcqk0c0fsFbCDguEw7ZsOJA6J lanQo3UUAaEUoSKtIPuCDv2Ra433M/cBXeT0cjn15Onyt0HLmzMPU0yEdA6sBg0N7vF17H8wkfCzS 2smZN6n2Svbuf6zk/UmFSt8DAZQdrjfQQ000Xlf7BM8ityMfChnjMRdXK8B76yuKOs1wHehjWCJrs H9M1jdyl/ywecbaDPdfTSQmB82Eubra4NgYQPx3zIHmaH8iDYzhToTCb8AzcdP6zg1P6aq1/ZPFmb 1DNftrq4ZvuiHZoMDg==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1swARy-008Zju-0K; Thu, 03 Oct 2024 01:16:14 +0000 From: linux@treblig.org To: agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com, msakai@redhat.com Cc: dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 9/9] dm vdo: Remove unused uds_compute_index_size Date: Thu, 3 Oct 2024 02:15:54 +0100 Message-ID: <20241003011554.266654-10-linux@treblig.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241003011554.266654-1-linux@treblig.org> References: <20241003011554.266654-1-linux@treblig.org> Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" uds_compute_index_size() has been unused since it was added in commit b46d79bdb82a ("dm vdo: add deduplication index storage interface") Remove it. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Matthew Sakai --- drivers/md/dm-vdo/indexer/index-layout.c | 26 ------------------------ drivers/md/dm-vdo/indexer/indexer.h | 4 ---- 2 files changed, 30 deletions(-) diff --git a/drivers/md/dm-vdo/indexer/index-layout.c b/drivers/md/dm-vdo/indexer/index-layout.c index 627adc24af3b..af8fab83b0f3 100644 --- a/drivers/md/dm-vdo/indexer/index-layout.c +++ b/drivers/md/dm-vdo/indexer/index-layout.c @@ -248,32 +248,6 @@ static int __must_check compute_sizes(const struct uds_configuration *config, return UDS_SUCCESS; } -int uds_compute_index_size(const struct uds_parameters *parameters, u64 *index_size) -{ - int result; - struct uds_configuration *index_config; - struct save_layout_sizes sizes; - - if (index_size == NULL) { - vdo_log_error("Missing output size pointer"); - return -EINVAL; - } - - result = uds_make_configuration(parameters, &index_config); - if (result != UDS_SUCCESS) { - vdo_log_error_strerror(result, "cannot compute index size"); - return uds_status_to_errno(result); - } - - result = compute_sizes(index_config, &sizes); - uds_free_configuration(index_config); - if (result != UDS_SUCCESS) - return uds_status_to_errno(result); - - *index_size = sizes.total_size; - return UDS_SUCCESS; -} - /* Create unique data using the current time and a pseudorandom number. */ static void create_unique_nonce_data(u8 *buffer) { diff --git a/drivers/md/dm-vdo/indexer/indexer.h b/drivers/md/dm-vdo/indexer/indexer.h index 3744aaf625b0..183a94eb7e92 100644 --- a/drivers/md/dm-vdo/indexer/indexer.h +++ b/drivers/md/dm-vdo/indexer/indexer.h @@ -283,10 +283,6 @@ struct uds_request { enum uds_index_region location; }; -/* Compute the number of bytes needed to store an index. */ -int __must_check uds_compute_index_size(const struct uds_parameters *parameters, - u64 *index_size); - /* A session is required for most index operations. */ int __must_check uds_create_index_session(struct uds_index_session **session);