From patchwork Tue Jul 19 10:01:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12922363 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aib29ajc249.phx1.oracleemaildelivery.com (aib29ajc249.phx1.oracleemaildelivery.com [192.29.103.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F02AAC43334 for ; Tue, 19 Jul 2022 10:01:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=GtI+CtfVoxRnzpiL0nr2Z9pB4pyesxeppogIXmoY/ck=; b=dB4Dsrgmr0NXl+u6AK8y3Fmy+lJrrY7CtulVIjoEa2Ntel0g4bt20R6EppS9UdrE1RI4I92IMI0f NxZxwe9bdTaYj/Ya67XWl1qjqCYcM4A45k1eQ2IaVKrD5tS2DrzIQOTkOX4hCZ3ztK8+yT7DCNHN rvvlDmjqseg77Uvxt/HjxDOjt5U2ic2NhWXIsVyLjRhWJPmwHg6CyycDSmgPolTGJz5NjJPCrAiG kaQjBexIWGRY3CbnZEtGnL5RWqtprA/s6zZW145OVkckcKBJAmsRZslqB6U2+BlrcjTPDPjUONoo IHWQvq1qdFiSpSV2ytV1lxgi03DIKAk1VjysDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=GtI+CtfVoxRnzpiL0nr2Z9pB4pyesxeppogIXmoY/ck=; b=pUJLjZHcoOfcimE5LCSWxOOFS/yLqz5k47Ggv/snvN86rjpwsebUwE+W5SfA0K+nUFt82RKtuua9 j5yoOMCO+ONEPCIlw+Cw0WApxrsZnI1F2hj2dsVclnc7IVzAFTeftyMCx+NP327G4RZWPQFz/6Ye r2fRm8VhuQaSmf+aBwx4ELLPwdYaY/GLlym5pAFdxEimHzxmDa49g3GPEDT2uOImUeEbk5oTgaLX tWho2/1VpCq7EvqdQglFycUZ7OyNwmupyjiTXu9P5Z280JMtBPml5lQHXfw8Zn5pgmcqFMlMTVz7 /F4Yr/FaAe21+0geRnR4TKMSP7IS0aCape+FlQ== Received: by omta-ad2-fd1-202-us-phoenix-1.omtaad2.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20220603 64bit (built Jun 3 2022)) with ESMTPS id <0RF900DHTIIWWVE0@omta-ad2-fd1-202-us-phoenix-1.omtaad2.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Tue, 19 Jul 2022 10:01:44 +0000 (GMT) To: Mark Fasheh , Joel Becker , Joseph Qi Date: Tue, 19 Jul 2022 12:01:23 +0200 Message-id: X-Mailer: git-send-email 2.34.1 MIME-version: 1.0 X-Source-IP: 80.12.242.123 X-Proofpoint-Virus-Version: vendor=nai engine=6400 definitions=10412 signatures=596000 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 lowpriorityscore=0 phishscore=0 suspectscore=0 clxscore=-17 spamscore=0 malwarescore=0 mlxscore=0 priorityscore=1501 mlxlogscore=912 adultscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207190042 Cc: Christophe JAILLET , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: [Ocfs2-devel] [PATCH 1/3] ocfs2: Remove some useless functions X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christophe JAILLET via Ocfs2-devel Reply-to: Christophe JAILLET Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Tue, 19 Jul 2022 12:01:30 +0200 X-ME-IP: 90.11.190.129 X-ServerName: smtp01.smtpout.orange.fr X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 include:_spf_gp.wanadoo.fr include:spf.email-control.orange-business.com include:_spf_gpf.wanadoo.fr include:_spf_other.wanadoo.fr ?all X-Spam: Clean X-Proofpoint-GUID: rw1ebNm7UHt0gLBtvRuZl8h2Uk-OK8QF X-Proofpoint-ORIG-GUID: rw1ebNm7UHt0gLBtvRuZl8h2Uk-OK8QF Reporting-Meta: AAGxPZM9DhEFXfkZ7eLzKSIBac9lZlo6hp9ggdhG+uhysMRHJ3+so45jBC4Bn97h RHjCxvk00w98GfefB7z+4aWg5a8Sm5McFU5/KAXiWX4VpQdrd6uhoMgym9CcteyM g7pWEjdf6C2tAuQw0bgQC4Y8dFAn8QGTMIY0CfLpEP51ZJo4yx05G2WilFoK//1w znU//BAmryaVTslq+nvUyn3TK0XLxaw//bX1fyqyl7LtGl/4LWbJtGLX3hpOE+9S PMj6Y1l3mZ0VyFWDdCcvH94cJtfkQMQ7Yf3SHbZq7ksHXpLfXHM30Dx8vXDU4uhh 35cerot5l/ADlmd9IHGFfBR0gEMOKohdLnNnKyzV3PK95u+B0Vxq3uyUO877QfPi NwocLduodOdVJC36xynXScEGNqeaIlC3P9tdRF4SnVJCMlSoKMAadltSXmSWI4ce 4LaKW2vzVL/v/xyAaMboLppLW/NznQC9z6VJ1hQOHeC+8FWYG7tSm5EhAPD8tA6E sTnVzgbM9zEghtabOLCrLZ4X86XoGWp/w8850jHnY6V1 __ocfs2_node_map_set_bit() and __ocfs2_node_map_set_bit() are just wrapper around set_bit() and clear_bit(). The leading __ also makes think that these functions are non-atomic just like __set_bit() and __clear_bit(). So, just remove these wrappers and call set_bit() and clear_bit() directly. Signed-off-by: Christophe JAILLET Reviewed-by: Joseph Qi --- fs/ocfs2/heartbeat.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/fs/ocfs2/heartbeat.c b/fs/ocfs2/heartbeat.c index 9099d8fc7599..1d72e0788943 100644 --- a/fs/ocfs2/heartbeat.c +++ b/fs/ocfs2/heartbeat.c @@ -24,11 +24,6 @@ #include "buffer_head_io.h" -static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map, - int bit); -static inline void __ocfs2_node_map_clear_bit(struct ocfs2_node_map *map, - int bit); - /* special case -1 for now * TODO: should *really* make sure the calling func never passes -1!! */ static void ocfs2_node_map_init(struct ocfs2_node_map *map) @@ -65,12 +60,6 @@ void ocfs2_do_node_down(int node_num, void *data) ocfs2_recovery_thread(osb, node_num); } -static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map, - int bit) -{ - set_bit(bit, map->map); -} - void ocfs2_node_map_set_bit(struct ocfs2_super *osb, struct ocfs2_node_map *map, int bit) @@ -79,16 +68,10 @@ void ocfs2_node_map_set_bit(struct ocfs2_super *osb, return; BUG_ON(bit >= map->num_nodes); spin_lock(&osb->node_map_lock); - __ocfs2_node_map_set_bit(map, bit); + set_bit(bit, map->map); spin_unlock(&osb->node_map_lock); } -static inline void __ocfs2_node_map_clear_bit(struct ocfs2_node_map *map, - int bit) -{ - clear_bit(bit, map->map); -} - void ocfs2_node_map_clear_bit(struct ocfs2_super *osb, struct ocfs2_node_map *map, int bit) @@ -97,7 +80,7 @@ void ocfs2_node_map_clear_bit(struct ocfs2_super *osb, return; BUG_ON(bit >= map->num_nodes); spin_lock(&osb->node_map_lock); - __ocfs2_node_map_clear_bit(map, bit); + clear_bit(bit, map->map); spin_unlock(&osb->node_map_lock); } From patchwork Tue Jul 19 10:01:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12922364 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aib29ajc247.phx1.oracleemaildelivery.com (aib29ajc247.phx1.oracleemaildelivery.com [192.29.103.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96DC5C43334 for ; Tue, 19 Jul 2022 10:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=VVu3kpPKsbQX49bv9q72UuOqrQ4J3QIPEsQHxc9amZ4=; b=FDI4ZO1kSoabEFsl6bsvHVGegH4V8PSUO3rLwZ9n1NgCHQTnBT+/jz+WFbFfjxXtbxpIqKRSFRYa ww0MulWrN/bgz6vZOWAFA5FDdxvqajWLDuX7CxccITJpd07NAxg5Znwcax1K6PNcHYPtFk6TA9Ec JUAgYvYD1TbqSDvH/DaisTbIK4WwGotatZ9iAlh9pT+NipC+keTLGCZXDyyxjTAw/CZ63NmIQsZ9 z9VBIwv3cZHL6h6F+Zr7Ddvuc5iC+E9OQmt3/HhP1AdXz04oGh78sTGRGqy6CduSCPn06Qgd/iox Y0rRHEFPTbwfcV33qQH0DOJqaMCvJhNPbT2uVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=VVu3kpPKsbQX49bv9q72UuOqrQ4J3QIPEsQHxc9amZ4=; b=qdYWYJpat34r5NwI4Kd4RizHjzCLvG1hWM24ITpB4M7VUgcqC1X3RoziXl7VmkP89+V7fs7IfjeM 9Z/jNo69EKbOq5AS/D3XT4frDb1sU2ndyMyzCe2E96bmzHCngXwiDzMbH2BHk01L5IvQlQeu2A7B fKKmPIn85Sze4qkUHonsREj+3oqlwhsI78Uc1uN3K8I9QaXucYolPHmVTIoYNtsyYaTYXYqPASNA cD0hjYEad7B1ca+qs4nOryHpDdhvZR2cnKMgQ3xwSlDGTR5fb4CxLpr9fOkC4zJaGjvusSN8fwj3 DzipEtBlhKkck3MAD9GpEN+qm1TpzqEaD1J+Rw== Received: by omta-ad1-fd3-102-us-phoenix-1.omtaad1.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20220603 64bit (built Jun 3 2022)) with ESMTPS id <0RF900ALMIJCGUC0@omta-ad1-fd3-102-us-phoenix-1.omtaad1.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Tue, 19 Jul 2022 10:02:00 +0000 (GMT) To: Mark Fasheh , Joel Becker , Joseph Qi Date: Tue, 19 Jul 2022 12:01:35 +0200 Message-id: <8ba7004d330cbe5f626539a8a3bff696d0c4285e.1658224839.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-reply-to: References: MIME-version: 1.0 X-Source-IP: 80.12.242.127 X-Proofpoint-Virus-Version: vendor=nai engine=6400 definitions=10412 signatures=596000 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 suspectscore=0 clxscore=67 priorityscore=130 adultscore=0 spamscore=0 mlxscore=0 phishscore=0 bulkscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207190042 Cc: Christophe JAILLET , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: [Ocfs2-devel] [PATCH 2/3] ocfs2: Remove a useless spinlock X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christophe JAILLET via Ocfs2-devel Reply-to: Christophe JAILLET Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Tue, 19 Jul 2022 12:01:41 +0200 X-ME-IP: 90.11.190.129 X-ServerName: smtp05.smtpout.orange.fr X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 include:_spf_gp.wanadoo.fr include:spf.email-control.orange-business.com include:_spf_gpf.wanadoo.fr include:_spf_other.wanadoo.fr ?all X-Spam: Clean X-Proofpoint-GUID: yZ5LdisZ9t0vESCbcm8fd9wsv5Sd1vhr X-Proofpoint-ORIG-GUID: yZ5LdisZ9t0vESCbcm8fd9wsv5Sd1vhr Reporting-Meta: AAGewpPhsvrLEyvnaBUgbmOl6tnu1RDbRmy8von/JC/yZwwFPi9zDnbMr5mneUqS 9ggpN5at9DFxIJpy/qPsNE2ds3T6Q1w5xCnlWQE8vZxrbRYVUcOCgaACEGT5ZD+N MEqaSKc1RdydTCGtf1Q76y+EY6VKeN74mcXsmJ9J54igb3OP+ig++6xFcY/CdaA8 A6L/ZJWWsCPVWsqK2NjTMjOOyBAaz8H17VolkpnBWnIdQBoWnSfHgy/3yw37PV4b SE8ykq0x0y/c0vzzkKZN71pw1WqBvTJx6dYc0o8zShItbyNs0yl+Vj+hQJx/E2f5 gxNKtrkGKK6hQhMklznfJR6cfey+9z3RHsNI2ihOVWlHzbO85HY2WvR6wbFJMe7j IW5MIy0vuGm688gRfdA9HUTJaxING+3myU3dSw1cYJbjxjGJuUlcsTcssmiF11SH ePyv3bXNuc0Je6giqxu3QmzoKRgYSyzryiddffA6bYH6pP/biKcYKS0VRYdPdXc2 23npu2w6fi9RP7ENWHiwNRhk0C1EbK+olyCVRFgOr5l9 'node_map_lock' is a spinlock only used to protect calls to set_bit(), clear_bit() and test_bit(). {set|clear}_bit() are already atomic and don't need this extra spinlock. test_bit() only reads the bitmap for a given bit. Remove this useless spinlock. Signed-off-by: Christophe JAILLET --- test_bit() is NOT documented as an atomic function. However, I can't see how it could return a wrong result here. So review with care. There is maybe something I don't think about that is lurking here. --- fs/ocfs2/heartbeat.c | 11 ++++------- fs/ocfs2/ocfs2.h | 2 -- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/fs/ocfs2/heartbeat.c b/fs/ocfs2/heartbeat.c index 1d72e0788943..4863ad35c242 100644 --- a/fs/ocfs2/heartbeat.c +++ b/fs/ocfs2/heartbeat.c @@ -35,7 +35,6 @@ static void ocfs2_node_map_init(struct ocfs2_node_map *map) void ocfs2_init_node_maps(struct ocfs2_super *osb) { - spin_lock_init(&osb->node_map_lock); ocfs2_node_map_init(&osb->osb_recovering_orphan_dirs); } @@ -67,9 +66,8 @@ void ocfs2_node_map_set_bit(struct ocfs2_super *osb, if (bit==-1) return; BUG_ON(bit >= map->num_nodes); - spin_lock(&osb->node_map_lock); + set_bit(bit, map->map); - spin_unlock(&osb->node_map_lock); } void ocfs2_node_map_clear_bit(struct ocfs2_super *osb, @@ -79,9 +77,8 @@ void ocfs2_node_map_clear_bit(struct ocfs2_super *osb, if (bit==-1) return; BUG_ON(bit >= map->num_nodes); - spin_lock(&osb->node_map_lock); + clear_bit(bit, map->map); - spin_unlock(&osb->node_map_lock); } int ocfs2_node_map_test_bit(struct ocfs2_super *osb, @@ -89,13 +86,13 @@ int ocfs2_node_map_test_bit(struct ocfs2_super *osb, int bit) { int ret; + if (bit >= map->num_nodes) { mlog(ML_ERROR, "bit=%d map->num_nodes=%d\n", bit, map->num_nodes); BUG(); } - spin_lock(&osb->node_map_lock); + ret = test_bit(bit, map->map); - spin_unlock(&osb->node_map_lock); return ret; } diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index 740b64238312..1df193b97c30 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h @@ -302,8 +302,6 @@ struct ocfs2_super u32 *slot_recovery_generations; - spinlock_t node_map_lock; - u64 root_blkno; u64 system_dir_blkno; u64 bitmap_blkno; From patchwork Tue Jul 19 10:05:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12922375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aib29ajc246.phx1.oracleemaildelivery.com (aib29ajc246.phx1.oracleemaildelivery.com [192.29.103.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E9623C43334 for ; Tue, 19 Jul 2022 10:05:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=5f/abykBqaGM4z868IVOaKa3K0p8keygIC9v51yGTGA=; b=OCo+WTjXm4VdyQzC9i5W3T/xGKSTWsXUyRNyuSQzcXpMSPNRwzB6Jx/iS98P6yOMxee+qnhKCVUm cPryxAvYrkLH2Xmz0hoe2isaP1CO+DZuk5nBT21h4+3Xq7XDbRa7n886fg/j7A3dhbe83CyyNBNl 3jb8Gcxvqqxa76NoksggNYbWd118kNV5DuUQUhGfNt6EUMeD29644pNEpOsVqrwsaVWqMXn9QT// mbwUgnzIoYfxJXBNabOAhaLjtjC4uqKeKW+sjVWj0rofhXh9hyYB/0KO6ZdX7PFLMFfjZaETcHhb 3fS1o4WQTtHRb22IFamvRDPUG1N7l50gXVYT0w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=5f/abykBqaGM4z868IVOaKa3K0p8keygIC9v51yGTGA=; b=VwgwFwqdA4AqA70LgCDUANMqJJbwE79/JVlSOEas+RLwO8U+nA/6FhnvQz1SQE2ptsO9zLLPyWwp tOogeKffgHZ9D8de4s0HUFwA1Q/rPariQlR/gNrtiR9rUPTgi8yX9xa1O60jhK1G54Q8tAnDx0zj B7oYoFXjqtqNbDlxhoQinYobBJ9mZUEpvCev9VICBX8aSlRxBxxQ/Sa9Qg7MGvC6xRweXR0WYzE2 DLFudx9U0GBz//7BWc/GirsYq8DJ1IrZ2aBYKXtkHwHBkRCkbqR9uhergPruiIEFbx5gp6dPlxYa wRB2C94aLgwW6P3Es8ph7w6qAa6toUTCYDdM5A== Received: by omta-ad1-fd3-101-us-phoenix-1.omtaad1.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20220603 64bit (built Jun 3 2022)) with ESMTPS id <0RF900OVKIPTH180@omta-ad1-fd3-101-us-phoenix-1.omtaad1.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Tue, 19 Jul 2022 10:05:53 +0000 (GMT) To: Mark Fasheh , Joel Becker , Joseph Qi Date: Tue, 19 Jul 2022 12:05:33 +0200 Message-id: <0a0d6e9bf9d10f67b7a0c1cdd6176cdd0ad2e1f6.1658224839.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-reply-to: References: MIME-version: 1.0 X-Source-IP: 80.12.242.129 X-Proofpoint-Virus-Version: vendor=nai engine=6400 definitions=10412 signatures=596000 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 clxscore=63 bulkscore=0 phishscore=0 adultscore=0 lowpriorityscore=0 mlxscore=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=784 impostorscore=0 priorityscore=182 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207190042 Cc: Christophe JAILLET , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: [Ocfs2-devel] [PATCH 3/3] ocfs2: use the bitmap API to simplify code X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christophe JAILLET via Ocfs2-devel Reply-to: Christophe JAILLET Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Tue, 19 Jul 2022 12:05:39 +0200 X-ME-IP: 90.11.190.129 X-ServerName: smtp07.smtpout.orange.fr X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 include:_spf_gp.wanadoo.fr include:spf.email-control.orange-business.com include:_spf_gpf.wanadoo.fr include:_spf_other.wanadoo.fr ?all X-Spam: Clean X-Proofpoint-GUID: ZtkweJmqL0JJ4NgBzdCM1Lcz3QRRA_sk X-Proofpoint-ORIG-GUID: ZtkweJmqL0JJ4NgBzdCM1Lcz3QRRA_sk Reporting-Meta: AAElCfINdpFDwwDimMFr9PMpBv2hoxM2q0aqOkEAeW/QzfAN40TyNWhd3iw5F8gL +v1yg4Nniyk29hiQ4k+h/55UGTD5F2XGX5TUA2VHGQLSD+cg5tyNGS9Kz5sGGiJE /mlVcmpTFDCUDSgj5sB7pr7BA7Y7rusO/VaVlU5Jag9F0iMoPyLvEh77SeNGvjS6 1ru9eyr4YGy08tI2/wFKCFitbZmLad5JkSPIDc/MWP3y+7pgZCWWoGncYLqMhASu TCcL3Rv/xdRPaNm0RpOTvbk2x+Tk9KDjpbMuaIsG3Pq4BlSqEUgX1Uh//vWcO4Ix fhyFgm1zPLaSHJ8Ay+ksr9G51KkrO2PnNyJp+Nf8QFwOG4qco7mNAA8rHKPXZlTp eVCNwb5TFK3pmTwPFroDoJ23+6sQq0SruU+CBVQy6SAA6dpsx1A+GjkMmZmfp8K3 u00MhB2yP0WdtLA9K0Nb8DkUs3PEStAY3dlMKfrq5hIi9v0sOeDRvJMUHf4uTNyy fAJ65Vj62es2fjdnRXhjAasz6QEkwJKf2ijtRagzo7s= Use bitmap_zero() instead of hand-writing it. It is less verbose. While at it, add an explicit #include . Signed-off-by: Christophe JAILLET Reviewed-by: Joseph Qi --- fs/ocfs2/heartbeat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/heartbeat.c b/fs/ocfs2/heartbeat.c index 4863ad35c242..e243cd99e63f 100644 --- a/fs/ocfs2/heartbeat.c +++ b/fs/ocfs2/heartbeat.c @@ -8,6 +8,7 @@ * Copyright (C) 2002, 2004 Oracle. All rights reserved. */ +#include #include #include #include @@ -29,8 +30,7 @@ static void ocfs2_node_map_init(struct ocfs2_node_map *map) { map->num_nodes = OCFS2_NODE_MAP_MAX_NODES; - memset(map->map, 0, BITS_TO_LONGS(OCFS2_NODE_MAP_MAX_NODES) * - sizeof(unsigned long)); + bitmap_zero(map->map, OCFS2_NODE_MAP_MAX_NODES); } void ocfs2_init_node_maps(struct ocfs2_super *osb)