Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp893963ybk; Sat, 9 May 2020 23:26:50 -0700 (PDT) X-Google-Smtp-Source: APiQypK8u5EqmO+33TtQJmdVDnUe/AWggMQsWAM99KiJVl1Olkr9bqDpv34CnE/k++VLqg6UBkHl X-Received: by 2002:a05:6402:1482:: with SMTP id e2mr8502996edv.113.1589092009914; Sat, 09 May 2020 23:26:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589092009; cv=none; d=google.com; s=arc-20160816; b=iIfVumkFfFHXREZpv30yiK+WwbeczplgXySQhArc8phvVdt9xQ7z94sWvuOkpEJBEo Wu9rC1l1XrqjUOFjsOoUaaM1XhPrtiwXhIqW+s0AnK49nvZinu/1g3ln2iYSD1e2EIk8 lkploh1oX6KMIZ8Rq6byLAMRvnNQRKibEXH9MAl7BxwJJteoh9FJtXm7hY2t7dxSYmhw 7cYEkwACMgTUHNNkE4/WOUx+pwWrQ2lOEBs3PvDsOchTy63ZQm1D0SDyiMspB60cQWfy ke0aaHJLole644XgzWLKWExNb04ZplsNoOwLRd5ae6Y7ajJXOFKoiNQowCYKRKLzcmWb vZew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Y8Mb26lQDN4gOXsOtkjxw0M6IGb5PizHaBEH/Ep1wvI=; b=FBzOVmsByTWw1ySVvd3i5l9WXcuMQax5PmpdznDmY8tUyM+HNdpDnvN7xAaiTVjtnm 5BrFme5PZz/CAWI8Hg+d4+dQO+XCaiU2ARVhJBdmaACsbR14k/RvZ5mDK6zWIIjuD3v0 EdlPfytY465W8QEdkPP4cfrZoQ2cVPgO+03Sy/zZcHooH+xWR07itXW0gmehtt6bRYWJ C5jWpNozD/kvAaErZs6IRKciw+XIRp74ecFzq0ISIlooKxKs0CmvB23TpOsXxvI5CmOs NhsWn967IVLTpKLAFbXc2O3/sWRuuaxVlarHXW+JzC8x09NAr6lQ7agrHYWTfYzBVfmf tXfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si395741eds.22.2020.05.09.23.26.27; Sat, 09 May 2020 23:26:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728238AbgEJGZu (ORCPT + 99 others); Sun, 10 May 2020 02:25:50 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:20568 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727122AbgEJGZt (ORCPT ); Sun, 10 May 2020 02:25:49 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04A62SZx047188; Sun, 10 May 2020 02:25:45 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 30ws22v2pj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 10 May 2020 02:25:44 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 04A6K1hg031689; Sun, 10 May 2020 06:25:42 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma04fra.de.ibm.com with ESMTP id 30wm55gt8e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 10 May 2020 06:25:42 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04A6PdBB40960180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 10 May 2020 06:25:40 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D757842042; Sun, 10 May 2020 06:25:39 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 606284203F; Sun, 10 May 2020 06:25:38 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.199.61.127]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sun, 10 May 2020 06:25:38 +0000 (GMT) From: Ritesh Harjani To: linux-ext4@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, Jan Kara , tytso@mit.edu, "Aneesh Kumar K . V" , Ritesh Harjani Subject: [RFC 11/16] ext4: Use BIT() macro for BH_** state bits Date: Sun, 10 May 2020 11:54:51 +0530 Message-Id: <57667689f51a3f9dba2fcef7d3425187fa3ba69f.1589086800.git.riteshh@linux.ibm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.676 definitions=2020-05-10_01:2020-05-08,2020-05-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 suspectscore=1 bulkscore=0 adultscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005100050 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Simply use BIT() macro for all BH_** state bits instead of open coding it. There should be no functionality change in this patch. Signed-off-by: Ritesh Harjani --- fs/ext4/ext4.h | 8 ++++---- fs/ext4/inode.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 91eb4381cae5..42d7af18157d 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -171,10 +171,10 @@ struct ext4_allocation_request { * well as to store the information returned by ext4_map_blocks(). It * takes less room on the stack than a struct buffer_head. */ -#define EXT4_MAP_NEW (1 << BH_New) -#define EXT4_MAP_MAPPED (1 << BH_Mapped) -#define EXT4_MAP_UNWRITTEN (1 << BH_Unwritten) -#define EXT4_MAP_BOUNDARY (1 << BH_Boundary) +#define EXT4_MAP_NEW BIT(BH_New) +#define EXT4_MAP_MAPPED BIT(BH_Mapped) +#define EXT4_MAP_UNWRITTEN BIT(BH_Unwritten) +#define EXT4_MAP_BOUNDARY BIT(BH_Boundary) #define EXT4_MAP_FLAGS (EXT4_MAP_NEW | EXT4_MAP_MAPPED |\ EXT4_MAP_UNWRITTEN | EXT4_MAP_BOUNDARY) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 2a4aae6acdcb..e294abeb7f03 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2078,7 +2078,7 @@ static int mpage_submit_page(struct mpage_da_data *mpd, struct page *page) return err; } -#define BH_FLAGS ((1 << BH_Unwritten) | (1 << BH_Delay)) +#define BH_FLAGS (BIT(BH_Unwritten) | BIT(BH_Delay)) /* * mballoc gives us at most this number of blocks... @@ -2358,7 +2358,7 @@ static int mpage_map_one_extent(handle_t *handle, struct mpage_da_data *mpd) dioread_nolock = ext4_should_dioread_nolock(inode); if (dioread_nolock) get_blocks_flags |= EXT4_GET_BLOCKS_IO_CREATE_EXT; - if (map->m_flags & (1 << BH_Delay)) + if (map->m_flags & BIT(BH_Delay)) get_blocks_flags |= EXT4_GET_BLOCKS_DELALLOC_RESERVE; err = ext4_map_blocks(handle, inode, map, get_blocks_flags); -- 2.21.0