From patchwork Sat Jan 27 03:01:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Sakai X-Patchwork-Id: 13533955 X-Patchwork-Delegate: snitzer@redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 791C8BA5F for ; Sat, 27 Jan 2024 03:01:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706324493; cv=none; b=rP4+3uFy858Q9RuOhuhZEAgZjFMn5w5HCjmFeBMh2pG8Kqzozk+1CpDHXZtzyNeWSYMlMvxOoJQm+NI/H48lIqsCiB9Z6Dp0F4Ntr3lIbqVjdsHZlXVCnVeAc8U1Ow4XKQGvoRVVlCOgod1Ubw1CvFiWLgMwrAkw2w6dFAomfDA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706324493; c=relaxed/simple; bh=Ib7L8H/hDvPyFUHtR5q7ORjFTG608MU0f3lEJndjYag=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QhV6zcutzPkt7ab3ZzYXggKBy26aNlGi+xE1VJd3LtBcFOSZfTJIP8Xdd4AuoOeQ8hmnIPc7vvc7wmHqSrcBk9ufjwXiRn2vWSFKJnn15cplDLn1po03aGT1t4UfLnwVhoV8dyv5eUcrGgannDtyjdFza9CWDKeIQEVLo62ECe4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=KsinfLAq; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KsinfLAq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706324490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CGpAIX93U6r22aJVvjAav61+jnEG/LZ0lOoy7VQn7Zo=; b=KsinfLAq4IIHh+66Uez+ifcdT4Q/8OLEBrNov3pLSCccmrz35+rapNA7bB+/K6n2GVrsHW tdtSP8pPoWe9Tl1UC6Y7ntf+Jk8j1I4hLsh74ZXEO7HqUYEOr3rxBuun5ZUwMp4HN6khNS hqjiTokU2DALIpEw/9L07HYX6e6YCqs= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-436-0Pd-pKgVNSyVj5zyBpG3Tw-1; Fri, 26 Jan 2024 22:01:27 -0500 X-MC-Unique: 0Pd-pKgVNSyVj5zyBpG3Tw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8A6BF1C04B66; Sat, 27 Jan 2024 03:01:27 +0000 (UTC) Received: from vdo-builder-msakai.permabit.com (vdo-builder-msakai.permabit.lab.eng.bos.redhat.com [10.0.103.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84A432166B32; Sat, 27 Jan 2024 03:01:27 +0000 (UTC) Received: by vdo-builder-msakai.permabit.com (Postfix, from userid 1138) id 7D7CE560E2; Fri, 26 Jan 2024 22:01:27 -0500 (EST) From: Matthew Sakai To: dm-devel@lists.linux.dev Cc: Mike Snitzer , Matthew Sakai Subject: [PATCH 1/3] dm vdo slab-depot: fix various small nits Date: Fri, 26 Jan 2024 22:01:25 -0500 Message-ID: <5ffc61d16c5a8c897178eda8bbe0df3634feafa6.1706324127.git.msakai@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com From: Mike Snitzer Comment typo, whitespace issues, mark function inline. Signed-off-by: Mike Snitzer Signed-off-by: Chung Chung Signed-off-by: Matthew Sakai --- drivers/md/dm-vdo/slab-depot.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/md/dm-vdo/slab-depot.c b/drivers/md/dm-vdo/slab-depot.c index 56d975c98752..42126bd60242 100644 --- a/drivers/md/dm-vdo/slab-depot.c +++ b/drivers/md/dm-vdo/slab-depot.c @@ -1360,7 +1360,7 @@ static unsigned int calculate_slab_priority(struct vdo_slab *slab) /* * Slabs are essentially prioritized by an approximation of the number of free blocks in the slab - * so slabs with lots of free blocks with be opened for allocation before slabs that have few free + * so slabs with lots of free blocks will be opened for allocation before slabs that have few free * blocks. */ static void prioritize_slab(struct vdo_slab *slab) @@ -1374,14 +1374,14 @@ static void prioritize_slab(struct vdo_slab *slab) /** * adjust_free_block_count() - Adjust the free block count and (if needed) reprioritize the slab. - * @increment: should be true if the free block count went up. + * @incremented: true if the free block count went up. */ -static void adjust_free_block_count(struct vdo_slab *slab, bool increment) +static void adjust_free_block_count(struct vdo_slab *slab, bool incremented) { struct block_allocator *allocator = slab->allocator; WRITE_ONCE(allocator->allocated_blocks, - allocator->allocated_blocks + (increment ? -1 : 1)); + allocator->allocated_blocks + (incremented ? -1 : 1)); /* The open slab doesn't need to be reprioritized until it is closed. */ if (slab == allocator->open_slab) @@ -1747,9 +1747,8 @@ static void add_entry_from_waiter(struct vdo_waiter *waiter, void *context) static inline bool is_next_entry_a_block_map_increment(struct slab_journal *journal) { struct vdo_waiter *waiter = vdo_waitq_get_first_waiter(&journal->entry_waiters); - struct reference_updater *updater = container_of(waiter, - struct reference_updater, - waiter); + struct reference_updater *updater = + container_of(waiter, struct reference_updater, waiter); return (updater->operation == VDO_JOURNAL_BLOCK_MAP_REMAPPING); } @@ -2642,7 +2641,7 @@ static struct vdo_slab *get_next_slab(struct slab_scrubber *scrubber) * * Return: true if the scrubber has slabs to scrub. */ -static bool __must_check has_slabs_to_scrub(struct slab_scrubber *scrubber) +static inline bool __must_check has_slabs_to_scrub(struct slab_scrubber *scrubber) { return (get_next_slab(scrubber) != NULL); } @@ -2817,8 +2816,8 @@ static int apply_block_entries(struct packed_slab_journal_block *block, static void apply_journal_entries(struct vdo_completion *completion) { int result; - struct slab_scrubber *scrubber - = container_of(as_vio(completion), struct slab_scrubber, vio); + struct slab_scrubber *scrubber = + container_of(as_vio(completion), struct slab_scrubber, vio); struct vdo_slab *slab = scrubber->slab; struct slab_journal *journal = &slab->journal; From patchwork Sat Jan 27 03:01:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Sakai X-Patchwork-Id: 13533956 X-Patchwork-Delegate: snitzer@redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 A80D3C148 for ; Sat, 27 Jan 2024 03:01:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706324494; cv=none; b=Yw5je4Vl8yfx0ApvHr0PjsqnzxtS0PGeiYycWgLnFT/ebut+WdLVWcjrqRDFkii773bN+X/Mdk/7qWW90M+MoG4TGWPBUmjO7uMp+5Gaql9z1KA11cHdx0K3MPJFoGW24awk5MD6UflkgqPMiXQaRYVQAk1QstOu5NypgXDzquA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706324494; c=relaxed/simple; bh=6QxsblFRxCmPabIdwTmnfvN2yMZsbG9GlrpqBo7d4k4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=eGD8Qgru5Wia1nRJlH8Zq/y+jdCfXD4GBo+VLtLVv5LQWuD5X1yzDS2urrGuilPxXt15Tt42zwqeyZINTogngM2ORCGKwRxMpEeAlCkYcG2aJ/GMflThlyP1jazcvoi/1qgCh7D4gGic07oruNdKGmElP+LLqnMH8882xOJ+dl4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=BPkV8aVh; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BPkV8aVh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706324491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EUa76riJYvt1BZ4O6uadLv5nDjODISijq/hBRJ1eQj0=; b=BPkV8aVhI3JFNX7SrJKCTE3IZow9Wr1NSdpDY+qk7cWCjfnUFPaOsVQxR3Eaz/j75/JSv/ l0Girg6XdAYEuCX/yEREww9ogbAhPyvCftRUWk3Ko/hYgUH8LCXIfiQDg355tpH0ylYeiL q1N2wGJ2DJT8lOhAusA8YJEMD+jAMHU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-145-T7R_WaISMNGc9u3p8hRE1g-1; Fri, 26 Jan 2024 22:01:27 -0500 X-MC-Unique: T7R_WaISMNGc9u3p8hRE1g-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8D08F185A785; Sat, 27 Jan 2024 03:01:27 +0000 (UTC) Received: from vdo-builder-msakai.permabit.com (vdo-builder-msakai.permabit.lab.eng.bos.redhat.com [10.0.103.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id 882AB40C9444; Sat, 27 Jan 2024 03:01:27 +0000 (UTC) Received: by vdo-builder-msakai.permabit.com (Postfix, from userid 1138) id 8303D560E4; Fri, 26 Jan 2024 22:01:27 -0500 (EST) From: Matthew Sakai To: dm-devel@lists.linux.dev Cc: Mike Snitzer , Matthew Sakai Subject: [PATCH 2/3] dm vdo dedupe: fix various small nits Date: Fri, 26 Jan 2024 22:01:26 -0500 Message-ID: <0b120dd755a2b39a2b2cc087a4b1315aa42d5467.1706324128.git.msakai@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com From: Mike Snitzer Remove extra blank line, mark function inline, add missing braces, and fix a typo in a comment. Signed-off-by: Mike Snitzer Signed-off-by: Chung Chung Signed-off-by: Matthew Sakai --- drivers/md/dm-vdo/dedupe.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/md/dm-vdo/dedupe.c b/drivers/md/dm-vdo/dedupe.c index b3ffb85518c3..8533f1669a01 100644 --- a/drivers/md/dm-vdo/dedupe.c +++ b/drivers/md/dm-vdo/dedupe.c @@ -1061,7 +1061,7 @@ static void start_deduping(struct hash_lock *lock, struct data_vio *agent, * increment_stat() - Increment a statistic counter in a non-atomic yet thread-safe manner. * @stat: The statistic field to increment. */ -static void increment_stat(u64 *stat) +static inline void increment_stat(u64 *stat) { /* * Must only be mutated on the hash zone thread. Prevents any compiler shenanigans from @@ -1130,7 +1130,6 @@ static bool blocks_equal(char *block1, char *block2) { int i; - for (i = 0; i < VDO_BLOCK_SIZE; i += sizeof(u64)) { if (*((u64 *) &block1[i]) != *((u64 *) &block2[i])) return false; @@ -1456,13 +1455,13 @@ static void finish_writing(struct hash_lock *lock, struct data_vio *agent) lock->duplicate = agent->new_mapped; lock->verified = true; - if (vdo_is_state_compressed(lock->duplicate.state) && - lock->registered) + if (vdo_is_state_compressed(lock->duplicate.state) && lock->registered) { /* * Compression means the location we gave in the UDS query is not the location * we're using to deduplicate. */ lock->update_advice = true; + } /* If there are any waiters, we need to start deduping them. */ if (vdo_waitq_has_waiters(&lock->waiters)) { @@ -2366,7 +2365,7 @@ static void timeout_index_operations_callback(struct vdo_completion *completion) DEDUPE_CONTEXT_TIMED_OUT)) { /* * This context completed between the time the timeout fired, and now. We - * can treat it as a a successful query, its requestor is already enqueued + * can treat it as a successful query, its requestor is already enqueued * to process it. */ continue; From patchwork Sat Jan 27 03:01:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Sakai X-Patchwork-Id: 13533954 X-Patchwork-Delegate: snitzer@redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 B03B1BA55 for ; Sat, 27 Jan 2024 03:01:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706324492; cv=none; b=TwCtgqSi5OqRH53RFI62dHR399jj6N9F5HXUYczzDg/WntQvfyE3s2LKW9GtN+bTte+/Jylw8au388gSI/bKa1LxMxumcGUQlMpctIQe1dLGPTWWjW8UoyJ09nR8JavrhDzjXzUZ6p6aroTw8u0+a6ofPUuAcWNRKGWqrhOCWlk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706324492; c=relaxed/simple; bh=/PuUCahpJAtAbNKOb/I6W/oWNApxUUDQYN2n+8ZU0mU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=egk8x22tXksRkRnrJc4RPRyIN0YRlWwijozE9D6zsrwM9NbF9lJoyIFMu1+XnyCqPj73n3ThDBtLemdJ5orKE3esRlUcGkNgUNVB5OC8Z9v4whr02bb9j1YkTgmikkeWscfh17rL7Dbh4mACGsWbHjzCSv8drk7s2IJQoXZjfn8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=edzwgqj2; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="edzwgqj2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706324489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fsrmcbHnUT+Vw5hTsJoZAuMDGUlVKzY9EmeVmWmBrxI=; b=edzwgqj2pl37tTNjnMAQeNOu+2HJtlfm/eqkRVh6hI3hrwqMnxwa1G6LvRmf259UWiefuM wiMf5wRiBE7vaI6MdXv1MZfyE/XsETe/Bn9wGinazGWGMj08477sNq4Q2bOcc/Sq7zsb27 1LI8ObidlzTLNfjX3szqNotdwn35yos= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-615-RpBBhp7uNPaZstNL0hu8cQ-1; Fri, 26 Jan 2024 22:01:27 -0500 X-MC-Unique: RpBBhp7uNPaZstNL0hu8cQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 911391C04B68; Sat, 27 Jan 2024 03:01:27 +0000 (UTC) Received: from vdo-builder-msakai.permabit.com (vdo-builder-msakai.permabit.lab.eng.bos.redhat.com [10.0.103.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B2AF2166B33; Sat, 27 Jan 2024 03:01:27 +0000 (UTC) Received: by vdo-builder-msakai.permabit.com (Postfix, from userid 1138) id 88E32560E6; Fri, 26 Jan 2024 22:01:27 -0500 (EST) From: Matthew Sakai To: dm-devel@lists.linux.dev Cc: Mike Snitzer , Matthew Sakai Subject: [PATCH 3/3] dm vdo index: fix various small nits Date: Fri, 26 Jan 2024 22:01:27 -0500 Message-ID: In-Reply-To: References: Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com From: Mike Snitzer Add braces around multi-line while loops and if statements. Also remove excess newlines. Signed-off-by: Mike Snitzer Signed-off-by: Chung Chung Signed-off-by: Matthew Sakai --- drivers/md/dm-vdo/index-layout.c | 10 +++++----- drivers/md/dm-vdo/index-page-map.c | 3 +-- drivers/md/dm-vdo/index-session.c | 12 ++++++++---- drivers/md/dm-vdo/index.c | 3 +-- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/md/dm-vdo/index-layout.c b/drivers/md/dm-vdo/index-layout.c index 6446a1f58641..f0511988ea07 100644 --- a/drivers/md/dm-vdo/index-layout.c +++ b/drivers/md/dm-vdo/index-layout.c @@ -386,9 +386,10 @@ static void define_sub_index_nonce(struct index_layout *layout) encode_u64_le(buffer, &offset, sil->sub_index.start_block); encode_u16_le(buffer, &offset, 0); sil->nonce = generate_secondary_nonce(primary_nonce, buffer, sizeof(buffer)); - if (sil->nonce == 0) + if (sil->nonce == 0) { sil->nonce = generate_secondary_nonce(~primary_nonce + 1, buffer, sizeof(buffer)); + } } static void setup_sub_index(struct index_layout *layout, u64 start_block, @@ -651,10 +652,11 @@ static int discard_index_state_data(struct index_layout *layout) saved_result = result; } - if (saved_result != UDS_SUCCESS) + if (saved_result != UDS_SUCCESS) { return uds_log_error_strerror(result, "%s: cannot destroy all index saves", __func__); + } return UDS_SUCCESS; } @@ -1242,9 +1244,7 @@ static int __must_check read_super_block_data(struct buffered_reader *reader, "unknown superblock magic label"); if ((super->version < SUPER_VERSION_MINIMUM) || - (super->version == 4) || - (super->version == 5) || - (super->version == 6) || + (super->version == 4) || (super->version == 5) || (super->version == 6) || (super->version > SUPER_VERSION_MAXIMUM)) { return uds_log_error_strerror(UDS_UNSUPPORTED_VERSION, "unknown superblock version number %u", diff --git a/drivers/md/dm-vdo/index-page-map.c b/drivers/md/dm-vdo/index-page-map.c index 190d12848ba2..acfff74f37bc 100644 --- a/drivers/md/dm-vdo/index-page-map.c +++ b/drivers/md/dm-vdo/index-page-map.c @@ -100,8 +100,7 @@ void uds_get_list_number_bounds(const struct index_page_map *map, u32 chapter_nu u32 slot = chapter_number * map->entries_per_chapter; *lowest_list = ((index_page_number == 0) ? - 0 : - map->entries[slot + index_page_number - 1] + 1); + 0 : map->entries[slot + index_page_number - 1] + 1); *highest_list = ((index_page_number < map->entries_per_chapter) ? map->entries[slot + index_page_number] : map->geometry->delta_lists_per_chapter - 1); diff --git a/drivers/md/dm-vdo/index-session.c b/drivers/md/dm-vdo/index-session.c index 73c2927f74ce..c261453b9871 100644 --- a/drivers/md/dm-vdo/index-session.c +++ b/drivers/md/dm-vdo/index-session.c @@ -392,9 +392,10 @@ int uds_open_index(enum uds_open_index_type open_type, static void wait_for_no_requests_in_progress(struct uds_index_session *index_session) { uds_lock_mutex(&index_session->request_mutex); - while (index_session->request_count > 0) + while (index_session->request_count > 0) { uds_wait_cond(&index_session->request_cond, &index_session->request_mutex); + } uds_unlock_mutex(&index_session->request_mutex); } @@ -619,9 +620,10 @@ int uds_close_index(struct uds_index_session *index_session) /* Wait for any current index state change to complete. */ uds_lock_mutex(&index_session->request_mutex); while ((index_session->state & IS_FLAG_WAITING) || - (index_session->state & IS_FLAG_CLOSING)) + (index_session->state & IS_FLAG_CLOSING)) { uds_wait_cond(&index_session->request_cond, &index_session->request_mutex); + } if (index_session->state & IS_FLAG_SUSPENDED) { uds_log_info("Index session is suspended"); @@ -660,9 +662,10 @@ int uds_destroy_index_session(struct uds_index_session *index_session) /* Wait for any current index state change to complete. */ uds_lock_mutex(&index_session->request_mutex); while ((index_session->state & IS_FLAG_WAITING) || - (index_session->state & IS_FLAG_CLOSING)) + (index_session->state & IS_FLAG_CLOSING)) { uds_wait_cond(&index_session->request_cond, &index_session->request_mutex); + } if (index_session->state & IS_FLAG_DESTROYING) { uds_unlock_mutex(&index_session->request_mutex); @@ -686,9 +689,10 @@ int uds_destroy_index_session(struct uds_index_session *index_session) /* Wait until the load exits before proceeding. */ uds_lock_mutex(&index_session->request_mutex); - while (index_session->state & IS_FLAG_LOADING) + while (index_session->state & IS_FLAG_LOADING) { uds_wait_cond(&index_session->request_cond, &index_session->request_mutex); + } uds_unlock_mutex(&index_session->request_mutex); } diff --git a/drivers/md/dm-vdo/index.c b/drivers/md/dm-vdo/index.c index 28ae54efaced..3d2a673b3f52 100644 --- a/drivers/md/dm-vdo/index.c +++ b/drivers/md/dm-vdo/index.c @@ -1330,8 +1330,7 @@ int uds_save_index(struct uds_index *index) uds_wait_for_idle_index(index); index->prev_save = index->last_save; index->last_save = ((index->newest_virtual_chapter == 0) ? - NO_LAST_SAVE : - index->newest_virtual_chapter - 1); + NO_LAST_SAVE : index->newest_virtual_chapter - 1); uds_log_info("beginning save (vcn %llu)", (unsigned long long) index->last_save); result = uds_save_index_state(index->layout, index);