Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1333382 > unrolled thread

[PATCH] logfs: remove redundant check on block->alias_map

Started byColin King <colin.king@canonical.com>
First post2016-02-14 00:20 +0100
Last post2016-02-14 00:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] logfs: remove redundant check on block->alias_map Colin King <colin.king@canonical.com> - 2016-02-14 00:20 +0100

#1333382 — [PATCH] logfs: remove redundant check on block->alias_map

FromColin King <colin.king@canonical.com>
Date2016-02-14 00:20 +0100
Subject[PATCH] logfs: remove redundant check on block->alias_map
Message-ID<r1RDQ-2Yz-7@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

alias_map is an unsigned long array, hence a null check on this
array is superfluous and can be removed.

Detected with static analysis by smatch:

fs/logfs/readwrite.c:1282 fill_shadow_tree() warn: this array
  is probably non-NULL. 'block->alias_map'

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 fs/logfs/readwrite.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/logfs/readwrite.c b/fs/logfs/readwrite.c
index 20973c9..1fb9658 100644
--- a/fs/logfs/readwrite.c
+++ b/fs/logfs/readwrite.c
@@ -1279,9 +1279,8 @@ static void fill_shadow_tree(struct inode *inode, struct page *page,
 	struct shadow_tree *tree = &super->s_shadow_tree;
 
 	if (PagePrivate(page)) {
-		if (block->alias_map)
-			super->s_no_object_aliases -= bitmap_weight(
-					block->alias_map, LOGFS_BLOCK_FACTOR);
+		super->s_no_object_aliases -= bitmap_weight(
+				block->alias_map, LOGFS_BLOCK_FACTOR);
 		logfs_handle_transaction(inode, block->ta);
 		block->ops->free_block(inode->i_sb, block);
 	}
-- 
2.7.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web