From patchwork Tue May 21 17:11:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13669569 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (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 0BE89147C94 for ; Tue, 21 May 2024 17:12:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716311557; cv=fail; b=OsrKjjeH1b5aTYgazPL9XvEhMXKcROPej6lWrcdgKLUSuWPQBu+AXymP0V9lEl07VLb45Bxo9rhQEy4UCBJl1UIE6jqXTKyw31tSYh/zZ33Tp+rL6un3Hrr/vPOCmBNS2M0vslB6yQEu3ZZCpGGh0XJ8A4ByLREAd+Zp4m9T0MY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716311557; c=relaxed/simple; bh=FuTZ4U3hwEiJeVXW+XIwgSqtsMCxu5k2v8eGoblYDX8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=mH8ZPDOmg5aOktAqSOS7bkrZbqPi3KyZmF5gMBBdTXyvRc4U776DfiVl/VZlnYTnXQ82HA6vk6ezMcRzNkRDkf547sDlycf+gwW8+obpFsJvvmVvDf51dENODCoa19khTyzbfm8LH1SyGI9uJ3ERdZJ9m+0ow8FobgMSDF0N7ZQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=Ac3OecG9; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=N5qBqp7E; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Ac3OecG9"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="N5qBqp7E" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44LGwlGc032747 for ; Tue, 21 May 2024 17:12:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=c5txp9LDqqzxLmjyy2vkMK5Qa0XUF1EfKoacBx6IxZI=; b=Ac3OecG9Axxvxie4ymQWJJS1iFIZtgxslW4JbFtbBZBg5TPbMMJx/EAR4L7H3Btt83Aa z3si6pG5klTOdNZHe38f55QbsQ9TedvH2+N3FuaTmrHb17XeP6WUL6fbMRTA55Z3+8l0 CnmVVeFqgmP3McfS+LWOrY9QIrvbviD4yWWD0q2iGXw3I11TYTHD09WgDdGRNzLOxpJo /rLu18gre+kjWbgeKb1/J+5cgr2LNc803NRzCKL9Ud9RrD9pjJV7NHZG56GrOzBKDBX8 FU/i293/tQ5QC+oxvQZBj4HaMl1R1fIeTsSlvKSBgE/kxgmkMVaPVKwIn5vt1Vf3rGZ7 ig== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y6k465y7s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 21 May 2024 17:12:34 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 44LHBB7C005160 for ; Tue, 21 May 2024 17:12:33 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2040.outbound.protection.outlook.com [104.47.57.40]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3y6js88sbj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 21 May 2024 17:12:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dOPCNIWLCGv6NivBAgsHRREKXVtvoFBIFNd9OVXrxy6k5iqJicGP3nkhnDUkkd0JuOoOrk5tfF/qIvwqyW28lECNsVcdPhyqGybM00k3uMv8EQ/5eJwZ8J0ARjZizzWCtnCJb59cVSJ724AQgNVxMd/bHWSXHNIptqpF/W0irGnI5oSnz2KYLSSSQSMAVuaHVh8ptVaf276WQhBDLyPUKhn3YPz0Or3XtSegGBQ8Q/CyP+zUFSTHG6H2d+ka1AjQQWbJVOmhNLG8A26o09Lgiewg2jTsRzJtuFeet7ac/TgmbQdDZ8tNq1PVvK/2qAAtZOjPnE4ZcWlsAG1mFmnBSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=c5txp9LDqqzxLmjyy2vkMK5Qa0XUF1EfKoacBx6IxZI=; b=ZOPCAnteltkNMusD9Xw//p+Phqmuw5YvXdas0562qxDDr/ZM6sCvFR/5D+LT6f/GlJQVKO2aky91XhGPJyaRkWBmBOsjGnY6+QsOY3uoYa59V0q4zG5H0mJJjw1og7tjMCv0R8zbB4p0cuuvQGOkw8iTTdiufTWamJNyCMbKZycY/8gmqdKai6fKfSalXF6R4xWW6LKdnyJoLs66HC7+LQHBl8UUmZX7elYqrINuONdqNjbJYC6mrGP8JBCivbJwhZDTSsm5MDkEl4NMpnEDn5aSwcpJnKQFkbpHW1KL5qRkt9zgFus3XJf5Ip8qhp8ZM3u1byBvK/Z53/1guNDuWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c5txp9LDqqzxLmjyy2vkMK5Qa0XUF1EfKoacBx6IxZI=; b=N5qBqp7ESKzoBFXlE68qILOpFzWv92eERuEYg489YIGydC2aPAv80Qs55WIHpmTeKXE3K1havOCj5WCfjskFlAPoS0TufMbXhd2Tbb5ldH7mlghjTtI4tCsJEqUCf7JPYe0bkzkUjQ7snp8qTiSGJ3phFUxzHnU5/dBv6SC3wcQ= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by MN6PR10MB7520.namprd10.prod.outlook.com (2603:10b6:208:478::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Tue, 21 May 2024 17:12:31 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65%6]) with mapi id 15.20.7587.028; Tue, 21 May 2024 17:12:31 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH v4 1/6] btrfs: rename err to ret in btrfs_cleanup_fs_roots() Date: Wed, 22 May 2024 01:11:07 +0800 Message-ID: <4bf4e740ff9197b8bdfefbf30ba2eb26c45dbcb0.1716310365.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: X-ClientProxiedBy: SG2PR01CA0141.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::21) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|MN6PR10MB7520:EE_ X-MS-Office365-Filtering-Correlation-Id: efeacbe6-0cf4-42fa-e3de-08dc79b93328 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: 6pEf90l8MEbFXLdv2WWv9HEhGNoZlwG4paO8C2sYa3d8cm0/i4S9x6D+4NBzTmcBEZTzHbEm+3td9u/mKg2N1UAfJRgW3Bd3Nbli8drba7LPKnEQTvx6qG4m2WMQy/sPHpjxqHimCrZv+TCmgaMt/9iCZXvAvFZ7aI8+XKK+0rqC0lwaROI/rLF/2Phv+pg1/Qp7nTo3Min1imtWOS0LlQYNDKoBUaeb4K1RGpYMStwIh/Ga+SC7BFZRSY5QUhW9qRTZNU2whLsLCsn1LEa/eOKG3XrNlsCQVqNJqwUJx/kiWXXkqemPvEcyJVG/9UHecZrS7Rq/RyEEIcQdwrROGTCgLjfmXWRPn5YQoXRFDdaI3o/2csKkdum2wjDgIQbl0CcGlxev44abl8GKXZQzeVdUdFJnntfRnV0dyPuSXRyXIX0WjJ64qjAw85RIs02lq19tNHyTr/aHeCyElM4XkxM4RpkkVE4F0IoxM6KJu730eDzsGzqO4xuHnDUz2iRTS3ZKwYGR6JL+wpEeP7K5lb7JFzzfCfCNhMo+PWKeIx7alOfthUcnE8Bnjo4+g4yiRv6Y8SOu9gmuEffC4ZIYysOQAtFkIygAYxXB0r7rrPE0VmiW52Vknw6ybsSlcTtBjYC/AtXMIj5BQo3DGPPgj3FCzxPxVLeqGrRnkqBnfww8A+KC5OpfI0x+/XHvd4fUxD0Hgq35q+gdiMAFGB1T4wnK9myun2aRCS3vmQDR+fgHIIQjRX/UBk+HnhD8MkdC9RKrhDW+eMdgSOe3YWFAi6P4t78V7lNggdMUPSG6wzEM3GNwBoCtDvJphaBm3ZL0PrYIhu798ghhxQhm6kyNnwWbIBqTK/RhDCHVWc2G2HrdcHNSxeOlwG1B4lJfZcYL7gr/ZrXP9N51V/TEy+U2YmkGRY4WKP5FyKH935n0VsrWtuq3lJBKymu3Cf5p47fMxWiEOHgTJKfYFTyVKRKdFdvWoTPgi1DQU7wWw8RwFrR5BVMfqIU2g+v65rsV3JITB0Lw/xTJ6iHc41RVZtIjWYD10AeXprwenYyyp/xvZGBry6I5Aqa1FglD/PPRau2lYvrFfTyrdfur2rAqY7wkOj1CYDGs039vbqaU64PFiex7vlHufNbiuHZoB6o9Eynon8zaYoBvOSLrmk+wBOmrhTIhgnOOgJdnewLxFSE30+977eBbg1fPggOu1Vw1qsIg0F9FXQ7tReJ89cFzp9r8N4aXZxDG5tx+xMOjHEMPqiWsHu09beIrZeZSbCdV2S2iM3XoNon0db9rwEPhtSMFHA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9/LvJu1xwkaSMoHHj3lEnUhQKhkQ7A+Tpo6JKj4gbN7n3FDlNZspNg8ef75ks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h9iyhbVghf0rXrZgaVd5atNwSlqLQSA4yv+vzJxUC8kylfPv3Taooq7FqaWpKvJnH+0xQfy/t5lyhxSMlPWhgJ2c01TtgsUYVlmA3fpO8nFc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: efeacbe6-0cf4-42fa-e3de-08dc79b93328 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 17:12:31.5012 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QFeDxYNQFyWeZmsImlQ6f/hU54vmOiZAMKt4i+GNnNqDJHVOYa7IctuO8PttM/re5TH3AQcw9eZ2ZM/6gVaRqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR10MB7520 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-21_10,2024-05-21_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 suspectscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405210130 X-Proofpoint-ORIG-GUID: p85qEztRTkbBHMrZWMyuFQaWQ3t0LLs6 X-Proofpoint-GUID: p85qEztRTkbBHMrZWMyuFQaWQ3t0LLs6 Since err represents the function return value, rename it as ret, and rename the original ret, which serves as a helper return value, to found. Also, optimize the code to continue call btrfs_put_root() for the rest of the root if even after btrfs_orphan_cleanup() returns error. Signed-off-by: Anand Jain --- v4: localize variable i in the for() v3: Add a code comment. v2: Rename to 'found' instead of 'ret2' (Josef). Call btrfs_put_root() in the while-loop, avoids use of the variable 'found' outside of the while loop (Qu). Use 'unsigned int i' instead of 'int' (Goffredo). fs/btrfs/disk-io.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 94b95836f61f..1f744bd6b785 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2914,22 +2914,22 @@ static int btrfs_cleanup_fs_roots(struct btrfs_fs_info *fs_info) { u64 root_objectid = 0; struct btrfs_root *gang[8]; - int i = 0; - int err = 0; - unsigned int ret = 0; + int ret = 0; while (1) { + unsigned int found; + spin_lock(&fs_info->fs_roots_radix_lock); - ret = radix_tree_gang_lookup(&fs_info->fs_roots_radix, + found = radix_tree_gang_lookup(&fs_info->fs_roots_radix, (void **)gang, root_objectid, ARRAY_SIZE(gang)); - if (!ret) { + if (!found) { spin_unlock(&fs_info->fs_roots_radix_lock); break; } - root_objectid = btrfs_root_id(gang[ret - 1]) + 1; + root_objectid = btrfs_root_id(gang[found - 1]) + 1; - for (i = 0; i < ret; i++) { + for (int i = 0; i < found; i++) { /* Avoid to grab roots in dead_roots. */ if (btrfs_root_refs(&gang[i]->root_item) == 0) { gang[i] = NULL; @@ -2940,24 +2940,25 @@ static int btrfs_cleanup_fs_roots(struct btrfs_fs_info *fs_info) } spin_unlock(&fs_info->fs_roots_radix_lock); - for (i = 0; i < ret; i++) { + for (int i = 0; i < found; i++) { if (!gang[i]) continue; root_objectid = btrfs_root_id(gang[i]); - err = btrfs_orphan_cleanup(gang[i]); - if (err) - goto out; + /* + * Continue to release the remaining roots after the first + * error without cleanup and preserve the first error + * for the return. + */ + if (!ret) + ret = btrfs_orphan_cleanup(gang[i]); btrfs_put_root(gang[i]); } + if (ret) + break; + root_objectid++; } -out: - /* Release the uncleaned roots due to error. */ - for (; i < ret; i++) { - if (gang[i]) - btrfs_put_root(gang[i]); - } - return err; + return ret; } /* From patchwork Tue May 21 17:11:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13669570 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (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 AA7E57711E for ; Tue, 21 May 2024 17:12:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716311563; cv=fail; b=O2YMLZBcbjbOY6LlfQ6dpeuJBsFj3AMc01UCq8TWA8qviMLJgAl7wwyZ5X3J91t9yEXYAAeH4abi9ItMMI8Bnku3dNQBO4hwFXfVbDSIBmd+nn6DxmVx2IEr0xFtW8b6BH474mTF0xX4GKooeitR7mBxJ3abyFvG/lEyt9330Ac= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716311563; c=relaxed/simple; bh=paIhwbwkHPbpUZ/4Zp/5PcxC0NUlCE/GXlG9+sQxGgg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=IiWVj8QSKB/AYfNLSim2TMP2gcYfLe6bdj30fBTR/pXxYHe4je2TcTm4DaKdTDZBhvrq8JHGBfDMOiAkqHPkN2V/0Hfh2NIrPja9oKuT8By3hzedxfVmmgNkm7kStS3NOiz1i+q2S2MK48L4RhQQt5cLVnEjr7BewqdU79N4OPE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=bdTAnBJL; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=enSxOJNU; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="bdTAnBJL"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="enSxOJNU" Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44LGx5wB008974 for ; Tue, 21 May 2024 17:12:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=+v2dMCkXtmBJwXLmhyHqHQz2SkhyDJfkv6GubW6dXW8=; b=bdTAnBJLXetmoh9QIxFh8ty/8nRPOngdYQTquN36H3y0Uz1rTEXTLpjRbbg5TTEQ7VdI l6jAjoBBsNsUWfsFcz94iP/ois3R03ci6CkPX+fz4G6dTBu1sKpPjBWolbT0bXZujEtR yTDNHeeJAjW1/FmfXEQMvTquHLXm181X6rx6J63XdzFJf9QJQ32mCOUIfHPeCQhjPll4 fAdy7qgfUYWsG6Scvu3TasyYYl+JTbMXdnK8S+neCDwOLEtxHMeobvGI7t9xRoEQmaAg UBsiHobBUN29TK0mtveSpWbMHg0GU4K84a9HEDjjO+AU1s2n44pOautv1btiu934Kna5 1g== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y6mcdwxpe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 21 May 2024 17:12:40 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 44LGfbZO004968 for ; Tue, 21 May 2024 17:12:39 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2041.outbound.protection.outlook.com [104.47.57.41]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3y6js88sfm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 21 May 2024 17:12:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aRrAbPxkyyWoeUOwntd/7GqKZ+bklRMhC/IJcIlN0nChV37ZHKKFP6fOTY+GwU5oQRlDVaWCBvu/OClyRAok3riO3zj2b9CwWjqSrQdQB9g0NRLsF0cKOWLrkulV/PeFbCTzrd4XuL1tV7zaxQXu9kP2AmPkceUG6WajuP6yA5COM5p92DhvCR2QS8pg6eUkjMX1L+CtWatKsvdXUs/0P83a9oUEe9mtRbDTmzTMoI/YGpF4Qei/Jgptlo4dFmx9dBzDXoLO7s3ofQiNa/R3GUxFxh3XypKjDC4X1h/JnslbQPXfu7B9Z+G5pX+cKsYTZyfhS7S8I+pzPbxgKhMiHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+v2dMCkXtmBJwXLmhyHqHQz2SkhyDJfkv6GubW6dXW8=; b=FAoOH7gqW2+y6gFHjgcV9qAiN2gJn+Xnf3AlWDQdAFxpeiAni7XKfyfiq9ZbZETMDA11iJxqG6NcMWjcFhmPmGHhjW2P6Zzp0Y9Z15SPzhglq0uXaqVUxDFHOk+6EnveqbJt7bLZjNS20GCZIibtcZT0YNTyj/FBC3okMcmftkVG6et+E3XYmemwbihY0v6ZP42BN8vNWu3i1yp+WbBDvNrWvIjriKcxb5MD/IxSDcliNbw+KTSZQieeqk5nD6oAotZDT3EfqoF2M/9dhLU6AksBXkX7CZqqPD06+5sKKdbSuT7/5tTfsSlOMf1mRFvQWwn3FYRxEeFWj72qOd4KYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+v2dMCkXtmBJwXLmhyHqHQz2SkhyDJfkv6GubW6dXW8=; b=enSxOJNUyLRyQ2pvjvJVa7bb5BaxZRTbjaXhREtvR8+C+zH0oGm+tLnEpAC+c3rzR5+PDNNchpfqCjZshfzB+DoZkchkKLbLI6UtP9n0f7CmzhTndmnuo9NG/+fXRTnp9tOQIwK/klNvAfrf6GTEimrwe9/1EJvdZnLVL9lGKCA= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by MN6PR10MB7520.namprd10.prod.outlook.com (2603:10b6:208:478::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Tue, 21 May 2024 17:12:37 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65%6]) with mapi id 15.20.7587.028; Tue, 21 May 2024 17:12:37 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH v4 2/6] btrfs: rename ret to err in btrfs_recover_relocation() Date: Wed, 22 May 2024 01:11:08 +0800 Message-ID: <26786b9831677135798001d84ad11962b2be08f1.1716310365.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0216.apcprd06.prod.outlook.com (2603:1096:4:68::24) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|MN6PR10MB7520:EE_ X-MS-Office365-Filtering-Correlation-Id: d7da083a-a522-4463-2004-08dc79b93697 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: LMwSr54iXUfYxU83S/DKCAFauFvEx07zQjylyVOrDGDDsSrKQkoqeJEnhGFwXtOiWksEkATbVtVa21wyJPwnaYRIIxlqGD56WOScKChbhHYqj31XiP1ervwf2CnFwUrh4uU8rU1GAFT81/BLZB30C/8XzDo6o9hLHaGUsAC5AVEk1Ga8HgI1pUUBbn3mtGhmKY8PCsDgZNoJPM5aBUTpiPONByUCkLlfiC3YPVKHFEemWAfYWNwLxxkLXNbtjimlPgfLGDW6b1zqKOsOfwCu1ZxVx8pIos2ntbrazTTjEL2dI2iLdcmuFQne5Cb2L6qnE8JoffkLmunP0ROYnDUdVVFelNeUPCtROtsH1HvvWTU/13ZkbjSDNrAhYYzNiO3Tx8P708PfmlPvT4lXVB5Vk6B9OO3OlZW96cX8G0t3IIf2jg07XNfgXk4NIYIe0ksX8vwUXQpjiyD3YelQHDlFWx6nDli+BBdAWVJ1yOfimdrzGvWCciw9pA3p+ZuWwR0elWg+to6bn5gSB+pNOYQMLmlTze97E+HHIWUWVGD/AMDezaD1nNN7Hro0BNjbVdaIZffSNBfPH8A3uWQjUThaavMrCAgxGg38koUa8rom2rcxnjtZlUb9VKBdOQB0T+4OIiaD9xzFrvXthNXIAaMX2nfEoJGNAVn8QGSBfZ7Yg5wCAFGgyC+srQKxtwUQ81ZLekDFiLqpwHZXxJt8Oj/+3PFsk31zNaXkM8QDulpL/L9dRXPAx6P15eAZ37zBfjM1fxp/gcOLbtXDNNlxCXbomh4ZmY0Af9h4xO6Z7whL0qiAyffjAlP4GFnY3rhvagwDgxCCKs4ZeiswwlE7YgdV8sJWCd2Zk46U8+/tEQp49PcXY8xZsPWdAkpAUOdQU6VP3wwN+av6IM0/0YBAwR1BvaDZ1n02+f4ZXV1Chm1pZSiRD7slGGxicF7oHWFSd7lP2Zyc1iuWPMJIaKuqe6Zl8DjH2cb4/40AJj3o40nOtbMghNqj2RyQ+AxWc111T2R5AYM319moVdoJnVKHXPjFiZv4McCG2eNoxqPE12thpzkld3Cpojl1P+SKf+4QNrt5lhRDvF70sau9LrvTseDcFVN0AC4FNVtYgygMFjmt8aYLlNhtfTVl5ZWD5xki1MG13GlPuwU20Rc+7jRJawsRx5ELgUTdB8ryHVr4qSckRFJeA2u8oC80giA2Lc4F2J18VYPTMivN9Kn0qN+hn42GOAdmh3vdt08wKwdAhgYe/N/te9U8YXXlLkbn3AQs28zby0QaCj3pQbJMJ3p5iDEwqg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +SPoXwRsM7FRjOzjCq7MZVU5sEeCu4jjRv/84nBK1zE7kiuJHc9VBEThusVDNy1BcGxM7VFx9rKwpDPrcE3owaKaH+Qht5F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7LmqxPOpL/A06jYO9cwKhY1BJ531Hxcg9w+eEtu6lEXubxud690nxpL2gGT2AuM5GQIiRYuY/HKKqOzM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d7da083a-a522-4463-2004-08dc79b93697 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 17:12:37.2911 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GLOCX7R20lt+/Eoj/4yCFaGeZ1lcozRI2PVsX914mtQ5P6yQdus06atHqJ6F4wEq3FUB6zRHJtlHkeqxLB6DYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR10MB7520 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-21_10,2024-05-21_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 suspectscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405210130 X-Proofpoint-ORIG-GUID: INQLLAvkKZu21Q0J9bj4bVrfVFTtnLL7 X-Proofpoint-GUID: INQLLAvkKZu21Q0J9bj4bVrfVFTtnLL7 In the function btrfs_recover_relocation(), currently the variable 'err' carries the return value and 'ret' holds the intermediary return value. However, in some lines, we don't need this two-step approach; we can directly use 'err'. So, optimize them, which requires reinitializing 'err' to zero at two locations. This is a preparatory patch to fix the code style by renaming 'err' to 'ret'. Signed-off-by: Anand Jain --- v4: title changed v3: splits optimization part from the rename part. fs/btrfs/relocation.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 8ce337ec033c..d0352077f0fc 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -4234,17 +4234,16 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) key.offset = (u64)-1; while (1) { - ret = btrfs_search_slot(NULL, fs_info->tree_root, &key, + err = btrfs_search_slot(NULL, fs_info->tree_root, &key, path, 0, 0); - if (ret < 0) { - err = ret; + if (err < 0) goto out; - } - if (ret > 0) { + if (err > 0) { if (path->slots[0] == 0) break; path->slots[0]--; } + err = 0; leaf = path->nodes[0]; btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); btrfs_release_path(path); @@ -4266,16 +4265,13 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) fs_root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset, false); if (IS_ERR(fs_root)) { - ret = PTR_ERR(fs_root); - if (ret != -ENOENT) { - err = ret; + err = PTR_ERR(fs_root); + if (err != -ENOENT) goto out; - } - ret = mark_garbage_root(reloc_root); - if (ret < 0) { - err = ret; + err = mark_garbage_root(reloc_root); + if (err < 0) goto out; - } + err = 0; } else { btrfs_put_root(fs_root); } @@ -4297,11 +4293,9 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) goto out; } - ret = reloc_chunk_start(fs_info); - if (ret < 0) { - err = ret; + err = reloc_chunk_start(fs_info); + if (err < 0) goto out_end; - } rc->extent_root = btrfs_extent_root(fs_info, 0); From patchwork Tue May 21 17:11:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13669571 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (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 A604F22F11 for ; Tue, 21 May 2024 17:12:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716311570; cv=fail; b=pL8Ptb9otcU5/mARhofgSxche74D+89/hhpIrrRFtIz3t/lG8+r9z42UNX8eHyCYrX2dmelJWRCI7QivV/ihaijzByuT+RV/RZPMQOOUQSMS2QvzSPXLOPaAZDYQ9nCbHARFbut7JnSCIo4uReOZirI3Di6T1waNmEgTK0LXIe8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716311570; c=relaxed/simple; bh=gkA8reKBsblPxRAWzG7WGqG8brlJoUrKFCwGpKpvwnA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=W9yEilnWFuL9032mxmYV2oTcrQMgqtOvAE1D8O+ShNiklAtUCI0Xj5co+LAFDLyxuesHFcWg+kctyZJnKu4ly5pfRwPU+I5CDd49VitNx4ZpPFnEHzz8VayUW28/XDyDk6kzQyKrkixOGnbEvNVX7tzU+xRw3nJSG3HEfRI8v/Q= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=G/Ql/LJe; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=AeJjE8SY; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="G/Ql/LJe"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="AeJjE8SY" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44LGwpEF006725 for ; Tue, 21 May 2024 17:12:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=BlKB1IMcFGN90ZpZWinv+UCnhvl9Pa6V3Fc7lPpNtcQ=; b=G/Ql/LJebiza2LvgaePvp61dVFc6/m7GDbEVU+PQYoJONKi5jbrDLEz3UtPS96tMhcU9 t24j9ofiYKO3tmk4ZzWrKtOIM0H9TsQMrt/3xRZjrLFAyMUnFX0CJVbOUQyr2M6C/Xum clRSUUJcEB5bU7VDjiZhPhNl6Vj2g7k8zq7FSIbGGpskCXkuovUJg4pT4Jn3pAViFP5f M5eNzMtGNbi2o+1HlWMfwwhwpeIZcQItd5fUjaVHImiEAo0SCNPuQDjdQviq1SIneq7P SGHwHpZHLp0NU7RMTVUOWkg3U7iEMk6qdwUaHrbhdACt0cSfU1hC6gkT24MP/e+FqLR/ Fg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y6jrenuum-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 21 May 2024 17:12:47 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 44LGWU66013677 for ; Tue, 21 May 2024 17:12:46 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2040.outbound.protection.outlook.com [104.47.57.40]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3y6js7gsva-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 21 May 2024 17:12:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D3j9IhkZlQBRZLpz5HW3Xtez1J1vWq5Snq0U8qqXoS+OhktvWB3qceFuZ5+bEcNGFLktpEgZB9Jxv85gqWTwsdFrGzBL4Wp/Paob/OjxwCGds8fZyBgsABqNyCPF6K0Lo5PqyttmZNvW/RBFXfiWvnythBN+MGep0o/ZAZVGHaseRYinkaYJRKiAVd8eK/q027vzYriGAmgsoz5UBkIyJdZjCnOrC3KKdEVwLmoYoRRYbs/VCM5tRIAiEa5K5REqUY/IueZq3+csz2KYvIdhS4gzajjli+XOC5HgmQgput59R0BHmDsiS3LJQ8oVGe4GPscINFdS3x8bLfOmyBD9Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BlKB1IMcFGN90ZpZWinv+UCnhvl9Pa6V3Fc7lPpNtcQ=; b=aVwj4KppybmL93vD2t6Yhc+qD5BIFW63p9pyRNWh+CSpnRvR9xMfc3oohhm1rHfUqbmZ93xmaXYyifZkiUZ/Cgc0wrXezu/M3Wq8Ga+pVIrrR7nzmpbq3rpKYkfcwKSPxP2TTVYYMNwNxy2vHiDo/TqavxuAwmE0yjzgrxTb4RApAJoiCc1XgmxSAIPgqB0XANRYTZHL3l4zJ82PEmYXivQKGn37NzsxZNiAjivy1qrvW3W8hZbjWk3/hpWIawltCz/thlXMQJ9mfancQD8SxZWlFzfMKqPmfmsNalTHsyxhh4L8yZ+iHGH9yfomXW/XSupgeT6+EYRwZNlju4CHGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BlKB1IMcFGN90ZpZWinv+UCnhvl9Pa6V3Fc7lPpNtcQ=; b=AeJjE8SYcBV0YeMuR1KHlp8ZL9TfBrki9n/YKtwplNOdqdsE0e3l4083rS+orx0qk88nKLliVl9zxSbIbJdeepMFgAmbhH4kCrHoSLHp8SZeZ3XI0AC9dgMNWu0+G6EdoFHab1zfmJoBcbuN9fxpNWoJG3JNeYQMujujDZvBU7s= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by MN6PR10MB7520.namprd10.prod.outlook.com (2603:10b6:208:478::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Tue, 21 May 2024 17:12:44 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65%6]) with mapi id 15.20.7587.028; Tue, 21 May 2024 17:12:44 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH v4 3/6] btrfs: rename ret to ret2 in btrfs_recover_relocation() Date: Wed, 22 May 2024 01:11:09 +0800 Message-ID: <63a0893825a6c2bb6db0eedfa66992e80b35e304.1716310365.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0203.apcprd06.prod.outlook.com (2603:1096:4:1::35) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|MN6PR10MB7520:EE_ X-MS-Office365-Filtering-Correlation-Id: de2f87ec-e216-42f1-8e4d-08dc79b93adb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: jtl+yQPe1iZYnS536b2NxukR/cjAUc9GIqgpGqD9JBLiIOhRtPJNHqK4tIP2BvdZAo5EHA6nAGAX9k7jvzf5xIUqC//QDpeIQ1q4A/TemVzMwwR4CuS8/f2sQWz8JJW0BKm8S8HFC9SAESEJDn5USh5ro3d0GNfiww38dD9B5KwtAYrdTj4phIp8KxV/4kG/lG6LNhq+iPiO0aWdQjxeZMJF9zRHaapJ/Vhqus1VITtlNjgjIklYrEVcbKPciT96ZTHiCJcsLVQpxBHlt21lCFSbqXVd6I1eIRj6++ahuYR8QJafwhhs/O3X4UCQuUefbXnzzACsrlLxn0dqbEnVNazqor55+3oLiG6NRMdsvYNUXtMyJs1W6hUULbShHdNXTlZzoKX0Idz7hKUHzaaO+UnRngwgf5NYISSiM7lYGGs5HJF1OZA3o0myYNSi1tQLshPvmkdYsqty+DqJYztbhYQUjr2qQJkJ1y4PohzR5kdM0l3c80ysU0Zn2gpDPot4yAm1HdDlDwPs938lJf3OirEX2cXtOP9/rUrEe0DtxyYKquP1PLIltA7LFNbaasj/i0SjvuME31cIP2e5wEYwMMEytN7c9AG1kxnMawuqZgn+un/1Qq3MvUeF0Z5w8oPomGZSstR6w1wWmyoNtPrzEB2DX2CvBzwZvqVUZApOYz67h7jPIufORNsawMfSnj0kA7a1F1Yejqn4CEFB50mEGkU7y4CYfAgRtaxFDt+AqXcocwFVknxPFwluQwusxGK5zc1IFipFrRXyB+7tfikHmg6KGQAmgrvjFhyxUIITjDq6URhYRp4jlwW0qWo2csNK3ElLYERjnURg4eUZttjoJZV+alKdyJO1BZ7t7chNJIUQgvr0csgPYbCoUIOIaJkURtvgoCPgeqVEakTt24RWJh5oteG7enutJ8VtCjcNjZ0aoiZndqQGLL/R3daTVcZqHGhTR2wk56+9+O/LHcWs+EQiX8j1iJfDppSlDREDDMkaoY9f0/0mVc6Ke5+PJ9crz+kLDsEZ0VQf5oGkECEJsp0AR7Kz987pXrdzPYmCPJwXrI9/6rUS1/DteKwfUcUzuSMRZ4ixTLvwRZYaRZ4bPIx1VC/uFaTtrmfRlRqYrZXZ3SPZWULs/pIDyNHZjy0byZTMXM2xkFE15hSW/r/vXs7Wqn0NiIrWC/6DsFS04N6MIiMQIjz8APoeGcqDLBPPc8hsEY1ELdaAVKmGxgJEjEYqpwcX6ucwT8JXg5RyTacGPfQJdczAgFofWEhpWV7yZbW69ei+Qnni2N26ac4bUg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EWQja600sx5eNA2D/Ci1ANf69UfDsx7CvNSuFWJ8zBREO4Qv+aInHiqlOkdwHt0NOoEZ+SoCWv8kR4KAiCWH3aDVtwmF4RAh/jMcLqZJFHjidThS6wZyP3Q7rOyeWYRf39AYeUysR5aaHu9uVqLhGk5B5Dfh/S3si3Skmt5walsG0EtDEJldVfvEfA/jX5iv95NoEu+zALvbcjcE3p/et6Us3OZFG8z7E3kIJumbEggxUP8UBI+TA7s9zkoDDeWZNHmjIohi6hkDNXvzTbAt8moDnyYByDd6+IAzWqLSmukJsfz7eL/0ezHuWz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Kubo20pgaQfLBLemgm8HDqockvGrCRp8xfv32nwJGCGSKOfNipnUioVZD+kQ8F+M5sIdaz8JvRBxxD6xKwywScPJp30FXvR6pKAHkj8uJ6fmO5ec8ww84dAgYYYoJuZ3PndLBHMzQioaPV3ELoyedbcg6olXpl37MWQzeNeHPUg3Y7t4rH92YAJn0Fmg9u8V5HqMISt5LYCgDDbKq26oDYOjJwimGlfK/huQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 4Cb4UFONkPbtxG4KpgGw5TM2KVZG6cljwOFCVTBeu6kUigNsBdd3I13FyMAXvT0/wlamoHx2TTjEPyb03SsOkDGJKMsuLnSnZsJuaP/NWez0Tqq8mrqeVn2ooLL4q4Geu5OJ9ebwHWh/SUl8ijwArHO0VcEuJo6l9I7xTXIPJxtDkXOc4w+nAk4FXFB1h8dDN6SfiEKqqfny0pa3J3gRcijWgHq5M71ylMwXeCmQMT9e0cdRt4l3mmMNalmhmAymIbJPcR1+dRBVSE1TP5aBscw2ZSS0ZBK1ZJ6CIFqDjKD0iILd9P3flBN/D36lo8rNvvjB2R1NYaipc5ZL2V9Y3+j4YL7cOpLwZu5OEhxFrNlvJ1ZSQxqKslc/y0kWsFcLRxay6TSj2ED6P/aRaGGWGoGjwxX69wpcxfyhgaITn9imqTfedSM1HZ5lBvvukdegYZ+mcNTc8aBJEgeG5t/H7k9nr+RFM23aP+S7xXa8g89Ers+UWoo+TTH17sRwDZi40YK36kJwDbpav0qQzaFLsnj+FWVqBxlTCPhOMSGaf7sQr6WmXl8rsFii7qJKgjgpW2HelaNmQUGhiTh+vUxhM7T9yhCqGz9ePCDOE0fadeY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: de2f87ec-e216-42f1-8e4d-08dc79b93adb X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 17:12:44.4004 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WasVkAY0/4TV4cq0oTVw/sJipnwE7+vAkV93SnedMuNX9wlWG1sfAVx2lA+a7W+nVaLs7hqbSSIpNZ9au2jY7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR10MB7520 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-21_10,2024-05-21_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405210130 X-Proofpoint-GUID: TcT9bW8rVBbjRuZwX105TtrFHqHfloJF X-Proofpoint-ORIG-GUID: TcT9bW8rVBbjRuZwX105TtrFHqHfloJF A preparatory patch to rename 'err' to 'ret', but ret is already used as an intermediary return value, so first rename 'ret' to 'ret2'. Signed-off-by: Anand Jain --- v4: title changed v3: new fs/btrfs/relocation.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index d0352077f0fc..d621fdbf59f3 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -4221,7 +4221,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) struct extent_buffer *leaf; struct reloc_control *rc = NULL; struct btrfs_trans_handle *trans; - int ret; + int ret2; int err = 0; path = btrfs_alloc_path(); @@ -4356,9 +4356,9 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) } err = btrfs_commit_transaction(trans); out_clean: - ret = clean_dirty_subvols(rc); - if (ret < 0 && !err) - err = ret; + ret2 = clean_dirty_subvols(rc); + if (ret2 < 0 && !err) + err = ret2; out_unset: unset_reloc_control(rc); out_end: From patchwork Tue May 21 17:11:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13669572 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (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 87AE422F11 for ; Tue, 21 May 2024 17:12:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716311576; cv=fail; b=NyY30m+YWHm+hBjq378+bpz4dKq3i0nBzISdEc8uV1Bb8JjkQQ8ZxtfdnP8z4vSNyQaZ96QcLjvbqOTe8Y1mCj8XsHGxznWjR6SAGd2QzHCZYNOtDJF5FtbFSfrDFyi/KhwitUiyPKFeTryu1ek99zfEO28VLunyxOKZuf/0OwA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716311576; c=relaxed/simple; bh=tEEdKdYSFANUWzeeKyQsgxfagrkkFW03mzD2LRHXAAs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=lgKV4tWLBvGHXBLWqFxNRsZWLRrjIe1t3Yc42zbfNWAf1FC/3bV9QcwHF0RQUzodtsY0z2aqYAoasTPrnZL10iYD2NYc9G4I9SgYucTIkrp3ocw8qTYkr8oJE6SbAEiRriLxjbKnz8N1tRQhuUZWYNLtblFn8N4qy+Jbm2Ye3OM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=G/aokEN4; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=J9+WDJIv; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="G/aokEN4"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="J9+WDJIv" Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44LGxMJ4001546 for ; Tue, 21 May 2024 17:12:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=BzBPKXoRkmgzu7WZey9QwHWBuna8Ft9iQ5DOd1no1eg=; b=G/aokEN4EX6+CRQM/1aUTVj4v4jASvObSzIm2CGjM2cSlF3Ix7YtfMHZyPHzUB/k1l8R T4C59MEDp3ktqnjBuKvFgrJXwiYVtLA56g+YhrzIUel/iqQ8Ro7q9TwfKB0HkjWH3ILL YDe8UzBFITlOjrMLxWXju+RY7M3lSkpIPBKzYNxGKFtDdVyGnnLNHpyzs+pCBTwvwJ9H V0Wn5p3fAFR6HisohhOIz3bpOHmNbpIFCWl8KATN9VvSuHFjRvHragailr8QEoB7UXQW bBfGWlEmYXP6DEWquDgzAmROWa0GZhUFGbzd2/1+lhSQAczQcnlXiZ4y/xZX15VkHCk+ Gg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y6mvv5vyq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 21 May 2024 17:12:53 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 44LGTK8Z005029 for ; Tue, 21 May 2024 17:12:52 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2040.outbound.protection.outlook.com [104.47.57.40]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3y6js88stc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 21 May 2024 17:12:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BzdD64wNzxjblojbQgvRUqmdz/xLWcls6USvRJDmStKba9hRddHuMrEnxtmuetAOQJNE+fU+23RviOq8RLHLAr7655RQ/h9lHMvZusDJZsj2ZG6+CQeB6A9wHnEM4fCoAWH8r+chz3aSfDnC+s1f8TH3e3mTOcxQB3TMmlf/ZlrKTz4jJmkGJnEsO0MnJwjbW0eRY/uJh5c2N0m5XIq7NnLCkS4VEL1+HLTaxFotvZ1XQZXSQw1qN+277extw3GhVmKJ7F4z+VMODI9FQLRPNw7ITbo/FEtTG6/ZStVONMPfKr/tVyXx72YZLRMRyHzhjzcSm9F0cdiOlBgINv9tDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BzBPKXoRkmgzu7WZey9QwHWBuna8Ft9iQ5DOd1no1eg=; b=GBfFhe4ntvJbtKQO3yY17YsJOscrNP6Xqblic0HZTVteGU1QPhIGlkqac4AvdU9A/eAW2CQzTzX2vuqpTJ8JQY0nUZ87TDHg+jvQ4lNc8NxvjbQxxpRF9ESshPr/PS3eI4k8uUqpCXOSLyaP/cMndYtl9Cfpln3sUDyn925SPIpYHcpIGspOwZ0jUhvBhOd+HuzDO0KuxpC5EuqPQBfNdoy/UEcElU7iXfzRGg966dPUA50CLiQHs0My0LMWhbjnWA4yzo0oGLJ6wdujc96AFmFy6dyMs8NDOkkqN/43/PZ/Vj0QCCe97nQAhpfigbp9mm3cK2ToZwzhfCQ6/Vv+WA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BzBPKXoRkmgzu7WZey9QwHWBuna8Ft9iQ5DOd1no1eg=; b=J9+WDJIvNvi3o9+oPmIWHKKldHNtdP8V+vHclPwMsNS//bwsad6BFFTmTitONmE7Q8P4jkGJpTZZesVBwDHG0qGrHEXHh92gw4a5FYP3nBJIftIsq7MUdVq6CkxfkYDiU+wbSwNdabu2/cMBivUBvBjHgKHJrgM5KJUkD2zIHZ8= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by MN6PR10MB7520.namprd10.prod.outlook.com (2603:10b6:208:478::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Tue, 21 May 2024 17:12:50 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65%6]) with mapi id 15.20.7587.028; Tue, 21 May 2024 17:12:50 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH v4 4/6] btrfs: rename err to ret in btrfs_recover_relocation() Date: Wed, 22 May 2024 01:11:10 +0800 Message-ID: <85f302e316b167baa19504f4148b77cc4cae8bb8.1716310365.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: X-ClientProxiedBy: SG2PR02CA0037.apcprd02.prod.outlook.com (2603:1096:3:18::25) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|MN6PR10MB7520:EE_ X-MS-Office365-Filtering-Correlation-Id: 48e3a43d-a1e4-4134-6245-08dc79b93dbe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: 8I59IzBKbaplu6zQPWLuyDJGU5/brrQg2lFoXLLYHrTWYZyk8c2AmzwF3wv7lXUCpe0+j2zo9aozJMcFKni13zfBzswUX9ql/V/jKakltCkyF6HO2Ldh2NxOOzm0xWcakWdW8NJYfZBbDPlGXw0DDOE7TrsFWCB5xR1u5cZw2oIXCB/zWxRbudukM3punR0lUEvbp80cZo0p81EsVVJNgnLeF1UD5SK2JKGs47PlazfKKcz9nhEWig3w/1mxUQGIRPg+wyDregXRu6fj827NKZeoXdRSXH/GviGMmSB8meJjBMP1RYha3BKW/LH3yZm2lmqbNvZMtzfWgo1sPUBHjgtUCkxLCWpmD4Aw0pJU11cOciSFqEyOv4iJIJxXnb2peROywBY2sXlo0PPhoLYNm+l5VCW48DOmpnbUdWi+MIN6UdS5RdduXkZd/osRJ6X/UfNjQ4h7iiSGXdWnedlwgFvgikGrYr5yy1aPMPGsYxFPudosj2pouva0iLeJmfJUxEBDZztHtA87sLRufq0w65UTCCi6ABxH5TbIsgqWJm6UT06g3gzKv4nytxTNCME9BKgTQ7K+ODK9KjPruzyMsVkHJEDRik3eaohIUGmcMr3kOndD+OXdJakDjWOKwnIzq6bqkj7jdH/gW2BE+Riz3d+tYmh4a2NwnVyb2Vd6entiWH5WNpoLH2oybezMK3vtObCjC/xu/sDdLjvzLRUiChyTQlElhe49PA1ULQZa2eY7Uk1rW1wb1usu1n74zEaXA9+LbYfX7BF7Xw3LPjhmUwQk0NmXjh/Seuk6SnfwPRQOeCweTfdwPp1aBTBxUzVJ+PdkNtS6qaLWwxZET/xzriEUffdIdNpsh9PXbE53ZdFnD8kMapYH7u2N5n0EKCFraIYHiaant8V5xMUzJ1xBNpn2lt+2p7chk5Z3Y+KxGQvMhelZVraH3BGCfx7vt18xffPkukLo4p7Q55x/znUYl0fV5/Qd2g4h1ofgod2QKHc6qIDs1saRUnLTyhPLk9Ri5RFwicTaJGJQU2VVbzZa3O/yRDU5umOiUNZWBm1zvFChT7/4hoUzdns96xf8qGqeqbD1CvCIPYurLY8o4ERG23ZXb/9bJzJVilFWZtgXHw7IapHl0qQGpFhcMj/dVIDPUCjk5j9+w6Nfp6WCXiiXv7zsb2MfPciYWvLkqmWYOY1dGJUs/XHdb05Iz8mpp5fAM5Ov8/CFzexgXYR5ZcmfJ2swsDTmL9YyZf8IFe3V3inotBsjoQ5UAaqlkyvDJZihaP0dJvs/1KBwMpmiaYiGSw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-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aTxXbF2s1jxFVrE45/YdmClsvtc9fCv6nmbvjmb1wRTsIAM0yIqbuR8wEmq0f37Hh4xr9tGWWbIsG+hEgYDXVbmW7lWlTQNDZAFPxnWJP5/IUGldN16kkFBuBpgMHtX9lSezIBQxHSqTUR74adr/NEHDUvhHY+RmKw3S0IZDlYSEKQW3HGHoUKtx8hY7KPRzc6IS4BP9wA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 48e3a43d-a1e4-4134-6245-08dc79b93dbe X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 17:12:49.7631 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BH0shLeflek8pgKW2P9enWnK6U9FXOObO5X/WtM9IKHEERAZx2UmmJY30/05bKj6wZ9vssL012IsVDYEepQugQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR10MB7520 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-21_10,2024-05-21_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 suspectscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405210130 X-Proofpoint-ORIG-GUID: 980JZz9Aj_jvgHdeIpgqj8XIDm7djoqO X-Proofpoint-GUID: 980JZz9Aj_jvgHdeIpgqj8XIDm7djoqO Fix coding style: rename the return variable to 'ret' in the function btrfs_recover_relocation instead of 'err'. Signed-off-by: Anand Jain --- v4: title changed v3: new fs/btrfs/relocation.c | 56 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index d621fdbf59f3..cd3f4c686e5f 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -4222,7 +4222,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) struct reloc_control *rc = NULL; struct btrfs_trans_handle *trans; int ret2; - int err = 0; + int ret = 0; path = btrfs_alloc_path(); if (!path) @@ -4234,16 +4234,16 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) key.offset = (u64)-1; while (1) { - err = btrfs_search_slot(NULL, fs_info->tree_root, &key, + ret = btrfs_search_slot(NULL, fs_info->tree_root, &key, path, 0, 0); - if (err < 0) + if (ret < 0) goto out; - if (err > 0) { + if (ret > 0) { if (path->slots[0] == 0) break; path->slots[0]--; } - err = 0; + ret = 0; leaf = path->nodes[0]; btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); btrfs_release_path(path); @@ -4254,7 +4254,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) reloc_root = btrfs_read_tree_root(fs_info->tree_root, &key); if (IS_ERR(reloc_root)) { - err = PTR_ERR(reloc_root); + ret = PTR_ERR(reloc_root); goto out; } @@ -4265,13 +4265,13 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) fs_root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset, false); if (IS_ERR(fs_root)) { - err = PTR_ERR(fs_root); - if (err != -ENOENT) + ret = PTR_ERR(fs_root); + if (ret != -ENOENT) goto out; - err = mark_garbage_root(reloc_root); - if (err < 0) + ret = mark_garbage_root(reloc_root); + if (ret < 0) goto out; - err = 0; + ret = 0; } else { btrfs_put_root(fs_root); } @@ -4289,12 +4289,12 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) rc = alloc_reloc_control(fs_info); if (!rc) { - err = -ENOMEM; + ret = -ENOMEM; goto out; } - err = reloc_chunk_start(fs_info); - if (err < 0) + ret = reloc_chunk_start(fs_info); + if (ret < 0) goto out_end; rc->extent_root = btrfs_extent_root(fs_info, 0); @@ -4303,7 +4303,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) trans = btrfs_join_transaction(rc->extent_root); if (IS_ERR(trans)) { - err = PTR_ERR(trans); + ret = PTR_ERR(trans); goto out_unset; } @@ -4323,15 +4323,15 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) fs_root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset, false); if (IS_ERR(fs_root)) { - err = PTR_ERR(fs_root); + ret = PTR_ERR(fs_root); list_add_tail(&reloc_root->root_list, &reloc_roots); btrfs_end_transaction(trans); goto out_unset; } - err = __add_reloc_root(reloc_root); - ASSERT(err != -EEXIST); - if (err) { + ret = __add_reloc_root(reloc_root); + ASSERT(ret != -EEXIST); + if (ret) { list_add_tail(&reloc_root->root_list, &reloc_roots); btrfs_put_root(fs_root); btrfs_end_transaction(trans); @@ -4341,8 +4341,8 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) btrfs_put_root(fs_root); } - err = btrfs_commit_transaction(trans); - if (err) + ret = btrfs_commit_transaction(trans); + if (ret) goto out_unset; merge_reloc_roots(rc); @@ -4351,14 +4351,14 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) trans = btrfs_join_transaction(rc->extent_root); if (IS_ERR(trans)) { - err = PTR_ERR(trans); + ret = PTR_ERR(trans); goto out_clean; } - err = btrfs_commit_transaction(trans); + ret = btrfs_commit_transaction(trans); out_clean: ret2 = clean_dirty_subvols(rc); - if (ret2 < 0 && !err) - err = ret2; + if (ret2 < 0 && !ret) + ret = ret2; out_unset: unset_reloc_control(rc); out_end: @@ -4369,14 +4369,14 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) btrfs_free_path(path); - if (err == 0) { + if (ret == 0) { /* cleanup orphan inode in data relocation tree */ fs_root = btrfs_grab_root(fs_info->data_reloc_root); ASSERT(fs_root); - err = btrfs_orphan_cleanup(fs_root); + ret = btrfs_orphan_cleanup(fs_root); btrfs_put_root(fs_root); } - return err; + return ret; } /* From patchwork Tue May 21 17:11:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13669573 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (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 BBA0222F11 for ; Tue, 21 May 2024 17:12:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716311581; cv=fail; b=cIh1pU+ELst4uVaP5uEJJ11lO6bQDo3OqYwSfMnAXhHGYUm5FXv/yyvrABgxk5dwBViwSWI3gpRyEd+YP/FFf7Rr3wVPVDZ+hbk/L70o1bBUc3zpiW7nAr3elGiRort6Cx3fMEc7nxE0xkL3TkrmuGn1qnwb0vl4IfAd0s2h2ng= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716311581; c=relaxed/simple; bh=tkJx7CajRgiadSgSuMfdoNk9Ao1va3Dr+zQEYGB1ta4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=HbjyB7rgXqqnCnSPJplDB6BwrkuIm5Qjv/dj9BKTvZJ4VPTuVOR9t5JfvFBC8zGzQUGhcHEf7OGXcdd0f3yP5rppQw/DTyqCHN3xbz4v5ZINtckX+eJRIJQmqfmVgSONwOy8xT4p1Aat/bc9YjOLEblXhJ2YXAgfqOJ1zraWEwI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=ZsBoTbQo; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=NVixXrBn; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="ZsBoTbQo"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="NVixXrBn" Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44LGxMB0001541 for ; Tue, 21 May 2024 17:12:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=r/zogpUUyAneO7U+RDOHHnIIXVxZQXAKq618FRnOAvM=; b=ZsBoTbQoNC4uFxlbCE6Z8B/WFWr32MC7tPiEF964KrENSrVlnhSZgN94xNls6S5QjSwh guWj9UtFX10X9JdqeX+tARTexH9ISRTI5dtLbQKMKbmZslm8CWmHwgOE3eBpeUJongQY 6qQTvsJ/p+OEEh8+hmw3V5ouHF+0y2sLPElu8i0rCODcq/MbbHmpPtbXk3vDBDkSJVa0 hMlSYTN1ytjQlNfYDaY7YYkXYgv6VP+CSb8SNrdfyZDiBhXAJB4hdeBK6N6AZiqlKIMK Lm3uHAIiZjygKFqbSbvwgsTolMnuNSSoKs7OW35UtslS/n0neeZ/R/O01mJLHHyCOQGp Tg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y6mvv5w0a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 21 May 2024 17:12:58 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 44LGoRT9019590 for ; Tue, 21 May 2024 17:12:57 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2040.outbound.protection.outlook.com [104.47.57.40]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3y6js82k5a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 21 May 2024 17:12:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mRYWa3815x73r7ea9s4CIZ3qaLPSPwVADH61ITdoAEC4+PQNBvW/JR9SZac533j5ms1Ns0on2i77yjIdgKGO+7xt026wYTZfrn8zTRzN+F37PWYkhOXF+ft+oPQBdvknUUs6fO3RI/EFrKudSM6xIrh/dbg0tXTAWqw+VK81iEvyAjulLlIA4lwyN2ITB+gY6eWZhhsLfgh0WZo/eOxPan9h7wNiWcA02Z8z0iZR2kgI/bDJxYfMsHEuCsX473Qh9LC4a1T561YCpdWEaw7FkJgmqItGfHeFQD2FG3rey86Js4A0lTSWQwpqg/7LRrYrcbnLNiH/QdDmNHWZNFm3gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=r/zogpUUyAneO7U+RDOHHnIIXVxZQXAKq618FRnOAvM=; b=kUfNUpbZIOzDnRWJCzzDR6TJnmrhXNSpokfrr8apwaCzfQ8Xelz96Pmh3Zb+UX7fuHCUsmqD80HLhnqHXbOZpetPQLNX6TkEN1DXh9QOVuvVTrgrdniY8c4x2zjZs7XJz32MUri3I1VmryAiEGVVDQ1YLFPmo5Mo7ptMPakRJHp1ux1I7fsy1NlOhaGmFHr/2w9JqARF2Phs3MNpCDScyEFmI5h7GLlyUhor2aGNh203nkz6MIJ5SBkwdBH0l2N0SQTKKo/5iB3ukwSPp5EiE67HCpX7xzPljFcZxUG12IX/ep+Su3Nn0zARDyOO/27ze+Vs8nOlQMVsRDlXPsZy7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r/zogpUUyAneO7U+RDOHHnIIXVxZQXAKq618FRnOAvM=; b=NVixXrBn1KXnx5NDLXtW0rojFitxn+8GN89on+wT+y7QuP/S/h0/zAXCsx3WuO9OM2F+SKWlJdCM1/uCxNBiWr8N1FnY/LD8e52/9zOZ4JKcbeeeeq1orTvrlJdaTIJNXU5nHqPpsL1c9mMxfnU66Tis0QZFFHgJpjK+SYmDf1I= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by MN6PR10MB7520.namprd10.prod.outlook.com (2603:10b6:208:478::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Tue, 21 May 2024 17:12:55 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65%6]) with mapi id 15.20.7587.028; Tue, 21 May 2024 17:12:55 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH v4 5/6] btrfs: rename err to ret in btrfs_drop_snapshot() Date: Wed, 22 May 2024 01:11:11 +0800 Message-ID: <8f0910686f948b2f7bd018a174fb4a17eaa5c35c.1716310365.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: X-ClientProxiedBy: SG2PR04CA0172.apcprd04.prod.outlook.com (2603:1096:4::34) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|MN6PR10MB7520:EE_ X-MS-Office365-Filtering-Correlation-Id: 61eeff9a-06c7-4553-63c8-08dc79b9414b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: WZ2f5BfNO6V5e7najR8lNvksYJPT9IdBvA6HmJhmQ6gE+taXgbXi9Glz8e7i13xtgQpY2Z4aafMZASFK3oQLsWgLd5OPMTeByo3iHUdhZTGlC/g4lYZIY//Mb8cKp8+O6ugCN8vuZGmXXgAovW7dZuaXyVGJJ7RvNIam9yhBL7yhbxdSC2osoAZhLHh7lhxInVfSHL5IW4xZluwS8MKutky5tXfxV59CqVGIsnNqbjsGgAyzAM/ESrRBxA+Hae3BejCuZsqyqeijvuSJPZd2RmM9AYOQuCxixst03Y4599UrkhdhqVMFbCHMoBXJXBD4JzPx3+iaBmxpcj56cKT3B+1wjmRUYU90PiZqrQqt7UInZVvEphi+3TI0dME656s9OPlYl7wxciIwhZokCVOvs4nUN5KZosvZRzevkhvm6sUw0ZHkMdLPNtC/WiLBk0cOMfu2vBvi9AzLv37js7akmZ4jRugPBfXSTobuQlzOrlRuqWsLaA2s1YnTQxDqmJ47Gg53tDt0AKiFqDJue+oB1ehmyFvp20ncrDksBR8pQMMr4ydYePUV80Sj4iv3zS+5FCJDh5tssKMFAM3pZGwzv5H+t7+RhsMLz6D3idOoWZGOul/bC+z+12ay/eUTnzw6u9FDpy+I2/Z4Osrnxie6MySytvvcp3Us6YkhjiJmGE1Pv7VK+3xIGLlLT6DXUELfvjkFUN3wrk7HZ5OCn4GAPJFMP/ZzmBMi1ZRvb5seIEmZ4lpcLoyAmyxbtbKiGeOV+Lcoj1uiUZCVqafdCdYV0ddbhWlHhe14Naq3qHkvTWru0WqZwRq8IxM2BpiJI0WzFtZ0iA6gR8DqIPaqnXP0Yn44Gh9bYh2p34qQP2GhMzE8Vmxld+ORudlXjfGIoEVA0XG2UdJ7Xs4CYeug6ElEnb+ySU4Z+R3K0VXu40lXBJN/3Fs6cwzCo1qqmNM+bDLAnKrcC+of4wKf/m3aSqfVDWQhUKZaSVne9/c3f0sZbl6FVnE10f70fEyvqIGm21aeftnFNyZnjQyFIQuNiodXO7UnBc3XgdPpPo72GFeHIo2lnQNs8fQsu9reH72HXcoM8NDTzktDoKBBZOtTrmd9QklGc1UfSD6Xx0qQDhjrkPak4Q7H6sLL2zQIhziphLp7OXm7YyH1YoIkv3SGfjxHF9GziivUiFKlYckDzdubY8sjd6vMNFPfDXFvQ40O+GY05Ew8KCnEV/nPtrmRc3gpgceQIUWhzd19jBjW4ZOrMfoSQq7WJG1JxdiwcMM9gPJT++NS1Dlw9S5fblHclS8lAg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: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XOTq/zHGi1g/0BtsQteNq2r+6u9wg/6MnnkFZMvwU85rZgGudu1CXvf4sKqqJkkSpgfQ+G/4+3/NJrPUoglnf7Nmf53A9xRIXI8TYVXCPj7lha49lxWTQQ6Ps/naqAuWtPwyA+OaJiF6O5921ZE6B3SkNkPl3flJ0SgtzFGcChuukxxUIo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 61eeff9a-06c7-4553-63c8-08dc79b9414b X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 17:12:55.1898 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: M3vwOWkIFNHiYa40LMwRrj4Nw97HKcy6YKEiMYEecTa7g7lcPtn9zypMG9el/xEAFNzo3qGzH0IxL4oRzbvFCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR10MB7520 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-21_10,2024-05-21_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 spamscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405210130 X-Proofpoint-ORIG-GUID: WTDTsLligPkseFIPhhtjEKIw-EvIUho3 X-Proofpoint-GUID: WTDTsLligPkseFIPhhtjEKIw-EvIUho3 Drop the variable 'err', reuse the variable 'ret' by reinitializing it to zero where necessary. Signed-off-by: Anand Jain --- v4: Title changed. v3: Fix comment formatting. v2: handle return error better, no need of original 'ret'. (Josef). fs/btrfs/extent-tree.c | 48 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 3774c191e36d..5aa7c8a0dbc6 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -5833,8 +5833,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc) struct btrfs_root_item *root_item = &root->root_item; struct walk_control *wc; struct btrfs_key key; - int err = 0; - int ret; + int ret = 0; int level; bool root_dropped = false; bool unfinished_drop = false; @@ -5843,14 +5842,14 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc) path = btrfs_alloc_path(); if (!path) { - err = -ENOMEM; + ret = -ENOMEM; goto out; } wc = kzalloc(sizeof(*wc), GFP_NOFS); if (!wc) { btrfs_free_path(path); - err = -ENOMEM; + ret = -ENOMEM; goto out; } @@ -5863,12 +5862,12 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc) else trans = btrfs_start_transaction(tree_root, 0); if (IS_ERR(trans)) { - err = PTR_ERR(trans); + ret = PTR_ERR(trans); goto out_free; } - err = btrfs_run_delayed_items(trans); - if (err) + ret = btrfs_run_delayed_items(trans); + if (ret) goto out_end_trans; /* @@ -5899,11 +5898,11 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc) path->lowest_level = level; ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); path->lowest_level = 0; - if (ret < 0) { - err = ret; + if (ret < 0) goto out_end_trans; - } + WARN_ON(ret > 0); + ret = 0; /* * unlock our path, this is safe because only this @@ -5916,14 +5915,17 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc) btrfs_tree_lock(path->nodes[level]); path->locks[level] = BTRFS_WRITE_LOCK; + /* + * btrfs_lookup_extent_info() returns 0 for success, + * or < 0 for error. + */ ret = btrfs_lookup_extent_info(trans, fs_info, path->nodes[level]->start, level, 1, &wc->refs[level], &wc->flags[level], NULL); - if (ret < 0) { - err = ret; + if (ret < 0) goto out_end_trans; - } + BUG_ON(wc->refs[level] == 0); if (level == btrfs_root_drop_level(root_item)) @@ -5949,19 +5951,18 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc) ret = walk_down_tree(trans, root, path, wc); if (ret < 0) { btrfs_abort_transaction(trans, ret); - err = ret; break; } ret = walk_up_tree(trans, root, path, wc, BTRFS_MAX_LEVEL); if (ret < 0) { btrfs_abort_transaction(trans, ret); - err = ret; break; } if (ret > 0) { BUG_ON(wc->stage != DROP_REFERENCE); + ret = 0; break; } @@ -5983,7 +5984,6 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc) root_item); if (ret) { btrfs_abort_transaction(trans, ret); - err = ret; goto out_end_trans; } @@ -5994,7 +5994,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc) if (!for_reloc && btrfs_need_cleaner_sleep(fs_info)) { btrfs_debug(fs_info, "drop snapshot early exit"); - err = -EAGAIN; + ret = -EAGAIN; goto out_free; } @@ -6008,19 +6008,18 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc) else trans = btrfs_start_transaction(tree_root, 0); if (IS_ERR(trans)) { - err = PTR_ERR(trans); + ret = PTR_ERR(trans); goto out_free; } } } btrfs_release_path(path); - if (err) + if (ret) goto out_end_trans; ret = btrfs_del_root(trans, &root->root_key); if (ret) { btrfs_abort_transaction(trans, ret); - err = ret; goto out_end_trans; } @@ -6029,10 +6028,11 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc) NULL, NULL); if (ret < 0) { btrfs_abort_transaction(trans, ret); - err = ret; goto out_end_trans; } else if (ret > 0) { - /* if we fail to delete the orphan item this time + ret = 0; + /* + * If we fail to delete the orphan item this time * around, it'll get picked up the next time. * * The most common failure here is just -ENOENT. @@ -6067,7 +6067,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc) * We were an unfinished drop root, check to see if there are any * pending, and if not clear and wake up any waiters. */ - if (!err && unfinished_drop) + if (!ret && unfinished_drop) btrfs_maybe_wake_unfinished_drop(fs_info); /* @@ -6079,7 +6079,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc) */ if (!for_reloc && !root_dropped) btrfs_add_dead_root(root); - return err; + return ret; } /* From patchwork Tue May 21 17:11:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13669574 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (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 C0197142910 for ; Tue, 21 May 2024 17:13:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716311586; cv=fail; b=c23zxWP+mqn8Fc1FnXIn0tVEGfNuxZnP2FfXcd5wfn/kaqIXzjD/wbPwtS0SfX06omHzEOHr+DaXEAZha0fMiWdTNcQ8UQ7+uaQWQMAk1e3Lyn0z+s42zG/CvzGL9m+QVSDYOblaQy/u8ykd4X+5chuSdlLuhMSLo7uQ6v0kgIg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716311586; c=relaxed/simple; bh=VFW9v3QPvGMUOQSd5roxZKIsTxAnVPAFCOOuD5WfZbM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=kIwrPyISOxKRjwbyEFXXkMt0tHpuDqDO6zZorot8vktZl3kX4oNU6iUvc9EJFuCT5EARAYikJqGlCa3th+2aEAXhD+RH8WDtpEdviQELeCrR1Otw/Toxzp8I3FElwiC1oDNTV5jbUa+ipVGUie8bMNVMKF1YTtN+nmaZ/0k5ytI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=kL5eyvEA; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=W1pknImb; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="kL5eyvEA"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="W1pknImb" Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44LGxLPl001516 for ; Tue, 21 May 2024 17:13:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=IcinQkBetQ9pXCylSBrRsQd5iUtlsqIszeUJdoE85kI=; b=kL5eyvEAVb5Mm+H+OrzjcHlNza+j+7KwFa6le26eVHtEWTQAMG4Fet95k/WqMtNE2ZLs p9VbQp6CecEhim1iuak/Ab4rFZ8zSyKTFdPPU1lMtY9Q42JQpyl1y/bAuxg13u1jYzgl zS2AX4VzmP7iocnC0zWndL/Tl4mPLTvDZp5ki/kaAa5ckglEsNK/GYWxKmdYcyJat5Cr DK0zkNDCNkbtVCztKdci1BW1MXrpoLgmBZ8Ez2EUIUudkr3rC/EfGBZX83VjOc1uvBjL aQFN0jihHRBMvUdh69Ys+6l6oH1qgjGq24gEUJZUXsSYsTjIG/pB81RAoZZ3FGeXy4QO eA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y6mvv5w0q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 21 May 2024 17:13:03 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 44LH9JQD038423 for ; Tue, 21 May 2024 17:13:02 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2040.outbound.protection.outlook.com [104.47.57.40]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3y6jse1tdq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 21 May 2024 17:13:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cVdO2MFWjCoFqXS9W/51jG2PpxUOXpp48reQ2NP6iwfTbpiPImiiaN3x8jeYDbQ77B+byn4U1iI/a/cED5OZddVpxyj0cML6KzhsqFPv8mxTWn4XyXm2wbJ65PIKq8AI071W9670GdFhvNBeav4SmcD4ouo3u4XF8SYOmCzgMRGLrWhFHUchZMtLQ37EuCZx7EPC4ntZVtQrGdh63SitLRMe39fMnza8NtdzFjpz1qr40Mt0tQCB+Hz5WEXZIPDNZcT3Pf6eXGT+8eP6Xrys2DAXcOUFwz2f2M5mIz/1o3goTG4J6iObwR8/tqhuii04urU86i0zgAIHIAaPKv7uvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IcinQkBetQ9pXCylSBrRsQd5iUtlsqIszeUJdoE85kI=; b=Avwpl9sLyh4uj7smrz/RE7Thjyq7EwENMSvOljvJF6whaGGtUXZiKeGDP93BYN4GYcJS2E4TisBc8NHJeUMbLRcsPTBuGihNYYrlz/3i7xkFieMFjqWvLXILcTZgWKglDZsb2bmHNHXHDAXdsvi69AOmhA+7uUynCzXFexCAe66ZCelHLWzDl1R+iZTaFSyn3wbrcPh5I763dSefPA2Txr5ZhmeFptm6xP3Ys0SOvfak6lA0V+FweOgb1hmkn/CZ0w7fW5uqajyPCV15g11exJKWJtEwPjdzPQbYuDcKkQ6j0KbeJKKcOf3+63bp1wJBjwrKnZNayo9+SFn5jtTiBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IcinQkBetQ9pXCylSBrRsQd5iUtlsqIszeUJdoE85kI=; b=W1pknImbmrk7w753GZN9b4EP6Q4DDGNHmNO8usHrM6LXidc4lF0A+zEcOjQCxBIffv3+z1zxTgUlHYoahzPkmb185U0Vviv7+ArJEd6OaOjzItDoUJzFKKbokwWeEHFC2aYOAqeeDPVRmFC/EYfwx4wAIrQhx7US9dSsJvB2No0= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by MN6PR10MB7520.namprd10.prod.outlook.com (2603:10b6:208:478::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Tue, 21 May 2024 17:13:00 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65%6]) with mapi id 15.20.7587.028; Tue, 21 May 2024 17:13:00 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH v4 6/6] btrfs: rename err to ret in btrfs_find_orphan_roots() Date: Wed, 22 May 2024 01:11:12 +0800 Message-ID: <5579ea3ed3d669b2655b64dc67fbdc7587338f8d.1716310365.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0237.apcprd06.prod.outlook.com (2603:1096:4:ac::21) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|MN6PR10MB7520:EE_ X-MS-Office365-Filtering-Correlation-Id: 2d354999-9872-4100-b782-08dc79b94435 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: Eer7aM3F9G9lFiN4hl/C8A/4aOC7JbyEHEiovrfRmcx/e/CX57jPEOdK6k44vGGxnqz8kdlACxpWri9ekZZRHMuICj3Cp+cpKGW1A/UOmN5RzkrNRyR+N5FuId7nvMGQ1Fpat9ojSaWxZUbsXkfG8SEv1Cf+dW5yRjMJUtX1hYJfqtRfsdqxU9rV5ZBHffckFZKs3x0vp38z+dCHXXyOdonVcin+lHNivY8TEMLQQ5GNMmlzeBttlq3louNduhwBnvNGWXcM2Lz1WpgE8sPF6ntX3r+QgnCJRD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:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hcY6AfL54yOAHSsFkDbwekL2Qe65chZFz3Bvq3JZRdKdbGgV3igkPsKyDK4/Baaqn8ntsw4tpVjunw/lwXugSuRDxMtLKXSoc1OL9p3SX4kS8jqtWQXZfGf7fX2z1aQOKX+Hc12S0+kYpvDIzLO6/P5z+eP2uVlria7EcPPqzpo+OnFqQq6XiFQ4iS4gbdf+hxBivQMi0vFInm2c+g4bwJOB8o2MNv3Z47W6z3IsbXr8mxX6AdBTxqnjUNOq4s2fFd1taJWz9RS3j+ThZWPw/n5XBweHWPWieiS79ruyBH5sSBX8JwxGfANkt2JxoMA7FSo3K03DVVKxlN3Nr+PaSIVTmFtkBR+4DN/y5XCIhGuVU95EoTDz6PUqKb58pRl6FXaF8a+9loYuLA+SpBV4VxGpaiVX0htZWAit+6vcBHF+mo5A/U50/m95LxAZuRUkuJVQjuXX+HVc8mZpkksfz567GZWythDBcs5t6uaqZkI25TwK6QkWSPmoJLzNQTDQXZcV36OZlWQOtvs+6mw7YPghHEplOAJs1B3N1LCd4w0votgjJjvM6YxRQ21/1kOdgEhgJIAhDfWV07pSOjOXE6D1ov8WvKpRhVhUnRCa4qmFlxWrsli2OxCTAt3lvr3Zoxkz+iDi/zkqyFXqipthlytKPtAUQX7uF0bnok9LmGMhChGciEhAKhc66SoeGxN5T9Zyglt0/5p/Vk5xl9fxcXyV/pHR1uCA6ey6RovHjkZW5xkgmpXiscaCk3bOC+FRoEN7pc70jeiwh99ufRdpccKuBoyxzQ1FJFCLi+wtqJHHCHosnLZF/pYnLSoVr0ZCUMrBN/wTS4916DB+72LLtYbduBiao1959lvElsogLr/2QGqeStWIb4UsYvo+ptPjFxp24Dbq+0ZCFo31HQU9y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9ajoHbJP4G6TRB/DJqaoYuf1/fPBWiGJr/Q1I4aWMZuLT9rgbMaRDrWLYO1fNuq6MJwkKiaMfqInFBmx55N2Xo9cpoOyycmHJEon9+X8OCWb2rRj6Km+syTeGeKCuqcUdIAXvqyXtb0SiqSKDgKSs6oWGMbCUeVl8FVyfjVj02C6xQuPlq/W2WHQCIGor2qE0gGDHpruJaVbi4MB8o0UYbCu2jv52oP9+rDyvvv6o2u3ViwiDhLSVaZMYcKLFcQqumFcaWfdFpq8JGDvHBRpQGt7PDAW3d+CqtJwghtmBD8Hq86xkHHATDpZVDig2ylLBzH8oRQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d354999-9872-4100-b782-08dc79b94435 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 17:13:00.1138 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 30qC5/oBzXLCkl12t0DhfgW/GJPW5zAMJtvVPQAXTJQZci32buwKsjH6hNQ6sP/8jh6HveiKBjxd9sVlmKu8iw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR10MB7520 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-21_10,2024-05-21_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 malwarescore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405210130 X-Proofpoint-ORIG-GUID: MetBzkzvvXLlpWx4ZfCSeXUJxD4l_wx_ X-Proofpoint-GUID: MetBzkzvvXLlpWx4ZfCSeXUJxD4l_wx_ The variable err is the actual return value of this function, and the variable ret is a helper variable for err, which actually is not needed and can be handled just by err, which is renamed to ret. Signed-off-by: Anand Jain --- v4: Move ret = 0 under if (ret > 0) Title changed v3: drop ret2 as there is no need for it. v2: n/a fs/btrfs/root-tree.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index 33962671a96c..c18915a76d9d 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c @@ -220,8 +220,7 @@ int btrfs_find_orphan_roots(struct btrfs_fs_info *fs_info) struct btrfs_path *path; struct btrfs_key key; struct btrfs_root *root; - int err = 0; - int ret; + int ret = 0; path = btrfs_alloc_path(); if (!path) @@ -235,18 +234,20 @@ int btrfs_find_orphan_roots(struct btrfs_fs_info *fs_info) u64 root_objectid; ret = btrfs_search_slot(NULL, tree_root, &key, path, 0, 0); - if (ret < 0) { - err = ret; + if (ret < 0) break; - } + if (ret > 0) + ret = 0; leaf = path->nodes[0]; if (path->slots[0] >= btrfs_header_nritems(leaf)) { ret = btrfs_next_leaf(tree_root, path); if (ret < 0) - err = ret; - if (ret != 0) break; + if (ret > 0) { + ret = 0; + break; + } leaf = path->nodes[0]; } @@ -261,26 +262,26 @@ int btrfs_find_orphan_roots(struct btrfs_fs_info *fs_info) key.offset++; root = btrfs_get_fs_root(fs_info, root_objectid, false); - err = PTR_ERR_OR_ZERO(root); - if (err && err != -ENOENT) { + ret = PTR_ERR_OR_ZERO(root); + if (ret && ret != -ENOENT) { break; - } else if (err == -ENOENT) { + } else if (ret == -ENOENT) { struct btrfs_trans_handle *trans; btrfs_release_path(path); trans = btrfs_join_transaction(tree_root); if (IS_ERR(trans)) { - err = PTR_ERR(trans); - btrfs_handle_fs_error(fs_info, err, + ret = PTR_ERR(trans); + btrfs_handle_fs_error(fs_info, ret, "Failed to start trans to delete orphan item"); break; } - err = btrfs_del_orphan_item(trans, tree_root, + ret = btrfs_del_orphan_item(trans, tree_root, root_objectid); btrfs_end_transaction(trans); - if (err) { - btrfs_handle_fs_error(fs_info, err, + if (ret) { + btrfs_handle_fs_error(fs_info, ret, "Failed to delete root orphan item"); break; } @@ -311,7 +312,7 @@ int btrfs_find_orphan_roots(struct btrfs_fs_info *fs_info) } btrfs_free_path(path); - return err; + return ret; } /* drop the root item for 'key' from the tree root */