Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp350389ybz; Thu, 30 Apr 2020 23:31:23 -0700 (PDT) X-Google-Smtp-Source: APiQypJ6R/h7Bn/9bj6njvuPeTO39zFXhXvXaV9D+4Y5hMQQRwXHUrTPxQvmQjQ4WdBxYLbwEGk/ X-Received: by 2002:a50:9a04:: with SMTP id o4mr2132268edb.289.1588314683665; Thu, 30 Apr 2020 23:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588314683; cv=none; d=google.com; s=arc-20160816; b=u/9Lo2OBRrQAqKcSQEj15KEQ5vky3WDgiPt68TkDNnUzkAIsSboJQTmjOxgj87s/Od xFjOjiSb8yqzoSPdE6X1z96Aun5+7TNV2x96YOaf2uxIFycAxKJ4keYy/bf3hVWmyu31 D3b3KhIe8L/23R2aEoIIkduVgA7Pcjm0MaoaE19naOnmq3vg3JyHri/br825zssYjM3K OSoE48aseSelZ+vzkWKjqOfoifFFSuQ1Gv1A3KP86li9d1o/Qxvub2JNudQhG+twCVs8 aixkjqy2NmQyjnuAA3Ui8YWftTc8fFq/wRaxu9z1E6/AXbJODKZ5JVeFZZ90iYfAi4X5 Hldw== 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=HntEZ7kJeJhbegRYWcnighqLVytpV24iTab+nNCyHkA=; b=tHpaK1J1Q7b4D0Je7LHvKMYVj166P/MeTtMJnOSSInS48BsEKEEJSObHbbQe+TyU7J 4tHVEFIc8YeL6oS4T4YPZTqkFT76asVUQbqsdugaT7Gej93iHgX+pCB6rbtHWa9ukdom MqNUN0jeyyZMq5GRkU+iwEUQ1fCXB15oXiUjK3bZyw3hxkbOtEpEl6Zctr2Y0LVCON/9 Jp6Ya70yJgi0md5LX2UCaXUSo8aJaPJ9FWfCsEbVqwKPHhJHbhmwTm4crwpWpDw5KGEF YfstCQr7Y6IO87yVDDVdLNGPHh66xzgGcOtc9Xf23L/xVOlWfQ3pU+z+htBrSaWsfOHk WjMw== 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 a17si1226583ejx.485.2020.04.30.23.31.00; Thu, 30 Apr 2020 23:31:23 -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 S1728315AbgEAGai (ORCPT + 99 others); Fri, 1 May 2020 02:30:38 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:29360 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728126AbgEAGai (ORCPT ); Fri, 1 May 2020 02:30:38 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04161qsQ090331; Fri, 1 May 2020 02:30:32 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 30r821rngq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 01 May 2020 02:30:31 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 0416AqOB009353; Fri, 1 May 2020 06:30:30 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma04ams.nl.ibm.com with ESMTP id 30mcu746rk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 01 May 2020 06:30:29 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0416TIRE57540954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 1 May 2020 06:29:18 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 15406A4060; Fri, 1 May 2020 06:30:27 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 77489A405C; Fri, 1 May 2020 06:30:25 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.85.81.13]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 1 May 2020 06:30:25 +0000 (GMT) From: Ritesh Harjani To: linux-ext4@vger.kernel.org Cc: "Paul E . McKenney" , linux-fsdevel@vger.kernel.org, Jan Kara , tytso@mit.edu, "Aneesh Kumar K . V" , Ritesh Harjani Subject: [RFC 09/20] ext4: mballoc: Make ext4_mb_use_preallocated() return type as bool Date: Fri, 1 May 2020 11:59:51 +0530 Message-Id: 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.138,18.0.676 definitions=2020-05-01_01:2020-04-30,2020-05-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 mlxscore=0 malwarescore=0 suspectscore=1 bulkscore=0 adultscore=0 priorityscore=1501 mlxlogscore=904 spamscore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005010040 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Change return type of function ext4_mb_use_preallocated() to bool to better reflect what this function can return. There should be no functionality change in this patch. Signed-off-by: Ritesh Harjani --- fs/ext4/mballoc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 10f295c61ccb..6e7232fd109e 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3461,7 +3461,7 @@ ext4_mb_check_group_pa(ext4_fsblk_t goal_block, /* * search goal blocks in preallocated space */ -static noinline_for_stack int +static noinline_for_stack bool ext4_mb_use_preallocated(struct ext4_allocation_context *ac) { struct ext4_sb_info *sbi = EXT4_SB(ac->ac_sb); @@ -3473,7 +3473,7 @@ ext4_mb_use_preallocated(struct ext4_allocation_context *ac) /* only data can be preallocated */ if (!(ac->ac_flags & EXT4_MB_HINT_DATA)) - return 0; + return false; /* first, try per-file preallocation */ rcu_read_lock(); @@ -3500,7 +3500,7 @@ ext4_mb_use_preallocated(struct ext4_allocation_context *ac) spin_unlock(&pa->pa_lock); ac->ac_criteria = 10; rcu_read_unlock(); - return 1; + return true; } spin_unlock(&pa->pa_lock); } @@ -3508,12 +3508,12 @@ ext4_mb_use_preallocated(struct ext4_allocation_context *ac) /* can we use group allocation? */ if (!(ac->ac_flags & EXT4_MB_HINT_GROUP_ALLOC)) - return 0; + return false; /* inode may have no locality group for some reason */ lg = ac->ac_lg; if (lg == NULL) - return 0; + return false; order = fls(ac->ac_o_ex.fe_len) - 1; if (order > PREALLOC_TB_SIZE - 1) /* The max size of hash table is PREALLOC_TB_SIZE */ @@ -3542,9 +3542,9 @@ ext4_mb_use_preallocated(struct ext4_allocation_context *ac) if (cpa) { ext4_mb_use_group_pa(ac, cpa); ac->ac_criteria = 20; - return 1; + return true; } - return 0; + return false; } /* -- 2.21.0