From patchwork Tue May 23 10:03:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13252003 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 798A2C77B75 for ; Tue, 23 May 2023 10:04:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236486AbjEWKEV (ORCPT ); Tue, 23 May 2023 06:04:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236541AbjEWKED (ORCPT ); Tue, 23 May 2023 06:04:03 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5DA01BB for ; Tue, 23 May 2023 03:04:00 -0700 (PDT) Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34N6EqFp032516 for ; Tue, 23 May 2023 10:04:00 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-03-30; bh=axCAgLHvn9sOYnh0UKOYDPSfat6hLHRl+pAWTrx+9gE=; b=1kv2vZpk+BcEL95Mn4CVApjPW1mw3YE+3AUqwvs2Sd+4eDr4qHvKG5XtZOi67C4+8Jhi MqUlpN4bKOGhVFGTYfUj1NkdIwcngVBhWqYIG4YEzg/S6sKrC+IfBPjpM6hfyes4llJS c6aycVn2W4r297w+qu52VFK3Ct8M5Ev+Aiu8MnhxjyEP0NSfTTp2LxdeKfmJujtafFX6 rGG11pucC7ZDOwUnkchf0X01JypCefRRVfveVfo4ZMW5z4USp39VBM9MYUxKKD/4A1H7 iUxI7U70zNHSvq/16/Li1ldOi6FB6JmfGuy1L1fZ2uvyEHW1RDyCOIAW9NBxd7KOGTXg VA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qpp5bmrg0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:04:00 +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 34N9IURi028664 for ; Tue, 23 May 2023 10:03:59 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2109.outbound.protection.outlook.com [104.47.58.109]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qqk2quhav-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:03:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mzRqf0Q79Mh9W+X2QzPo1zfFHed7EcW8RBgOy0WNAqV6BjYt/1ywC9dR2Tq6XPcGs5zI3MdGk02jeN+fAq8zxuCxCYyXyzqZTOAS6MaaKD76KQgZD4aJyUnMuE2qKVPVBe4cjW+lJ46cU2ACp5EuIOeJs/z8MZ634STrmVIzNZ7pc6X/19m1R4XxbefZQrwW0LHgOyiOsUdqdstEUc2ymEeWCgKoD0V2MVgepMsKvxfmiOT8OstkfMmVxzZRTU83d5PY8dffKkeD5FlelKvRB/FW0hlGcxQ+6l6MbK1Muu8WHQggV6fQV8S4seCfEawmxNCDi5qwgzaxa+UOVJtlUg== 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=axCAgLHvn9sOYnh0UKOYDPSfat6hLHRl+pAWTrx+9gE=; b=db/ErHFOdxPEAlI54brnaqql9eo4b/BH37ZCJf5kcS2hv7AXZXJnDBZkt+hyVvf5yzlyU/qy0LeXc1BhC88IHxhv0V9vkwGH096itaz4M/cxEV+ZFxCXK/8BfbkDBFx896lM2PIHVflxH0bsviX/Dv72pwmzs3Rabn5s3nP1LC9+F+G8l7GGEwKPaxARw+ZwJUDD8DeNmZR/yPGZmMTfm1+YyoikLL7MaVSmzukiy2osfP3Hi5YlP9xvGpti4VMvFj/8noSzeuzoWCsNUKJuM9p82E2C1bGyWVOpSCy9QLRk+hrWRB7eI/vtSHXSxEbOnuQXIv1EBulS4JCzwQ8Yvw== 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=axCAgLHvn9sOYnh0UKOYDPSfat6hLHRl+pAWTrx+9gE=; b=TmGVd1/3vvTyJigh2X9ZUJ9o3e/32PDZf9vls5GzWIe1SUcDIHEMxPjuuw9WgqzmnEW56Sn51mzh0o+sNfmuO7kRS8Q5k5BNG6E33S1nTtJ+h4nDxI2r/ncXOAjieJp5Pa72sMZs1m0CXbENnVBPuTHXOeB4Xhotaf6yM88DRSY= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SJ0PR10MB4416.namprd10.prod.outlook.com (2603:10b6:a03:2ae::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 10:03:57 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6411.028; Tue, 23 May 2023 10:03:57 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 1/9] btrfs: reduce struct btrfs_fs_devices size relocate fsid_change Date: Tue, 23 May 2023 18:03:15 +0800 Message-Id: <844fa765ab173b8dd24549f145534f41d412d3ea.1684826247.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: X-ClientProxiedBy: SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|SJ0PR10MB4416:EE_ X-MS-Office365-Filtering-Correlation-Id: 50c4c6c9-0e58-4177-4dd3-08db5b750613 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pzy/zIYfnORFMixOPyPpCwgLj5AYcAYx45zbz/Y1pV8LFLxfXqpD5+xqeKNj7XjM8DHWAG+rkxkIFzlD/w/vJA4pTQXsUwNANRnrI6yA3V4+5LvqC84l7j6ukNrhAKgMgLRlBWNbuL6o5dICbLcsJk2CGaWZXmWDhowZpa3DRHEPQiIVDmfss2E+wd7gACxkJqTxzCq6TtG+mMP9Jm56+Rd8Zi5fDFnAUURncRbjyJ+o72Z2iylF67HR3XGofKl6beFy2yhBrvFVSLPeI1VyWdnJG3tAJARV7gc2TWhdkFIldHThLzLpNEagNVIuYSW44MD7UG+uWe6vqznq2iqNkMuoPQ4gDYpCacy2/kwqQobld8clR0cOcnsZvXpA+nFPGCP+I5+Ny0rVOvxd4hOMkR1Fxz169LNvEi9jp7Am06auS8LiLyEKe8lZMHBrNHMtCInncduahPIPjaOM0m6GhXZlZL7gRifDGHnF5m34jb0zEuNms883uwyXt+gSN/Cq5BXiO6rf3vXZyEmygn8tLRHbaDhyfSSvGkGyt6OdyLqwjzZ/aCqcJGDmlXQUchWR 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:(13230028)(396003)(39860400002)(136003)(376002)(366004)(346002)(451199021)(8936002)(8676002)(5660300002)(186003)(26005)(6512007)(6506007)(41300700001)(44832011)(107886003)(83380400001)(38100700002)(478600001)(86362001)(66946007)(66556008)(66476007)(316002)(4326008)(6916009)(2616005)(6666004)(36756003)(2906002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fLOqZMdyZXV6/KPAXgKPwYGHi+FbfMVmHEVDTLNiMbgdoNmJK3Qc5zvgbEgKZj1bhQ6UilkKxHS5UtoQgS+240TfPAo4SMGag+6Ql/q2dyrS5CO2kYSGEskjdPrcbzgu51+c6wKQXCtppnAnVZbS2vbWGPofZ5PJAYfcori6CzDx22RIrkbCjcQowMXJWc6pyW1OVrBu15A/U42MnWtKqL52uNrjRouZs8NrmzxK0zDsxQu/vwTEoZjZpizoonnJoe5HzQZoAVZjgwrZCD/aqj+yCXXqFWoXbn/vsOsJzQm6DjEFcJiiJG8EkaNEeTnXrQvA86kuSgC75qX3AgzRe2IRGspxa0SY3kMpju7sa2p2exhgoxOK4RR9KbQWh8r3xy+rpwadRCoRI6EvewKqg8yf9d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JzV2Q8geHX1y6q7XGQXEI/Unft1E8W1HKGc8pyauWyA58GKap9zK5Zzv2Qk0JOt0+YQVv+Z3byV+EEbN7hhagV7JmQkqdALaXYKrqBNXBA8+uao7y7URsdp X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: zUbOaQ5H91/ORwWuaIN/mlCOHoxwjO0lutaJNoqY1HFqt1alTEpl+jpsEuvQyFHc8EpxPR8fKWE858FXQHci1+4xuVht4dVEzYVO1RdNt76uz8ZSAlKaUaUKBvHEFM4OwqR2GleOfIsKeaDrQ3+4qC9XCKyPzdwPqCVrKejIUicXcLNaopFksaL7VHJ60LsHpXWbJBwwjp2YfLK9G76U1aaOWBSGxvadZXPtC1Ago0JfsxrnLF85yCSJe6mMtt1wOYfeMflvq6CNUedVOzMKh/MN7wPR/0kUS+31RBGFl2V6e7dpRq0GRZwqcEjceMtTy5xs/CHuOx5P8p+a5QBBhCTvBvvP80wh2LKPk4DEN9HTD9cLtN6T+K0eonnWAVIVF9GooFpJ58P/nWrNvbVxlwGaXgwjrGQEpGA/jFXRN7jKRPID8kDSiRJlvojXVTWPuNbBv3IZvc6oEnBgUK/GZJ5RX69VaICoui/6SFjQp/7hQSK8X9B0s6sl8YGeb3398RXx/tIPrK0uGrVGZReqT0/4hyqYWsKBxO2irNg93XeChOlyhtypFgmyXQH84bAq6iCmVOvrBF+T5xZrmyVYdZTxx7PdmWwyXbV+au98PTK/46dIfInCgLdQ6SOrgHhb/aq/Vzw/jIoHsDz3CrbqXxY5miztTkfjWpKsvFOTvB+l8mkkvFgM26ffl5ydrh2w6F28Y5H3Jm+6VGd8DmYZUIDcmV3j870uiWbZhUn5E0x9htGjkxg3JmXbJAZFW80ANHv27B9G6XxBN3GZiV+0iQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50c4c6c9-0e58-4177-4dd3-08db5b750613 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 10:03:57.7361 (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: TfojEyapMwfstl+xsVdPb51NVGGn897D5j5wP8wBFuNPEboJIpQsFHiDs7D3nLRNtKV+FAW2OaM12ot1UyKdfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4416 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-23_06,2023-05-23_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 adultscore=0 mlxscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305230082 X-Proofpoint-GUID: 0cKMb7sbShH1_rQqRxSfvLYUVx8vGTuO X-Proofpoint-ORIG-GUID: 0cKMb7sbShH1_rQqRxSfvLYUVx8vGTuO Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org By relocating the bool fsid_change near other bool declarations in the struct btrfs_fs_devices, approximately 6 bytes is saved. before: 512 bytes after: 496 bytes Furthermore, adding comments. Signed-off-by: Anand Jain --- fs/btrfs/volumes.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 5cbbee32748c..a9a86c9220b3 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -281,7 +281,6 @@ enum btrfs_read_policy { struct btrfs_fs_devices { u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */ u8 metadata_uuid[BTRFS_FSID_SIZE]; - bool fsid_change; struct list_head fs_list; /* @@ -337,17 +336,24 @@ struct btrfs_fs_devices { struct list_head alloc_list; struct list_head seed_list; - bool seeding; + /* count fs-devices opened */ int opened; - /* set when we find or add a device that doesn't have the + /* + * set when we find or add a device that doesn't have the * nonrot flag set */ bool rotating; + /* Devices support TRIM/discard commands */ bool discardable; + bool fsid_change; + + /* fsid is a seed filesystem */ + bool seeding; + struct btrfs_fs_info *fs_info; /* sysfs kobjects */ struct kobject fsid_kobj; From patchwork Tue May 23 10:03:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13252004 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A8C0C77B75 for ; Tue, 23 May 2023 10:04:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236416AbjEWKEX (ORCPT ); Tue, 23 May 2023 06:04:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236481AbjEWKEK (ORCPT ); Tue, 23 May 2023 06:04:10 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5943A12B for ; Tue, 23 May 2023 03:04:09 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34N6EiPZ031394 for ; Tue, 23 May 2023 10:04:09 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-03-30; bh=g95br+fVOYIQI7UtH3/+IEwJNdttMe7Q2GN3EgiiyYg=; b=cmdPjzTJYi/Ujw1Gm9r9YcGJac4c+Yapinft5j3XtU1LK3uSurFVd8zflBsP9C1O7DdS JHWWUxfPO92BnWaewsqdBN/C2MEBpnnzABKk5IFhYAZpmxGPLa30k1VxJiownHwurRYc a3HCaubn7tNwhzoFQBqmtdO1j7fVVbay7ccwA+7yYmy1U8RWD13JJjgd3DNgeaDIp3O9 aH5hFKmpDNDK47//ekt04pHpsEcnWZcjSwDIVqM2Hlq0sz4bPislopBgveMNnifn7b06 YEwhrpVech6ZWieKseGTO0BpuuZXTLlZzUaXhy/XaboHbUVgQXmkdOcEwPWHtafyX+dX kw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qpp3mms8c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:04:08 +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 34N9RCwL023798 for ; Tue, 23 May 2023 10:04:07 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2104.outbound.protection.outlook.com [104.47.58.104]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qqk8u43hv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:04:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RXpkqvDQx/gVp98BJfjIb8QwHsawQp1G5eA/zmQm1R2kiDQdzGizPMQDG3zmK8euvmSGuX20T3mHlPv4Dzv2w10loJ8DMGcI3+23X4eb2o/CooI2dsvZi54arcuQXsCfLkZhCDFFm9Od2e02oyH3i+jPfEjMV02eyv7yxfPAz0K2GGTis/z5OvmMOhd6jcHmnzGV/BZQq0Ar7o+Kl3Miowpbbhb61G92CQCFxLohwdZ4mgKPkmM9w495EBHXHwjbs1hIqC5UUKcStsxh7DWfYHT3Xe6B84kPrW1SJY4JZxled7M3lhYS8vsBEbWgozO7bsbZBBjK094lIt6I8Zticg== 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=g95br+fVOYIQI7UtH3/+IEwJNdttMe7Q2GN3EgiiyYg=; b=Gmd+T2EgqBoqG2gQus6BWltwAOHY/kpBZgNKocNJaSS6ry5lo8hBsGChgDHCJKqxTgvNN8YS54y/z88Yi023m6AN2HtUoyqGRZPEenz+P8R9DNgO0cyp8M8DFTJNf7qaT9s9d7H2eEV18seciYWxZ1giaLNd2SyO8aa6vKeYu5J3VQqfsKfShi+SsjgitAKpK2GkAqPLk/LHmTQFj81IVuhuea1lgMoK2AITDweyNqVrDbvd+0PPYJ4xBKDwJ99ExAht9uBWe47km7ry7PcsF71fCfrhzULDBAIYu+5pJfvGCt1kJeueOo0OxMGzvkHxZBjfpDxT1YMpagxFKukhqA== 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=g95br+fVOYIQI7UtH3/+IEwJNdttMe7Q2GN3EgiiyYg=; b=fkG6fSVhFbOVy+DanYh3frQ5OMlwCJK2lcwoH9txDlaWjgX0SBzpofyv465TFa1BwMP3yziBjugAqF3ATQtYBoS3HQJxULuqn5ESzq1lixMNRJigtzXgPLcp0waKuHgVyZeJt03lXaMiYJpiCefilc8gvGdkp8XQ0ZoatNDsrWI= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SJ0PR10MB4416.namprd10.prod.outlook.com (2603:10b6:a03:2ae::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 10:04:05 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6411.028; Tue, 23 May 2023 10:04:05 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 2/9] btrfs: streamline fsid checks in alloc_fs_devices Date: Tue, 23 May 2023 18:03:16 +0800 Message-Id: <5113dde5d6f756818885c39bc8ec6f5b8e45ae54.1684826247.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: X-ClientProxiedBy: SG2PR02CA0125.apcprd02.prod.outlook.com (2603:1096:4:188::13) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|SJ0PR10MB4416:EE_ X-MS-Office365-Filtering-Correlation-Id: 614868b8-3269-4c26-266a-08db5b750ada X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1kbHL0T45Zek5ymXxO2xKQzNrOCka1GYfVNjHgR5HMzVqo8OuhkrpN7UAJrnmUd1Oh7ToDXlUuV0BOAhwMyiOZCHqyMiGyTYdZQYB3KBufSzx3oDX8hpKvtIO2+jHwE1Z9EvtGEHzbNo7adTuIZ0D7RF+Cf8zdzR6IpSDuGWxvgP9n3CNlOnv2sk6u3DIyLU43VrP582HeUN39MjTOD5Ra813HKUO33PhS5ym8MXkyTfLhqCzKQk99eOy7zMX725+ZyWFY/HtbYVL7Hv8pXKBD6oknGl3a2XQybpzu2MS+goHjxUWzfNwkPU3cHV6oyn8/7ZduZ6Dt8Oa4PNWWUGMKnyup/DXmIUwxgZSQRMim6wkeyU0g15OHowt77053kT9/B6RDVMxrZiBELC735Ivtq/WmdbeZatQJA7qX/2Zhf/K1/V6BtR4mxzlE25Dtm29T9Z5YkRuxrOgfWjg12JPycytrlpg26b/Y6cWwmCdAlWiC+JXmUz+Zdaqe30c+NvQTsnXgPXy27Enc7qiWXO9KJod2bUFUA/i0cGUnseQngHIqKaBBlQgo5wD9OxrrwT 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:(13230028)(396003)(39860400002)(136003)(376002)(366004)(346002)(451199021)(8936002)(8676002)(5660300002)(186003)(26005)(6512007)(6506007)(41300700001)(44832011)(107886003)(83380400001)(38100700002)(478600001)(86362001)(66946007)(66556008)(66476007)(316002)(4326008)(6916009)(2616005)(6666004)(36756003)(2906002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9ypefPKzeD5m8SYCMZxDRmwB97tkuUCBu6KeFc2LOXAolSRetNUU40sx/s2yfxoj4HwdYeBuqrXEpqid+CDwN9Ulm3ylb4PNFtMxo6lqIF4md0ja011GWEmH25hLL2UXZDCskk3G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EB+L8ggrOEdvO8O9VFhVTfYaI/EPuB8pDi9UMcO/AfJRMr6TT96yRqhfo+322K5CsEga1C3qK7HaJFVXlrwXVIbiKHKbwpH23Bi63j9Dym9M5pUbQvTDShfdNgxECZbNus03d/emCyTOSBloVbsRDp1lPy4AnfYDsv2QmCtLnZsBj6wx4Gm2WvguRJekUfgs1yNB72kcMq2WJjyQLPrx9RooMNtoao0kRdxxJg751zToEpAVnn0RNvBIOKYkGkPKqStduX8lduAztgUJGz3zOsYMlVoCMz33cS/0HFsx69UpVLd1Cwt5j/Ka+zuF638eVALv0zW9crlJQPGlEYFNn4R1cRXjBau9vcwOO8GKfyQtzUTv4H X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: KptP55/OaKuext+6tI/WVYzfvhPxy/NjD4WT1yqiy0zn4zK3u/T2L3nEVAjlkrudoQ4Zx/QwJ0StDoZoWN80GC8XOfKYWOujJrgiwegkZjjUk/npwo3/YI8kD6f4KRBISP4louAIio85aEHJJrRd3MZMxgXfViux9T8OFMoev+vcQbdeDilzMe4qYoJTJZQuvijkrPXcW+/B3zaLoFlSCv3VlIu/b3NCgauzoEBdPGdpgTFnq0wUlGlHbeSLXe/CZCFELMk/MvJVhXCczaxvfsGbUXf662X+tXezvDxaPWaXf5Qc37nRiRFHIKlaHYE41EhJ/tzp9ICnnkJ6/aA6RofSUZrREvU7dnAVKcfOQFEdTV7MFA6wX2nBdR/fLttJ3KYEq5LgBULUdtJxh2UMfj8JgsAJhTXF5Hf7jJZkuarOdUXJusEhMAX/kVhCaDRU1D4gQOIhtw3s/SUgNSPLIfntIPNiXtzr8tNCW/2DjO4JSSZdFFK5ul2yAv9CR+FVIf2VSlNQVqWcI3RE1vdBHiAU8pW+B4g58CndtKkRmDhJ2geeLys+eEzUgoLfygiIKIktW6lzk3FkyzvQhGtujVxd1L4AM580CduZGUcabiEvgo+dFKcUK36csYQo6W63rTSBCBtk0gaEdCI8vtaZqOMsdDMxcAyO15lTWKmfbG7lGThEHdgvO78j4EdImGjPHg/RfRcf5Blmfq4rO0eIcIlhLavPb5IXprQFCIhQ/OVEnrR45wcvXZb/qFRWDqXD57lnM2JvYA1VRmobcGFcPg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 614868b8-3269-4c26-266a-08db5b750ada X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 10:04:05.7590 (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: IY3jmwiJzpEEJBGM+/M0cu3TQWIHSlKIafS8ssT+cuHkSbA72rhB9KOG4kdJ2G7JITxGR+GYsWqUEL5ZGeV/Bg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4416 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-23_06,2023-05-23_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305230082 X-Proofpoint-ORIG-GUID: vu0j-mta9hVYUR3kQf4LUD-SmymEwrJG X-Proofpoint-GUID: vu0j-mta9hVYUR3kQf4LUD-SmymEwrJG Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org We currently have redundant checks for the non-null value of fsid simplify it. And, no one is using alloc_fs_devices() with a NULL metadata_uuid while fsid is not NULL, add an assert() to verify this condition. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 1a7620680f50..6f231e679667 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -370,6 +370,8 @@ static struct btrfs_fs_devices *alloc_fs_devices(const u8 *fsid, { struct btrfs_fs_devices *fs_devs; + ASSERT(!(fsid == NULL && metadata_fsid != NULL)); + fs_devs = kzalloc(sizeof(*fs_devs), GFP_KERNEL); if (!fs_devs) return ERR_PTR(-ENOMEM); @@ -380,13 +382,12 @@ static struct btrfs_fs_devices *alloc_fs_devices(const u8 *fsid, INIT_LIST_HEAD(&fs_devs->alloc_list); INIT_LIST_HEAD(&fs_devs->fs_list); INIT_LIST_HEAD(&fs_devs->seed_list); - if (fsid) - memcpy(fs_devs->fsid, fsid, BTRFS_FSID_SIZE); - if (metadata_fsid) - memcpy(fs_devs->metadata_uuid, metadata_fsid, BTRFS_FSID_SIZE); - else if (fsid) - memcpy(fs_devs->metadata_uuid, fsid, BTRFS_FSID_SIZE); + if (fsid){ + memcpy(fs_devs->fsid, fsid, BTRFS_FSID_SIZE); + memcpy(fs_devs->metadata_uuid, + metadata_fsid ? metadata_fsid : fsid, BTRFS_FSID_SIZE); + } return fs_devs; } From patchwork Tue May 23 10:03:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13252005 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6766C7EE29 for ; Tue, 23 May 2023 10:04:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236358AbjEWKE0 (ORCPT ); Tue, 23 May 2023 06:04:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236355AbjEWKER (ORCPT ); Tue, 23 May 2023 06:04:17 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E62AD109 for ; Tue, 23 May 2023 03:04:16 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34N6E7DY024594 for ; Tue, 23 May 2023 10:04:16 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-03-30; bh=8PxtplqlOtSNhUrPu+NECbIi5Zho78ZvS1cbMOBIAHo=; b=vpjElfMgQCg9vHNBofiecfIiK6E2DpAUVqtGahC14bdaImjtT1jxzM+wBFhqQGEVOW6d yyr1HRElsZ3gGTbTg2wR8mxA7OGM0bkZcUuq7uqOCh0ibshg9sHcXjseC7v3C6d9KJ0b j8YdyOWdD7yBlFxc4TH0kbbH4QZdMCzD1SvgJGfWXe8In7hZsen4i/3ahGGtBqm/YtAf 2STDN2pnEs+EHu+axgAYIZfwlE+k9Su86ixeMObiTorxxS2dENFJrm7nBEh8c+j0M5u5 RSg4rf4zcKYAxzEZy0wHv2taQafvbNRyV3+ugT349xbp1mS6FTz+4BQOt4/wV+7I9TLT Iw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qpp7yvqnr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:04:15 +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 34N9AScG028899 for ; Tue, 23 May 2023 10:04:15 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2109.outbound.protection.outlook.com [104.47.58.109]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qqk2quhmf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:04:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kFrEkUlr8WfEUglqmxNdHVN9eOCdnNgR7yhCwfwlFTCQIJdzhcz5b3CDIoh3TNu97XII9ueGxXdrkvDnji85K4QoNgRWRM5eapk+CVoTRl19rQk8g+KXJX7Gk3B3R2jZ4hzF4XwhYXJXwxcyPIlmHghTv4dW+b5XfKLoD7rHMPfjw0irJT6IWry8+OPS4AJ6XtCKuxKHiIRxPMC2R+JqMF7ToX6F+pG1bUyvZJptK7ncBl8CMi+YwyHp+oX9gXwksxI9N/adpNK8w03GEiU1GwLkXjMA8fDWWCJCcub3364en+vmJBmzvEElUoK6QKnP75t17DV8x3LGNsEdOnF1rQ== 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=8PxtplqlOtSNhUrPu+NECbIi5Zho78ZvS1cbMOBIAHo=; b=j0o05QVtKbd/r/iamY/LAAvnUBTYXcEHrnMghaNhmd7hFWY3QW6ZrCU/gjHZia9nHQ4a+/l80WpT7NO/uMUJx35+tNbgjrFWuhR1sge7tUttH8/SgZ1sPWAtihItrVpRCX7m1G2LBbWHAb6HZpPPAxrp+KgZIMRuK7b29c3a9AkFyzHGkS2k0anRYXGYIPWJJVb7PR4lRgy0MFr8A+zfRT915XK5YfRpqK42vmw6ym5OW4tOEr7/f/8JgOAbzgVd4jV80wXNaBybYsKh8B2Ur2Euv45L3lK8HsyJUmSyPslZzwfCaaYMaS+Ra8GVYUb0L7O3XtB2aq7rh4HDrVVV/A== 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=8PxtplqlOtSNhUrPu+NECbIi5Zho78ZvS1cbMOBIAHo=; b=dY8kmZlLJnz7k++tsCIfPqYGb3fJe5lbp7E4I8KvZ1JxVlvazPvpAsjmoIuYuqNN+16yUzUZNvrGKPgMIb8zhaj3nRiQDpEvWu6VuzJL6vZ8/tUr4qR/N6Vn3+XS5KrFRqYQ6sGeyu3sRQD/aoZFKpTR2Vn09ejzTxCbn8aPvFE= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SJ0PR10MB4416.namprd10.prod.outlook.com (2603:10b6:a03:2ae::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 10:04:13 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6411.028; Tue, 23 May 2023 10:04:13 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 3/9] btrfs: localise has_metadata_uuid check in alloc_fs_devices args Date: Tue, 23 May 2023 18:03:17 +0800 Message-Id: <346ccfd4aefd8077db8c0c908c53718ee5090b63.1684826247.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0194.apcprd06.prod.outlook.com (2603:1096:4:1::26) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|SJ0PR10MB4416:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b4fb30e-6e73-401f-e137-08db5b750f3c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cIX1wBowffqXEVSEMfeh18iAy1LPEXL1LtIlnEPk+Mu+W5Bceo+e3aNfkDJWsizJ8ThBGBf/wDPLrNZbZ2NZJvwJZelEf5yGiVtCDyOjyDk+h6XpAWEkIUbw/AEjby8iJJjGY0CrCzCyoPr27DxiyEEvvV5efb44H7Lyzhi5ZdbBf/G0nLHjQ1elXm7wXITucEobeFHjc9E3JNsUW4b0zqiMoi/kaq4/c9XT00/wy44gr5L0G3ZCvptuw8efCUNygoIa+70WrqqFt3ptugQZUKzNnB6sewuYA5wkJqUG41gxPyCmczOW/1syJJzssqn3AiZUHnIN0E/hXGpB9IXmL8TDxW04yRhPX079czrekmaW6KBDtTSfPe2L5zXm3i0SfMw9F0hGIEFe37SJCwiq+kMyZr6YK9xDeXO7Q9oyDLJUwKbTCUZOWb2E16Pc+hz1uQGgyl7R/7z2RuxiDSwEHAuDmIuFDdmYJU8O1/51ZjiyDfT0SNjKWVwv3Ch97fyH/lfjyD9IlZTODGh0kSpj6fh1PETT8yGUkEbdkF689mx2o0YUdsuXpmP/B8a4wptu 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:(13230028)(396003)(39860400002)(136003)(376002)(366004)(346002)(451199021)(8936002)(8676002)(5660300002)(186003)(26005)(6512007)(6506007)(41300700001)(44832011)(107886003)(83380400001)(38100700002)(478600001)(86362001)(66946007)(66556008)(66476007)(316002)(4326008)(6916009)(2616005)(36756003)(2906002)(6486002)(4744005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qrlyT/ucVYCGfDi2ZzodDPiFEX9acat6KdZ5WHU1edVqax/U4zV/poEsLoEFMJX5/RXk7SR3l5ALEFN5YbjRXt2SDOg+pH4uIvA3hOm/Fb3RPPjOaZBy4jTerFmiGIDBFcR4E5gRIDfIs28fgC5vUFy6Uu/THjlo36irPqV7vai+pbSZTpLp7ifcSVWkyqe5ovkRy3Q7QL4gbZS64BAcEh+CHoKtrW+O2b87hIy+qpH4STDe1ht2Cby3jvuy5Wyl2rJESNHNFrmmNVIBqQXFWmE00GQLanmlro3co8WUcmbPG0/s18wfYuni2XFGddl+auujvKYjI+7W76/gZoF5ilHAC7fSXU20KpDKMfw84f7OXxVy+7ZZ4tqNPLENNj+0YSYj0WDcPMobL2S8WJKUJVc9xR4p9KVl7ZltL6rvtGiMZImPceShVACE+b4wF83TNavoc1gD6Zz6mLcfBDv1hT9SA0GD56SAEOEZE9v+PBi7TbRr6f2Ci+A2iTG1hy1JIbM19hdrEk1ky6LtfrKA1GTuPadhzAmYb5f27Tsp1Sq/gZrc2YRxrEIMrGqbv/zSVuR2ggsmL5QYFWvZDepsmD0opSmyFjdGXltM8rP6xElVtXssac+Fvgvm4MC+AwRvPBDeGb/cN0kkPy2JjD4TLK+VNpcsKVyn7/43Yq6HyC74zLQaZuXwCQUZ5mg9rrfBszv6hb4892MtwlCBghgd+epoaQFVWv7kfeFNVQz1AuppY0IZCsh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ROPDrRYHFftJYss7iLpkBCN1LVWa3Sfgjd7jHiBS9FLyPrWA47Lt4+E6p6RS05fgex29uskmYCQtyvobK1EpcFFjoKc/Nbgo5BN7bVB9cRx/I2e0/SZwpHjBIohkx1wpsTS2hl6GuqT/QAsd7Iwd0ziB7O/vMPBLJWZc4o4Zpw1pHv57VffK0QLDaw6ITJ8w+sR1l+R/cCLLdFLPHTYnRxM+i22piAcgdqVJwe02vQI6pW+ZysXWR/6A/sHamt7K4I3JNz57jOoXdBq48VYlv/F0iCMwzZtMVLjmoIL1oVdZtzBLv3zTcV4h2BMlvf/hv+9Vq8eHJ2mfZcCpA6QmHFPLBmrXpj/AmJY4zfnmXa19uitJ4y2i/O9RwKLzBPlvsHY7jqNDJVOAmyEfPwHe+cyCUE7db73caVDLFy4xolGakfTCnmWjT3jqjo35sbSd0/rBxW4NyhgAbD3BM3cJSqKUJZh+J74HwB9yOwbjC3ximp947B92JyedogQOHIUleDyBDEm6JIDHdf0QjaRNJt/jMYnujN/0J3lwSYfbeCnlQqLBlVJ503oETa7towsFdYhco9UJHJ8axvUBEcDwFZv5AdBmcJAOdiqnuTRXZ8uSAVuA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b4fb30e-6e73-401f-e137-08db5b750f3c X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 10:04:12.9634 (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: 7Idv/NpYMUxbHY/+tvPSAoKD4RenCfApBpvM4pN+JzXXIBUFPGZvnsWzKVEjsfir8jd0DoxSRfRI6G294RnZQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4416 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-23_06,2023-05-23_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 adultscore=0 mlxscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305230082 X-Proofpoint-ORIG-GUID: hINL0J-H48rNVD0ngl2AEdXWBuV7P1lb X-Proofpoint-GUID: hINL0J-H48rNVD0ngl2AEdXWBuV7P1lb Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Simplify %has_metadata_uuid checks - by localizing the %has_metadata_uuid checked within alloc_fs_devices()'s second argument, it improves the code readability. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 6f231e679667..95b87e9a0a73 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -791,12 +791,9 @@ static noinline struct btrfs_device *device_list_add(const char *path, if (!fs_devices) { - if (has_metadata_uuid) - fs_devices = alloc_fs_devices(disk_super->fsid, - disk_super->metadata_uuid); - else - fs_devices = alloc_fs_devices(disk_super->fsid, NULL); - + fs_devices = alloc_fs_devices(disk_super->fsid, + has_metadata_uuid ? + disk_super->metadata_uuid : NULL); if (IS_ERR(fs_devices)) return ERR_CAST(fs_devices); From patchwork Tue May 23 10:03:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13252006 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A04EC7EE23 for ; Tue, 23 May 2023 10:04:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236442AbjEWKE2 (ORCPT ); Tue, 23 May 2023 06:04:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236216AbjEWKE0 (ORCPT ); Tue, 23 May 2023 06:04:26 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 570DFFA for ; Tue, 23 May 2023 03:04:25 -0700 (PDT) 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 34N6E8Fn018876 for ; Tue, 23 May 2023 10:04:24 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-03-30; bh=wDFkkPja6zb+0DI10NIYa2N70njoA5Abmu2d314yNTU=; b=MOyxubK0zWrty4G8oXBEtwcmPB84IhCP8FQx1fCRHJhaj8ioFKNE71Itko+erW9EBv7l ofWob1xi0SLcuyA2bdvjZ972E1LB87u13ontmd2va66dFKHSib5TJgRxN39z3r221Jpr nKkG3b0TlxfpDGjxobJ4ozfrklzenb+SLjF8tmshJdN21zxOm0S1ITBXMTxJG2h3xemB i6akZdaFIPbVJw9sEhcn75fx5fcem1/DpKX6vqFpgADZ/RIz2LiXq5JYZJ0des6GulKQ qOrXCgwUX31fZgSPquRnGgMyVOOzRy8VdYKg3PycMwziPE9ozRvt6j6E+h21b0GWqqt1 Rg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qpp3qmqjm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:04:24 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34N8QbHS027108 for ; Tue, 23 May 2023 10:04:23 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2104.outbound.protection.outlook.com [104.47.70.104]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qqk2dbnat-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:04:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fDeEE8q1cQu/W8Us7KPbybBliT7q2QD5E2m0zMu6nVigSZ2iqEt3EYVhwiZ9guuTXaAM+C6jGP5GdXbY15Nx/iV1R3sUP3r9Tf8pnYn0FBhdcrbEIceJ8XLjmMV8i9eWu8l5FvulQfWpfGHN8t39JnjR9DKE5LdgDfFqeNneuE7iAPzq0mCTuNqoj+8NyhK2ReYWGdDsXWpcYtQvn7P3ohIaVPjpruloXtk3uvIikl31HN3I8R+6X7OhsO65DHcU3QHZSJCfjmfg2r5PLVe1bblX3C6KM998KC1yhOfc6LTkbnO4SbZXHcz+6Y3kVD10nQyA/uk7IlufBLETNcFwow== 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=wDFkkPja6zb+0DI10NIYa2N70njoA5Abmu2d314yNTU=; b=AsQS+kwuox4/F+qA+Xo5+G8oUJBKkT1C4FsJhfbj4JF3Fttp33/S8+2eEGxOzewUyloCXmRi2RIWynZaBXGyCJHSm/lwI88fyzGhLMCB/2k1h8iOH05h4nNUkvDUpFXqu645rD7JNLC7M5jrH9iXu61JufRVC6HZUKywc2rt8N5kELW8vD/nzEsrEiNV2xTfpIMSzlPQKtXcBc+l9bZbsAoia2CeS+R2M5H2DpkP7iNHSAfComtqLbeprmr/h/qKvsxRk/HodA9RMZUNa+/UwLSRcI2UrKpcSO7vJPfK8z/e4ZBU65/eNngujIO4o0m+0g46sQHAqGh8xyLeTa8mQQ== 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=wDFkkPja6zb+0DI10NIYa2N70njoA5Abmu2d314yNTU=; b=AfDpKWgC0E2lk9Kz2N05m4JObRT/mGzOKHLNQmvigWYfxhGi+w+rXQfBMuXlX1/p7ZTrG8aUpNemyj7JEhqI1YYL2oQi/PHS0if4mnTG+04DqkbLv8d355UtgVqtJ0KTDzxL+kC67P6qysd4e9jwZHv9KG2BQBjUS/I/ZkkM+x8= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CH3PR10MB7305.namprd10.prod.outlook.com (2603:10b6:610:12e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 10:04:21 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6411.028; Tue, 23 May 2023 10:04:21 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 4/9] btrfs: add comment about metadata_uuid in btrfs_fs_devices Date: Tue, 23 May 2023 18:03:18 +0800 Message-Id: <3ba05b04df59f1549a3026326ff4a70d6abc302d.1684826247.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: X-ClientProxiedBy: SI2PR02CA0024.apcprd02.prod.outlook.com (2603:1096:4:195::18) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|CH3PR10MB7305:EE_ X-MS-Office365-Filtering-Correlation-Id: d2f2aa1f-f345-4b53-e387-08db5b7513eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a0fNkN7mePtWws+fUt+0iuA6fkyGswrDjaWTFXo1hpprfmp6+Wc+i54tj3fyv4DhkkcRwqQ72NIJFTGOTu51XUw7pvuX/ajbyK43jcIDOR7VEArr1F2JMqmhgoX5lpiVPF4o6o9tZcuqoMArfN6hI1cDzB3GudJKT+PT1n0FFepynLhbGZ1ueItxXjtMzAcYROA3m4pgXHqoMUEO1D+PbaplNmgeUOqPJODan0I1PKvF6FGcntY6e46G/VfRepHg8+jxmrAOy30KQH9UU8bL9JhD8VsP7CqrKDdy+8rLBT1lDs0+6ZcQRbrhFCjNkyHpUkGYX53BC50f/xdgqP84gi8lh+1bLLHxdwnnJQay0yR3+MmJps/eiOAalsdkwVUGEZmAX18nsXNJlApAOI2xhs2d7Hu0q+lKgmBc89w0aTY8aSC/6HNqiodz/JpxZ5shsmHeD+xbqe0jwKgmZqJcPCI5VvWK1+3qRwZ06/g8R9x5JDvSxOyvP0Ccd9Lvfc7it3RfgTJ3dEWQo3JmJcSH0TxERNz2C1FUL3jB1cy2aP+1lGY3LFXdn6bXat8xUu9/ 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:(13230028)(39860400002)(396003)(136003)(366004)(346002)(376002)(451199021)(478600001)(107886003)(6506007)(26005)(6512007)(316002)(6666004)(41300700001)(6486002)(66556008)(6916009)(4326008)(66476007)(66946007)(5660300002)(38100700002)(83380400001)(44832011)(86362001)(2616005)(8676002)(36756003)(2906002)(4744005)(8936002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hq0DjE+sEAy/aYsu1CCH2lOcZTtZjhjpIF2s9fWD6haVruWfEUtCqcyaNMd2HBAUjc8MnkW5W97+IR5cuHVtzVnSzDDC81rJCq3FpsFe2k5kHzz1gwf6eycQdUJ259G1D5yTkKUMXIEoOtMGP8KxXXJE7Bmmg+L1d6pweXhRNPXqffNl0896nOHdIC7hgs8fFw53/8Ov6gFXAIvz65MZku3tjiDfUZXgnS87UzlLbUW7uScLu/Hs2JIM28Xy/1FbwY6eoFVQCIeZ8V15NXluZgOJW/6zX+LryWJkBUpjWKPnnJWKvZgSHR6Ii6OBCKbHgUqNvMEtf5UL2Q8ENrteEGyayOHdYDAMfnceFbGJ6qe4zxyiJsTs8mPLrydWrjcWCBfzHZCoKIgIrdlM5jsxOR5C/r5El6d2fWGq3pOAW0V0lJY5XCTssuh8Vx/HmbjuqJRIuIa0w0m9QTi6h8cWTnI26bPGmz2FIgaQOrzmYw/JKV4a0N9SaN4wubmzM8E2lpzmffDRElKYqATIDAliEZasdkpAjWr7gso9ZJ5aul7t7oEmdzf2vXPP5HdzYAUppPhD9t8Z7c3i5RffN9jtkjYC2bg4gfQsKhsdbPsYnVV3cNCK9GC631zd27U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sSt2jUL42ELB+SwzsRirwKCwj2i6O9+um3+9a8gJPjfYCAMbG1PdZipe14zQFBIQ/MFnh54tvUK+HUcgdmg9v/NbQ/rS+Ee3ct0Zoru+UBTkZnCWHdPtThvV2OVTEgemYfsz+Wgd/DnO5Qplb4lj9G4ukc53/KTrvhblJn8ATWuhJRXkvcOJRoWNESKd7o00XuYjclbPAXaGjO0to29uMrm/eM06PIAA23WhzqGVUu1ncYUY9NqahroZ7/4WuPqyoBvnmPwFI9hjkoK72+YbdN1PyncQ/WaW6b++K8Ir7lnF6sl/BEZ6SHp4INAd6ZsE/qp+gp2RJXbrIjQDk+ttas19eD9T4Q9vAUlnx+lrcoOrShMcaOvpuqoRKrKUhWpAVWWUn7iqegT4Hz1f+mUhyZYTI6ofD6gA342CnzQRTVeThJF2KFbBlPAOb3D1wkIdHXSWxq7T1/3X+rgsOa6dc26ZdWeT0SXiHgtnmZlJQcoia/U5Iqvh8f+w6EWf0PeNZONJ5wMPzIwND/34pX6cqXL2HpxCi9AgnRv5jIn0tN85qv53ugSZmZIgi/CKn2zB5+IMRt7FJNEfZUXMIpHVGkeghXCvnMNMOaK3tg3gRKRtsRCN9j5QnclW5ZpUtP2eTp1TZ0g6JKXqmuXH9USiWsIEsJfmoutg6ivlqXtS2xoYLHQZ5+Q+FBVRZqWpYnEJI6O07sO4kFOQXbi/33CWepRRbOPWhXngNs+ODYs5RLHg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2f2aa1f-f345-4b53-e387-08db5b7513eb X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 10:04:20.9827 (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: I5yphP9SrGEx7EeGkeIQCjLrClW5PHZYOUv+j6fwER/gICS3f9ZbTW4BFFEJZg11hwxVHxlGdo4ECYLeu5egJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7305 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-23_06,2023-05-22_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 suspectscore=0 spamscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305230082 X-Proofpoint-GUID: aNtLWCxhqugWPNFOFERZQBet-vXZlbWl X-Proofpoint-ORIG-GUID: aNtLWCxhqugWPNFOFERZQBet-vXZlbWl Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Add comment about metadata_uuid in btrfs_fs_devices. No functional change. Signed-off-by: Anand Jain --- fs/btrfs/volumes.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index a9a86c9220b3..35d135bcdee4 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -280,7 +280,16 @@ enum btrfs_read_policy { struct btrfs_fs_devices { u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */ + + /* + * UUID written into the btree blocks: + * Relations: + * metadata_uuid != fsid must set BTRFS_FEATURE_INCOMPAT_METADATA_UUID + * metadata_uuid == btrfs_header::fsid at all times. + * metadata_uuid == btrfs_dev_item::fsid at all times. + */ u8 metadata_uuid[BTRFS_FSID_SIZE]; + struct list_head fs_list; /* From patchwork Tue May 23 10:03:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13252007 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D283BC7EE23 for ; Tue, 23 May 2023 10:04:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236216AbjEWKEi (ORCPT ); Tue, 23 May 2023 06:04:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236433AbjEWKEg (ORCPT ); Tue, 23 May 2023 06:04:36 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07AED129 for ; Tue, 23 May 2023 03:04:33 -0700 (PDT) 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 34N6EBYh032760 for ; Tue, 23 May 2023 10:04:33 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-03-30; bh=usOaIb/8khGQpw9p0brW5cE47hdw4XEC+Fis+aKvWys=; b=kLbXxvqR4DcJh601dC//xQBc3UxsFgy2VCFvFi8tfl96/Y1HDX5Xo0dA8tSSHOLGtspx UcL0+SL7J6yMVlZ4D5drIH1Fd6INJEuI3IUOSJXmFt1Jwm3EeOAaEilghNuiOJN8U4pu 0R4mgv0IclrcJLuU7ZjnyZnw8S5/pkFr24ynseXtdlyYvUcgUambhNSzB0uwiv4bxBCL te2J0f9o2NQf/MAEaeYd871KJGhaizIv9cGovrdC+F11EKSo9AzS8WJXxTxli2xiyIlk ilB5DuNGWgHM5m+rk4Au8c+wEoOlFpRzzlCRDEud06qGgOyAU6C7C0+vbjb7pJGwRHkp Nw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qpp44mp76-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:04:32 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34N912np015800 for ; Tue, 23 May 2023 10:04:32 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qqk6j4023-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:04:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jDVfxB+Rkto4x1XPbUzwbaTJBt2BocuGfzJUlgCsiE4K5LXGYp4qYsrL/F+Ystb/agp2cofStZVLzwoiJaNd+cmwOJsmVRcZVKiyYKqpdP+RwFKQhKgW7fXc+3PDE5mpj9F75liuaZ8UxqHnIPRTC7q1FpQnHGp1o5TTrRcGsQ7tPiE2CsTlR992rXJY9rIv5CZzhXocoaZiuUDN+Su+hzvxJ622DA0AiUcayka3VPDKT1r8kVtZVd6m4YfSWACh9hbFdUNmvAsS+cQsHKSwuu75P2UGySWv5rw0E+mc3gmGqew72eCGoRrVUlp9oYRpgK9hZOHAYQkvS26LJL+tcA== 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=usOaIb/8khGQpw9p0brW5cE47hdw4XEC+Fis+aKvWys=; b=UbvLAkcml5xyR6oULwSyeAyVVesYFVrAChMuvd2wWrSxr9c1pCYIZlSBxXpPSKNIHDB+VLjmMIKNC2jBmPfXJLXrekvfatzxbuEioBVZQLuhxL4jTqpy7pAHfBxKs2rVEX0JAjT18plFGqAekbJgER3uOzj0DI6TxTJZO2M4ZliFqApEfOy+zkXt0ufnEAmZK9LyIoPu17AcxSyvYVy2cDhS3h+XWurHG798jZAZpx4YJFSRtj0G17CTx2pV+fsqizeV1LLaKXkf4on+LXVsfjjFJP0xbQSu5zH7qaH988QK2ikDUwJVpsT/KexgMlrnYJPdsO60liK+cgV24KKRLg== 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=usOaIb/8khGQpw9p0brW5cE47hdw4XEC+Fis+aKvWys=; b=NfRc16Xx+89fORu12SGFBNeY2ADQj2fuwvNie4Fl1iI7P9lH1efENV+MPjqyYZMNUtaiyd/cx1FxjJVstYpOHQ6eIXGzocnOJ9oU3lym5kxUA9TXhKtv+x3Ehye263Nvdkt4P8ywKaCcWZ3ZCFghtAFzXwoMmuXNjsYjAUDdLTk= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CH3PR10MB7305.namprd10.prod.outlook.com (2603:10b6:610:12e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 10:04:30 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6411.028; Tue, 23 May 2023 10:04:30 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 5/9] btrfs: simplify check_tree_block_fsid return arg to bool Date: Tue, 23 May 2023 18:03:19 +0800 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: X-ClientProxiedBy: SG2PR02CA0034.apcprd02.prod.outlook.com (2603:1096:3:18::22) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|CH3PR10MB7305:EE_ X-MS-Office365-Filtering-Correlation-Id: 540f6714-b4c0-491b-06a8-08db5b7519ad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W1oOrq/eLSaKUQ6wRW5fIY57sZyZ8UTb25oTnBhaXf1hm4B/Qflzvrqa8cGqq6XtE96SYkImjrpRb7S/0/tcmnSIFYOkxZNWMA+1wTyioBAd1CvME8ihiUWoPV+MOwkB0v3no8OYuwzeIfXK3BkCMI6oNRkZYyBocLED5B2SYQW3n+oYaPJAPpsPy/xLenUaoQV43apKlwNAHv5F6IA2tkbW4gDSv+0Im4UNhUqVrf7/LjoRD+c/05oVn8IUdYGRnOa+0FMFJB1WTIsgVmSt2RO0dkXF/crsaz4IpfqERlDvwZGKxh2ymDQ2ui1tBmEkOY1a62kzlyfB+WtXUJpMFcavaJup9C+sIjHhx2ooVc4TIDWRV9Q/LLZ4PZVRvFvr+K3rb3CEmoUwcUfXxHzyRaBdefDzBfQxbktUcIw9fNl/MAdR2mH+0ASF1477kEnsT5IFcICbZAZmsgO50yQZp6iDucD9rDQbjJxXiK/MGScEJ602zNuazKNFg5EPJ/PbfUAZJ87nRnr5jbxnCV0lKdBfPNIBIZRNtPQuRzFSAQQ7zcafiMyeZ1VNIWqG9G7t 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:(13230028)(39860400002)(396003)(136003)(366004)(346002)(376002)(451199021)(478600001)(107886003)(6506007)(26005)(6512007)(316002)(6666004)(41300700001)(6486002)(66556008)(6916009)(4326008)(66476007)(66946007)(5660300002)(38100700002)(83380400001)(44832011)(86362001)(2616005)(8676002)(36756003)(2906002)(8936002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: B28+NDCOdTFhyb8dRK3ZTTiy1+5QsE97/uwH9jNf8IX2xzuOk2TL3aFK+UlHNjlZ4BiCoMLccAsiL0XN0QzeportrJVKIKlqsg1bAWEhQG0Gc2h7yft2ODx3j1ogpeXWioUzEkZhvSzQblMoHAvCXDwtkVqoY+ZW3ppkLInGU0oh25yo8CAsQq434o5lsTIT2xTntnwuO4NIoiSdNyAFXWIawa91UhaPLvbhxXnOqnhS2PUfpbUauJzo8n1Ia12JT+nr67c5VkzI5xJcS54y4mfeRQxrBPualsqCVbhJj1iUhz4BpNB5Y+BfEOsOdmMsr2d2vU4lKrgBchbGPc3DVZaQvhaEcHK2JQsOlpdM6AKMPMgFOvohzCj9kRN96pLUgAN7k5AuyRbmtJJFCwImzJwKRJbmX+VNIEDf3aWFA7Uvp994cgBWFM8nktYrCVx3Zph2uuoP3E6WkS76t3iZas6BwLhpfxLITyBE0OKaT+6HAIuxTmslk+msc1DBzS6GIcxNd8wglr12uzzJG9pouiTYIWZ3WH/D3uCLEzGT4wwZrSw8yHHoQMAzpHu/IUxznQl+3aQu1DnJjQ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ntiSpam-ExternalHop-MessageData-0: GB2lwvuXDiW810rSuLE48u2PF9tb2PZ1DpSsBNjWHsNfRq/2daUhh3eB77lFTgfzaLyLm9xmo7rXq7xMrCW9o8m9ld9t6HybgQLoBTwbfpx1xkza8teeyJF3PNRGlFKdX590aeTEZ+1YrSTP6RiBv4OU2EGPxa2MTGkR/VqO5mc12EEz8obySOJ+P7kh+SaN0IBoHE7JFaOXpcRl1BF5rbyiFv5VsBWmP1LJ+MQJdZhXbQop/Dnu84P0a/SGR3uwKaepDj77Q7PFAS6HE05R+Hb2etgk8vAM/XosdOBkGFG6iPMWVGRF9Sm+shPXA/sw4Ka/5gPp+MujeWM8hrrSQxb0afA8wJQN0yJ5wSOWTHs4E0kUMtdShLJRXbiyVq9K3kcGk00vMGx51NIBb9ifJG6CSo48K2UTXTe7QZA2xngNyBwTVQZVQOSDjucTh4eNhBOq5R03Gdo6C4gchHB/kYHPphWVlCXCTHnUSzSbSXU69I3wXJM+FP9syYvfnC9t6m4BBrLn8Yp6PhHDHDPmhEweKjfBR1mvO9Dv/A7Xw7tFC8Skzan474gJgrUxG7ZK8xBfYSLCLzTMDUEVqBd1eXvh+1Fchus5KpFx792uOJJom9hBLYXXMlaboHei0VcoOE+JnwkYFwuNd6x75tbD32Exe2H8tG+FWLGzC3VZ0UuXsDKfOPza3owt3xej4M1HLnmu8wn+gbgYqzN0EMj5YxKvyXZIVBXx3qUAMVQ7syEgrVtvODJlHaczNFs+E7M8dArdiFyyitMKA3qUsQqZlA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 540f6714-b4c0-491b-06a8-08db5b7519ad X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 10:04:30.6083 (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: NTcClTqjVGOtxCI+p3jOBsm4ELPEhYZbnDczwMtSnJH0MK9KFcTA651JzWe/gSvH/Mz9gyvNGPavHdD8k1gCew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7305 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-23_06,2023-05-23_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305230082 X-Proofpoint-GUID: yAM6v1wkx8GExnLChMDhWRiCQxJc4hFs X-Proofpoint-ORIG-GUID: yAM6v1wkx8GExnLChMDhWRiCQxJc4hFs Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Simplify the return type of the static function check_tree_block_fsid() from int (1 or 0) to bool. Its only user is interested in knowing the success or failure. Signed-off-by: Anand Jain --- fs/btrfs/disk-io.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index dc2ad0bf88f8..5a3e92fedcde 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -396,7 +396,7 @@ blk_status_t btree_csum_one_bio(struct btrfs_bio *bbio) return errno_to_blk_status(ret); } -static int check_tree_block_fsid(struct extent_buffer *eb) +static bool check_tree_block_fsid(struct extent_buffer *eb) { struct btrfs_fs_info *fs_info = eb->fs_info; struct btrfs_fs_devices *fs_devices = fs_info->fs_devices, *seed_devs; @@ -416,13 +416,13 @@ static int check_tree_block_fsid(struct extent_buffer *eb) metadata_uuid = fs_devices->fsid; if (!memcmp(fsid, metadata_uuid, BTRFS_FSID_SIZE)) - return 0; + return false; list_for_each_entry(seed_devs, &fs_devices->seed_list, seed_list) if (!memcmp(fsid, seed_devs->fsid, BTRFS_FSID_SIZE)) - return 0; + return false; - return 1; + return true; } /* Do basic extent buffer checks at read time */ From patchwork Tue May 23 10:03:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13252020 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38E87C77B75 for ; Tue, 23 May 2023 10:05:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236326AbjEWKEr (ORCPT ); Tue, 23 May 2023 06:04:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236269AbjEWKEq (ORCPT ); Tue, 23 May 2023 06:04:46 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7192A126 for ; Tue, 23 May 2023 03:04:42 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34N6EoMH011162 for ; Tue, 23 May 2023 10:04:42 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-03-30; bh=JkUW1mrjjsaaDG9SHG3r6zU7U9IcDMLgY25r+GEG/ko=; b=BSNJbxBhOTIHw1jNijuY0edBcqnBWyVRYQkysPANZnhXGJnFZdlnB1hKBsNtwO9uuq3c PurmnUuD7xC4Ic1m7lBgOhWVXiaAsf23usL+SNgqpd+b1QNYm12mSxy14P8M9pPaD4uu Yf5pZNvA6QSDO9NHvYrZt6kRRRAu6mUlnaenR2Ds8z2fannm/by0iORLFBwxXWUvmuHg cYlJmvAdUX7ZnREfe5nlE86cI9bi8vIJ4Tnik3gefBZLLi3PCRFxImrW6MEV0fxkKPJI dvqRA7dywytQscQe6SBQZYkbzi1OjzE4fTC0eXauSqcqsQTKq6aipz0OuKVEjDX/1ElE IQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qpp424r3e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:04:42 +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 34N8SYTH029085 for ; Tue, 23 May 2023 10:04:41 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qqk2am7gh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:04:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=huoMHFWjONW8Dk93PJos/GOJvdnlNAJ5s2mbX1nXqJVZaLsojMh0zYEPBgjaCtkIuyIA6JDz6JbCDbZ6dwkaXj3VFihMIKfbMHXJ7iwJhJOzzxxZxQdEStb0i6Kcr0Q+osk8CV2w4+5cNfFRqfC297KTV7qlE0K+udRylbQQIGnZ5TgieFDl4QWKQDWeWKni2SZwuXka9pw9oYGYa9rXG4IodVF+Vz8b9abKywVUhWup/fslqR0n4t6rsDtO7j0InI/sH+g5QIfA++pNpibI0MtZeM3+OelPrK7RREWgizx1Ks6DqZlgptJI8LciaGoCKAdCj7EEmZ/aW023DBDjIQ== 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=JkUW1mrjjsaaDG9SHG3r6zU7U9IcDMLgY25r+GEG/ko=; b=mluoN02boJuGLW232y9tOVYHDiIl42DS9uWxGuJZj1G5zJZNJI1+yMyPqXSQvclR/u1+jMqqumNxkqpnH/fyvm0VX3xFluRUWLS3k5atS/mTtJAoW0/vX+4fDKy58LgvqyZLJlJPyU4TY/rV+nxFs+DawQWJih+kosa4xn/EOO2I1x5HWuCuF1oKOuKQfnXZOG+sLLc9EO0DiGtAnlyJwJH+YOJ/PZ1bkrwHOh16bYGcOcN23nLLq63b20gesbTc6La06vVGqHsnM2ZMHxm7lyMftQ14/gm4Ny+9uAybTDah0X+IAc+/24ra/JepX/1gqZzKBJWafiBQlsgFubXuqA== 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=JkUW1mrjjsaaDG9SHG3r6zU7U9IcDMLgY25r+GEG/ko=; b=y4ae/XvI42416SPzznxnGhicL79sdn+k7CFFH1Y753mSqjG37O+DojGliieQNnpxMW16hX3v/Z4l0R1Hoo9pCxDnrfv7KtO7CNJ3QO4a36NkMQTdiU9lchxbRKcA2fOwo7/EGTwv8LZH7+IenXxVk81ZiFI49b3tQyaLOBIgE7A= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SJ0PR10MB4416.namprd10.prod.outlook.com (2603:10b6:a03:2ae::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 10:04:39 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6411.028; Tue, 23 May 2023 10:04:39 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 6/9] btrfs: refactor with memcmp_fsid_fs_devices helper Date: Tue, 23 May 2023 18:03:20 +0800 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0222.apcprd06.prod.outlook.com (2603:1096:4:68::30) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|SJ0PR10MB4416:EE_ X-MS-Office365-Filtering-Correlation-Id: 95e389e5-d42f-4d54-1148-08db5b751ecc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r6VubQ2RaHhrCUzAvxowUksQuAs984hI5UwziUEEAAEHpujHBy9XmOPZ9HVlHJjGeJGExplwG2LHGDdc1N1kjGTEU24Qqrrx46pUVB16Hff2Bu8PyMGszYVT86+m9uiOjp32DWrs/yAEuruiZxXo7c3Jw5ZSWO7Eiw99XTfhCLdb3dQ8XF/xc1pajUwW/Ouf4cS1JJm7ceOfI5khWBBCkGoX1dscUxNEsnTDnNLvO1mhsSnMZu6+b2LlRiIfjw/yXfBFG1D+qG13AyHGapXNblbw3vaX4j+2OoVBxX3ea06mv4zs4YdGYHEjCYkKF8zJnGICGOW5KS91yPE1EYeJ5AjHnpctaNSurcCyTGR34pi8bLDpTTkaTayjTFZu5gvKcZ6DSsjbXLr6LTnw4ff3OBaVS4tgolXUP5HeXo0x/2IvhPkkudTjcy+t3GNTA8NeuAOG9hfszV4jED50uFkVs+Cvme22OVlxDV76Pjtv90TemazYMWNIgXvei8YtE1NW17N4N7jUtQUYpNyb9YEFSpfWd3U9Qs3K725XbHRfa31iQxQzCxoxP9jS4tgnNVp8 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:(13230028)(396003)(39860400002)(136003)(376002)(366004)(346002)(451199021)(8936002)(8676002)(5660300002)(186003)(26005)(6512007)(6506007)(41300700001)(44832011)(107886003)(83380400001)(38100700002)(478600001)(86362001)(66946007)(66556008)(66476007)(316002)(4326008)(6916009)(2616005)(6666004)(36756003)(2906002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 23c8gBS2KVdJykTToM1B63Ea11U4U0vvApaBMJ+lyCJb3kG9PKGVhtpID/LS+Mr0/QsIdEHr6SOmafcsrpBGBCyf25ZeTKTnfY+OdexkqdtzZ8H5tt9ZLhLAVnPDECvh25uU8OGjUOGIzFfc6GqfOByzkxgebgHDjRRWnX1D/XnPfVrBARFTTPs/FEaNX2kHpAUOIzF3rTQdPzFXCbgqAB+bk1Oo1z/Q6QGyk5Dj3Bkoqy/UdfkVIONhMIOhRbILlfv0jLiMydy224/rHXzEC2iwLx35gJVYsYSJCrMuVznGhYdpAccuJKLzZGK50Hpg4zN3noVSU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-Exchange-CrossTenant-Network-Message-Id: 95e389e5-d42f-4d54-1148-08db5b751ecc X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 10:04:39.2235 (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: y6l4/2eJKf3voZ9bNPwQP2zXbT/29MIJkt29hv8lmFN8RZDHVXDu4MBTc1uWrjZs5sZgEeXz5OZGwEqhx+Apyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4416 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-23_06,2023-05-23_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 suspectscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305230082 X-Proofpoint-ORIG-GUID: AH9oHUmFgeSYMRTi6fdLUK0e142xV0So X-Proofpoint-GUID: AH9oHUmFgeSYMRTi6fdLUK0e142xV0So Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Refactor the functions find_fsid() and find_fsid_with_metadata_uuid(), as they currently share a common set of code to compare the fsid and metadata_uuid. Create a common helper function, memcmp_fsid_fs_devices(). Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 95b87e9a0a73..8738c8027421 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -427,6 +427,22 @@ void __exit btrfs_cleanup_fs_uuids(void) } } +static bool memcmp_fsid_fs_devices(struct btrfs_fs_devices *fs_devices, + const u8 *fsid, const u8 *metadata_fsid) +{ + if (memcmp(fsid, fs_devices->fsid, BTRFS_FSID_SIZE) != 0) + return false; + + if (!metadata_fsid) + return true; + + if (memcmp(metadata_fsid, fs_devices->metadata_uuid, BTRFS_FSID_SIZE) != + 0) + return false; + + return true; +} + static noinline struct btrfs_fs_devices *find_fsid( const u8 *fsid, const u8 *metadata_fsid) { @@ -436,15 +452,8 @@ static noinline struct btrfs_fs_devices *find_fsid( /* Handle non-split brain cases */ list_for_each_entry(fs_devices, &fs_uuids, fs_list) { - if (metadata_fsid) { - if (memcmp(fsid, fs_devices->fsid, BTRFS_FSID_SIZE) == 0 - && memcmp(metadata_fsid, fs_devices->metadata_uuid, - BTRFS_FSID_SIZE) == 0) - return fs_devices; - } else { - if (memcmp(fsid, fs_devices->fsid, BTRFS_FSID_SIZE) == 0) - return fs_devices; - } + if (memcmp_fsid_fs_devices(fs_devices, fsid, metadata_fsid)) + return fs_devices; } return NULL; } @@ -462,14 +471,15 @@ static struct btrfs_fs_devices *find_fsid_with_metadata_uuid( * at all and the CHANGING_FSID_V2 flag set. */ list_for_each_entry(fs_devices, &fs_uuids, fs_list) { - if (fs_devices->fsid_change && - memcmp(disk_super->metadata_uuid, fs_devices->fsid, - BTRFS_FSID_SIZE) == 0 && - memcmp(fs_devices->fsid, fs_devices->metadata_uuid, - BTRFS_FSID_SIZE) == 0) { + if (!fs_devices->fsid_change) + continue; + + if (memcmp_fsid_fs_devices(fs_devices, + disk_super->metadata_uuid, + fs_devices->fsid)) return fs_devices; - } } + /* * Handle scanned device having completed its fsid change but * belonging to a fs_devices that was created by a device that From patchwork Tue May 23 10:03:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13252021 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B85BFC7EE29 for ; Tue, 23 May 2023 10:05:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236487AbjEWKFK (ORCPT ); Tue, 23 May 2023 06:05:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236535AbjEWKFA (ORCPT ); Tue, 23 May 2023 06:05:00 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D49D94 for ; Tue, 23 May 2023 03:04:59 -0700 (PDT) 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 34N6EBse000311 for ; Tue, 23 May 2023 10:04:58 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-03-30; bh=kbl4jLlabfg9ePPYlhHR2x+o4Td/3XXoELqq2Cn8JL8=; b=jrwXIXeTwd1s+py62YzicIqaN4NNgvDFFVQqECvwXly9hi8/lfZDFqO0adZofbfYT8fp FekZTr92RWCi3xUAtsdiBeCBunNZ9IKbQ/iX7MLKkxNb5B4/t+PMuv2tMX86jIGxs2Qu yu8PhUd51bcx9FCc+eQPRMskWS9P3Gja4a14wjVBka9FirLY2zKigh8jqzBky0W4r2sq UrAgGJA/tRRd1tpwSJODhIb93ISRkCyOteB72Nhg8R3ZkRJ1w/maC1Tqhz6HIlmiZgjo J/JWpPseivFbUmpxwuVmcLIFQuIk2NJu3EAYGQiGUAPHwtHdVa204kEeGlpmIbXJEUJN Qw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qpp44mp81-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:04:58 +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 34N8xAEf023642 for ; Tue, 23 May 2023 10:04:57 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2171.outbound.protection.outlook.com [104.47.55.171]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qqk8u44ea-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:04:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XcVd03zI8yycpdOiYg47qo1jEnRADFhZy86FQNNa27Atzu1KDcXGxy0Vdo0Wc8vAnthSDMhL21hdYZg0uvsMGe7ZDgZQdlXYglxO6hElaIRfPUVPE5KTCXzHXFr6v9MZ93HKgCi5BVTxJ8T7+3nGW6YPnMusx8opk1GJVLD7+OfaRing5voAUpCL1q3dSGs5P+nd1ATotzYT8MlXeq7WBwfz0XV+STFdoHObTiiOBvz/76nnotd6nxpMyOWGjvoODhYO2oYuj59nqq+QS8WwwcEUYD3zll2shz3I+EOYiyNLLKNz7O19sh0YQ4AWaK9SlyBeJ6zztnh6nInBgJhkvg== 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=kbl4jLlabfg9ePPYlhHR2x+o4Td/3XXoELqq2Cn8JL8=; b=HPKRm0y+aV10Dsi05fFztxRkzojIRo13/n2xMnLPM/DOnmHW/nG/+ocjEQsMGo4shIVIa4zK2r7voScLHKiIvP+aXBFPM8dCoMYRTE5NHUbitoMy1tDJoMSwpWIQt297DYyflQFlHL8o3GmxKP4i0Ogj9+9uJRgYpIv7A+e4OeKD0jneL/GK5mA1ANhqku37795g33o0LLaUIWmmS5xeP9Vef0zfVaGS0Kx/aFuc5Kacq97wIrTj59rfhcQ6uNz955HStuO5y8XEQkq/iPmW0zdWGAtj86U3/Yw/+Aua5AJwQNDBsce9X7H2SuLQ8n+Fq8vduQqfTysD2y+OzozIdA== 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=kbl4jLlabfg9ePPYlhHR2x+o4Td/3XXoELqq2Cn8JL8=; b=g/0YKr3TjO+tllZ/8L1ONgL3j8UtbG5GAGy6Pevlnj1Di+GZZW0twJb3lF/X8x+2GnGH+WgHCeCXwHbkMo9GODGyf987aOT53zyOkriA5vvcMkTIdXsSZmPNcgjrMvC/xvm+UQBgk7Oo0BLEHAC5VDZOeKBLbHZoGxnXJL+beEg= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CH3PR10MB7305.namprd10.prod.outlook.com (2603:10b6:610:12e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 10:04:55 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6411.028; Tue, 23 May 2023 10:04:55 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 7/9] btrfs: refactor with memcmp_fsid_changed helper Date: Tue, 23 May 2023 18:03:22 +0800 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|CH3PR10MB7305:EE_ X-MS-Office365-Filtering-Correlation-Id: 033ec4fb-5c4d-4cae-454e-08db5b7528a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W7KL9YOMhHvVY7uoD+10wpVlmgJIAo1p3sqwtrcnXOsRHQMJtRx6PYsZ5UwlOC8lyTUdC0POhwcs3pMEdWTgAV8zYHYtpWEO+kui+kTQrOKWAQmgGhl/nbyV6voD3oRqIxdqDZVzlHnrcO0hquFEfg5E1rQ+b3v8EeKEMPe5c/MykqUQ51EcoU+S5Ns9KsebbIwSXK4qPO8+tOKlJFrEjaTT/fu7+vNqUuBwl8VNanQBJl0iUFTsGS/v8USZ94ConNIhZgWfz7SyO2+gNRGMJU8P5km/6ZDwwntqEA1oCl52lsHHITxiPVNbNEkQ117VLZ9QSYz4NKAU89WibKLtCS2ExEbUWxto5P+5iHXOnTpCxUkXahAmEwkASVT2ioaFJxdECajX7oZJj3ZKZH/JESzAWj8OBc21PuhlGldgso/utH7OgyOXVym2sD8ZHvIPxu4JfCbmLPbxs7TwyXnsjYVj7Yh64QFLAGvWVpBFSWEPfSg1nJ3/88y2C+Y77MK2M0T7/67+ZQBy2V4EJTS6ElK3VQzyq/VTf9dEf+U6fOAZex8qwvG+a6s/CmJ9IF2u 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:(13230028)(39860400002)(396003)(136003)(366004)(346002)(376002)(451199021)(478600001)(107886003)(6506007)(26005)(6512007)(316002)(6666004)(41300700001)(6486002)(66556008)(6916009)(4326008)(66476007)(66946007)(5660300002)(38100700002)(83380400001)(44832011)(86362001)(2616005)(8676002)(36756003)(2906002)(8936002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: v89gaJ9xQWHRK4aS7vjy4o8U1OogFIEN8yYjEbE2sdLJKOmg52mA7hDcjBaoQzdCTXXxe4u6MJfbNmsrbS2qr715+b1js3RbRCStXlMPnXTBI4/27YB3In4ALHv8hzD+0A/t/78IdlKVRzbvYGiGR5wOZsORH13Si9doSlpYlXYpnZ7sZCQBYzp5eY9SDVkA1Z81NOyvdwqFCgITEoe5C1fG4ZHIgxE6elP0a7kMqweC/WVa6j2bYd4kXwEL5vjpnsbHvOfMr4WNqtuObNISArEyqObfRNIQaxYvp00GOvcuz0VqZ8VLkFo/Ck8pzXdkuAZVITKlwxPcOkn0mizZgjp+5m0XTtRPxZHwjiVx/lFlra9MBtaWIUJUAx5bWb3aM7Etg3sEc6n7d1RJZ4qtTBvG1KcjATOWEtEpuSDFEitoX9SCeBrsNw0UUHEXJdFRM2iP5QYnYQBN28tdDY/H7D85KZG64FJXH36g1/EirE7c916sn64KSAWU0Pw0fY4GkbtQ4cAQrCYfEWtHb/9Rw8UNEEGcbKIkxW7hJdblL/gnOOklbpMCgJo/bp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-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: uG0sb3hSvtFTYSR+YryNQs6B+Suze7LXsWQnP+Bj7k/X53DbeMH3Gq7atPKscmVJ6de+jjOOJC6axrBVxglEMLVCF/sambeG39jdfExVjRtnBf1QFHVa7grN2CWaSXX96plL8xaKnFG59m69ylEBOQh+ZB6lVBDIJllsxrxWOy8HCRhDX5aU9Vuu2qar916LUzEthfInnVjCTQt5pH6HrgKXkyeavbCEHABfTQEMW1mYP+mbFXeDFQsgdX3k3ncotuJDWsE3LL0j5hLMdxm+Onr/dk1NgSbAi9CWftIK66mwJAIUtOm3ZOo4s655hPu2U12jqz/V87V+LsVoD/ITKjNWAD+rm2NkqWkOHSv427vWKAQO8z+RwUCKFifTW/9ZaOO8qHtFWd3m2sKRWd9oIBqnCN/1KK4nSnbBbglP97LqZ8WYVC9AliyPzquZJXB2G5KyQIkWzhGZzMvz9EAphgX6xMUiqpBkIQtkBtH4yGziCO/Z9Uqe9AJsSqiYf1B1iLr1qfhSyaixAlhzN585lwKW+ijDlAHSeAgUFGfoxElRFJsk1TpT9R6GgxzW8W9AJqZkzkTq6uR/RjSORw5YPJqnPYKK3luiQ3Cb7nKDADqYO22eHTcOLMNFseG1+lGXmrp+sISKByN5dVfzfXOf/pS6UgcdM2ozFor0yLvEykfQYr8MuoryiX8u5o8nhh0QMqXBX7FQoASj+UETB60u26Sfqp7DZUNRINLj6cvbMC2bwc0JRfaA4WGPHu4HhOf9Y5+E5vXnrYyL7TZ/JD63gg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 033ec4fb-5c4d-4cae-454e-08db5b7528a1 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 10:04:55.7086 (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: BkokJ/FefDFcCU9v0DJUeTR6Z3x2EDTDIWW7EBzjxJnIGzeAPb7a0FMXhml/TfVQ/0ZVgSu1dtkULXmoApVxgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7305 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-23_06,2023-05-23_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305230082 X-Proofpoint-GUID: CccVi304VYWf_SkFTCYGrh06lX9syhIK X-Proofpoint-ORIG-GUID: CccVi304VYWf_SkFTCYGrh06lX9syhIK Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org We often check if the metadata_uuid is not the same as fsid, and then we check if the given fsid matches the metadata_uuid. This patch refactors this logic into a function and utilize it. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 48 ++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 8738c8027421..730fc723524e 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -458,6 +458,20 @@ static noinline struct btrfs_fs_devices *find_fsid( return NULL; } +/* + * First, checks if the metadata_uuid is different from the fsid in the + * given fs_devices. Then, checks if the given fsid is the same as the + * metadata_uuid in the fs_devices. If it is, returns true; otherwise, + * returns false. + */ +static inline bool memcmp_fsid_changed(struct btrfs_fs_devices *fs_devices, + u8 *fsid) +{ + return (memcmp(fs_devices->fsid, fs_devices->metadata_uuid, + BTRFS_FSID_SIZE) != 0 && + memcmp(fs_devices->metadata_uuid, fsid, BTRFS_FSID_SIZE) == 0); +} + static struct btrfs_fs_devices *find_fsid_with_metadata_uuid( struct btrfs_super_block *disk_super) { @@ -487,13 +501,11 @@ static struct btrfs_fs_devices *find_fsid_with_metadata_uuid( * CHANGING_FSID_V2 flag set. */ list_for_each_entry(fs_devices, &fs_uuids, fs_list) { - if (fs_devices->fsid_change && - memcmp(fs_devices->metadata_uuid, - fs_devices->fsid, BTRFS_FSID_SIZE) != 0 && - memcmp(disk_super->metadata_uuid, fs_devices->metadata_uuid, - BTRFS_FSID_SIZE) == 0) { + if (!fs_devices->fsid_change) + continue; + + if (memcmp_fsid_changed(fs_devices, disk_super->metadata_uuid)) return fs_devices; - } } return find_fsid(disk_super->fsid, disk_super->metadata_uuid); @@ -684,18 +696,16 @@ static struct btrfs_fs_devices *find_fsid_inprogress( struct btrfs_fs_devices *fs_devices; list_for_each_entry(fs_devices, &fs_uuids, fs_list) { - if (memcmp(fs_devices->metadata_uuid, fs_devices->fsid, - BTRFS_FSID_SIZE) != 0 && - memcmp(fs_devices->metadata_uuid, disk_super->fsid, - BTRFS_FSID_SIZE) == 0 && !fs_devices->fsid_change) { + if (fs_devices->fsid_change) + continue; + + if (memcmp_fsid_changed(fs_devices, disk_super->fsid)) return fs_devices; - } } return find_fsid(disk_super->fsid, NULL); } - static struct btrfs_fs_devices *find_fsid_changed( struct btrfs_super_block *disk_super) { @@ -712,10 +722,7 @@ static struct btrfs_fs_devices *find_fsid_changed( */ list_for_each_entry(fs_devices, &fs_uuids, fs_list) { /* Changed UUIDs */ - if (memcmp(fs_devices->metadata_uuid, fs_devices->fsid, - BTRFS_FSID_SIZE) != 0 && - memcmp(fs_devices->metadata_uuid, disk_super->metadata_uuid, - BTRFS_FSID_SIZE) == 0 && + if (memcmp_fsid_changed(fs_devices, disk_super->metadata_uuid) && memcmp(fs_devices->fsid, disk_super->fsid, BTRFS_FSID_SIZE) != 0) return fs_devices; @@ -746,11 +753,10 @@ static struct btrfs_fs_devices *find_fsid_reverted_metadata( * fs_devices equal to the FSID of the disk. */ list_for_each_entry(fs_devices, &fs_uuids, fs_list) { - if (memcmp(fs_devices->fsid, fs_devices->metadata_uuid, - BTRFS_FSID_SIZE) != 0 && - memcmp(fs_devices->metadata_uuid, disk_super->fsid, - BTRFS_FSID_SIZE) == 0 && - fs_devices->fsid_change) + if (!fs_devices->fsid_change) + continue; + + if (memcmp_fsid_changed(fs_devices, disk_super->fsid)) return fs_devices; } From patchwork Tue May 23 10:03:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13252024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28194C77B75 for ; Tue, 23 May 2023 10:05:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236077AbjEWKFY (ORCPT ); Tue, 23 May 2023 06:05:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236497AbjEWKFQ (ORCPT ); Tue, 23 May 2023 06:05:16 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF9FC109 for ; Tue, 23 May 2023 03:05:14 -0700 (PDT) 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 34N6EBrZ032761 for ; Tue, 23 May 2023 10:05:14 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-03-30; bh=RB28Rd/gmelDbKdBRHvC3WTF8zQiCJJI4fK1bPgRb1c=; b=hAfS4B9jixwGSsWrraw5z3sV4EhoGD+/Gf3ECOgblXuu5sGS80Ht07Q7RdQxGpM2FyJp pSftrBGsk5bpdh/BzAenCiUOek6X2QgPEuYfA/ElRMaxdW2Mba+L4ZLCTG1Q2UN30ZqA XajJeCNjkRlF5LIu+y5MeDagJlRguTtWoOq43QiDQKMVF8sEh82GsTYj0YzkZmHyf1cI 7NIPKVPwUgIPULHI4ySFtMA9M+lkfx0a+BoiP0v7wmo4S/BGX76Tc/j7lRStl28YLezn G9XhdpO5VI2rmxqTGkXjPiNuzlg3UF9mwcB2KOb2dD6muZN7Zm2GIKOSqAgUugH5qjZZ 6A== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qpp44mp94-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:05:13 +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 34N91rt7023588 for ; Tue, 23 May 2023 10:05:13 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2170.outbound.protection.outlook.com [104.47.55.170]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3qqk8u44wj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:05:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EKH0smbGWcDtK+7hIsXrm1+dvtWIWg97pUb6jz/DfGEnxiu4r71waUGFQPZndGWBVwfauSztDK0t60TwIqs+/wwQXnMZEz0UJ9t7vhGdIMfyUk29Bfw7Cz4Ab8ZhS8MyBKMzfxitiGz+NGb3/3CuUza1QQWLbYmzX/X1sx2DhpsvlBIuKz0k8mMI284Ok7y7Enb7Ci1uJmD2TWvYReLH2wI3+HYGQRReC2B2u/ZRf2sf7D8/l0+6ORb1wrttYPjEG/nuiizpEiDPy1cUDct5FW5Zbh3vIQ1PXPhBczCKPK5mSmWYhSffOYJwe42HLR0TiWzgN8mtnfufwTL7QnUvNg== 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=RB28Rd/gmelDbKdBRHvC3WTF8zQiCJJI4fK1bPgRb1c=; b=HkUWHMty7GsFqI5IlKi2s/615B3NjyH1iQFvuAgMY+cbQKbMVQXGiUasWAR6HvEBvgG6RKnFuIqDesjeH+Xixjb9Uqk3mI397B7rTloJU3d2D7tfrULpbOCEZGXgeLyQhHEOFDuQrzkZlLsDXe8KmULJhvvETfPCahnmv1g1likP5+4myHnVZFHe+cWw7I8N1AEIV92LvOjFKmRee8C7JOUx87vBHzCEPoL2UpijSamXJjhENX2rcLrTYmZhfSS90/G5qUnRVar8ArLYj2lJ3oVD7a/7qVmRxYePuQyNtVCVIrrh8VyQbzelVdRdlCnj1x6Al/wkM8Eyl4zs/g01mA== 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=RB28Rd/gmelDbKdBRHvC3WTF8zQiCJJI4fK1bPgRb1c=; b=aqM5OEiBQxmfXK2FIgFRqGo/IKB2DANbzVK9xHmCM4wLg3UAQX0NjyTIZ9YHi3++8jGFVh0UMgVd70LdR2MvAFwrh80o25tsnpznyxQgdEh3EA/8HJcFP83TEF4icNWSjcsjzIPxdlweuTabpH3Y8wnE7CdW4Py72aRReMZXzDU= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CH3PR10MB7305.namprd10.prod.outlook.com (2603:10b6:610:12e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 10:05:09 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6411.028; Tue, 23 May 2023 10:05:09 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 8/9] btrfs: consolidate uuid memcmp in btrfs_validate_super Date: Tue, 23 May 2023 18:03:24 +0800 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: X-ClientProxiedBy: SG2P153CA0040.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::9) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|CH3PR10MB7305:EE_ X-MS-Office365-Filtering-Correlation-Id: f8c4c27d-49b7-4bc7-ead0-08db5b753110 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: st9NsUqZlSZ7R4EOp6w3LLy9vD65zd5tikUPlm5gr+HqaKIp2/mvWwhg3Z0ccObb10pXfBig97ix+pjENyHPplo1/vCIEemW83S/5Wb9SOKBeX/nathpNb8WNNx+gOQK2+vTL7cXXgBN9LQQ0DOcRqtrRP+RTOy+0rIrNnRK18gQR3aFuSw+7uJaRkTE14W841seiM7vwtXDL/0E7/houlNei5safIz9PbgjzRtSUaxZJmqJ2m7fVMqhFI2Hb07JwJMGBJxvMvZIaQw41GFRFmU/lHZV6Ut/QJM0ZZBjHbrVFKQ66hFMdWBNXSL75PHcXpORXJDoMvG1nlIG8JMVFvE/UejCVoH50FMHXLudR2wFk3PkwGmdOOJin1mvGtnZTtaroYdcax3x0M9P4uei6a/Upq8jISuLpWqsdNU/BEUADdHfH4Vrzwwm1wTVyN0O4RMMNRjzb0DALiDEeJ04xWxcywHz19cmHB8Hoa5dha2su1dpf11sj9bZm1/1gbWDnzayd1uUW/KAZ6wdGyJ//1Lvsp0UjxDUPAqFC1d80qqxlAj95or8o+3Bq863fsMt 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:(13230028)(39860400002)(396003)(136003)(366004)(346002)(376002)(451199021)(478600001)(107886003)(6506007)(26005)(6512007)(316002)(6666004)(41300700001)(6486002)(66556008)(6916009)(4326008)(66476007)(66946007)(5660300002)(38100700002)(83380400001)(44832011)(86362001)(2616005)(8676002)(36756003)(2906002)(8936002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hD1oUdndnQVL4CIfZm/GqUlWVfdXemNlMQ/QJawMXWxNIPaRzdXRYy4hezTNJLCAt9jXD6FFSXU87c0bolHbvSoUard6SPwlTwBPACYqV32yoxMVSv4HgwnOq92cYI89yxr2DucrquN7zj1g1Tk0JFaVrMwhSDub/9whH6r9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2pI/tZr+Z9YjQi08nFnNSFHcUYsXxjR/uIA0zb2zp6iKN0CcaWr0mFxhTCfaiKxfG8AZE999nNcSWUyWx0W9Rcis125N0R2B9O7PcmdWGgoPa7Psdt6ea3EHFzeDOiF0Ubh0JyPhpBQQujE1jlIP3mDkMaTJ24pfZTwL4b1P5dWaw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8c4c27d-49b7-4bc7-ead0-08db5b753110 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 10:05:09.7500 (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: UzwgHy5tc2nMIlVYERbj6D0NHoNVJoeR8ADW0YOSvKlCJo9rXr4BSzqpnZPWWSioOblR2nEqdIqo4R2/XOlWhw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7305 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-23_06,2023-05-23_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305230082 X-Proofpoint-GUID: _cvgN2GyYNbOnzYZAuREZ-7VuZwZiXsQ X-Proofpoint-ORIG-GUID: _cvgN2GyYNbOnzYZAuREZ-7VuZwZiXsQ Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org There are three ways the fsid is validated in btrfs_validate_super(): First, it verifies that super_copy::fsid is the same as fs_devices::fsid. Second, if the metadata_uuid flag is set, it verifies if super_copy::metadata_uuid and fs_devices::metadata_uuid are the same. Third, a few lines below, often missed out, it verifies if dev_item::fsid is the same as fs_devices::metadata_uuid. The function btrfs_validate_super() contains multiple if-statements with memcmp() to check UUIDs. This patch consolidates them into a single location. Signed-off-by: Anand Jain --- fs/btrfs/disk-io.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 5a3e92fedcde..85e75d84675f 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2574,6 +2574,14 @@ int btrfs_validate_super(struct btrfs_fs_info *fs_info, ret = -EINVAL; } + if (memcmp(fs_info->fs_devices->metadata_uuid, sb->dev_item.fsid, + BTRFS_FSID_SIZE) != 0) { + btrfs_err(fs_info, + "dev_item UUID does not match metadata fsid: %pU != %pU", + fs_info->fs_devices->metadata_uuid, sb->dev_item.fsid); + ret = -EINVAL; + } + /* * Artificial requirement for block-group-tree to force newer features * (free-space-tree, no-holes) so the test matrix is smaller. @@ -2586,14 +2594,6 @@ int btrfs_validate_super(struct btrfs_fs_info *fs_info, ret = -EINVAL; } - if (memcmp(fs_info->fs_devices->metadata_uuid, sb->dev_item.fsid, - BTRFS_FSID_SIZE) != 0) { - btrfs_err(fs_info, - "dev_item UUID does not match metadata fsid: %pU != %pU", - fs_info->fs_devices->metadata_uuid, sb->dev_item.fsid); - ret = -EINVAL; - } - /* * Hint to catch really bogus numbers, bitflips or so, more exact checks are * done later From patchwork Tue May 23 10:03:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13252025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 840F7C77B75 for ; Tue, 23 May 2023 10:05:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236337AbjEWKF3 (ORCPT ); Tue, 23 May 2023 06:05:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236154AbjEWKF1 (ORCPT ); Tue, 23 May 2023 06:05:27 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63F83102 for ; Tue, 23 May 2023 03:05:22 -0700 (PDT) Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34N6EqG0032516 for ; Tue, 23 May 2023 10:05:22 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-03-30; bh=MI4O0++kGUCDzJZwGiXxHRy8CAtrtU4f0DQ4c4mChAk=; b=x7U3cfmvzcpocl5EzZDt0zagqsHut+HoO+qhutdpRn7svqkYvk8QHJF5DSxw8ROAf7Q3 KsYiXTTepVFdQHDoGQEA4lCbYJfe6E59P2wQrqubRnNSA+N3jLEf+drt5u2Juyr7QJID oaDvnLoFpj6p2hTE8xZJvluWxaBuol9avU/Xc4lgJgH7HmbNdwWlf3VoWJ/Pz/h+Ucvd BZcpG9mxnnS+eR02BLA14mGW8nIs6n03zdlfqHi4GikwvjRDSmsuXVpLE97jc38xNULJ qpuRBalKVul6kucPz2ezqtiCX+lOX1CNUiPJfNxuPmR1M8aeTt2SarsXMEkUwlO3XhlM 5A== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qpp5bmrjk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:05:21 +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 34N9Bx4A028711 for ; Tue, 23 May 2023 10:05:20 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2106.outbound.protection.outlook.com [104.47.70.106]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qqk2quk5e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 23 May 2023 10:05:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TDfHbqxDHY1KVzc8pSuazZVFFcQDhZQIwDbchaql6oRy15cW7AgWquactcZ5Y9y/+YLoWc3QGr7T2HGhwST0kpxsDSG5dQHby/hARQ7v4ZIca6gKB6+RxGi6GdPtW50v9a6SNRfk9TaJOO2SClxoGrEN4AELBu6WXUNZa1JGPwbNJBOGqx2+EtcLVxmFd2bdxpOTeQ47IBNjwcFdWylfNk1SiBZO1x2F+KTTtkZiaPdsQCQRnyJcFfigM+ycMgxl8dqXSqTgZj/UzzrevD56AOTqJj/kyw7zW6guxh2BcfTPFxGJZr+5zyj/+cJJSSm2VpRFZxAdoyWa6unAbdEqqA== 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=MI4O0++kGUCDzJZwGiXxHRy8CAtrtU4f0DQ4c4mChAk=; b=mCKfZvaE0Km27QixQOtFJM0LXFu5XrV8ZFg10CYB9k8pivdWqF2emu0Q2pfTjTHoLyUaFu9sUVKQhMnleSnYXCodkgywYgrHvw6utlhVcRGHxHrAbf5T9ryOitAVsN9xJVhdXaDl6M28pKsR+w3/pRN9WwkbmC/KTI1GEUTI+veD3W6zs76a3AKus88psLHHpkpe3wt6fi+XYRzH3OfGFxP7ZMJt5lGfMhxSby/zoENHLWJDSxnJIzWcznfKM7tauacrSARfGpDB/OfhN0owiDEoOe7YOdl/7KMIsn71flfkvvtW1Buy4gsWXFd0UdqHk+sU+JltogYj/cW6ddjXmQ== 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=MI4O0++kGUCDzJZwGiXxHRy8CAtrtU4f0DQ4c4mChAk=; b=gqWOpbFLu8K2MxrbbbZFlA9SE8NPPskaWKJj4zBDJJWY1VflOyYHIribW5Wpivcd9v3BV0p2OczYCGtFF8ybQ3YzeJDqAeFkCtHVn9MduJrlZrGD3qYBh4loMpJM2r7vERcO4Z3jpddxXiNOyU3u5xcegtYJat69wRsFBUndz2E= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CH3PR10MB7305.namprd10.prod.outlook.com (2603:10b6:610:12e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 10:05:18 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6411.028; Tue, 23 May 2023 10:05:18 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 9/9] btrfs: fix source code style in find_fsid Date: Tue, 23 May 2023 18:03:25 +0800 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: X-ClientProxiedBy: SG2PR02CA0138.apcprd02.prod.outlook.com (2603:1096:4:188::12) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|CH3PR10MB7305:EE_ X-MS-Office365-Filtering-Correlation-Id: dc09cc4b-19d4-4ab0-84ac-08db5b7535fb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 46ONQ1LzhgrVFyeqk2i68QkjtvDsi3MVND2EC866XMnt3ESxi3ljs9Z8GjUgmBcd9G+wjxmNDf4XO8Yuurnm2AEKomuI8tjwf6/YkLTWZpOAFL258nJ4LFzrBpQNaW/+7pkY/DOS6KROnl+CNxruj/3N/zN70//5bOcAWYclUw6/jj+muRKDfOSURKeIpOMvqAvdINxdQHbT2oJXzDhN9Faew+bx8HpwtHgTK3MiVbWvchywnlfiXsM3T0ycOoGef0LeWxFeWxxgSRmkSrujm/webN8ZhNE74JojinxlizF2k+GlVP+UcBoWcd4mbjkAr3JCByRGBxWt13hhN5zt+ZPvRgMPIfKuMky56piFo6kX2h6WiM+0JARnoKvgklb8p9XsFOPBmLe0iA34krWAcLqXp//jQxY3bZpxVCsoEl5hXV/FRzW3AgpL4rd0lWLm0jWya3bE72kPsbk+LCuhpkA02BowrlFnqK7M+RNC8uoo5bTbGwdkS+AkqGGg9DbPeoZfHODHZ/Ho9k6q81Wk2Tbf6D0kIlW80+19FZ4ymRtnP1Eq2DiJbZpD8DDqCPY5 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:(13230028)(39860400002)(396003)(136003)(366004)(346002)(376002)(451199021)(478600001)(107886003)(6506007)(26005)(6512007)(316002)(6666004)(41300700001)(6486002)(66556008)(6916009)(4326008)(66476007)(66946007)(5660300002)(38100700002)(83380400001)(44832011)(86362001)(2616005)(8676002)(36756003)(2906002)(4744005)(8936002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /QQsmarwafpkrhG22RchfLvZN69d/NK2swP13ew+OeqvQrzAg2+5+KHwWeRgOITvXXZALWyTyYTqWLd0qbhjK2WDNdLHM7FQ1HRG5TY16KkcX6VFxp83rAB2UGtAY4thcmdXHcj2aSq0g9v0IkDPmeRWxSyONQ6etEbQ0gUZVoQDkxd3FqmXSQJ0N60AjPOZnL0Tbshd2WQvUbhNMs00vvTXgKFg1ECrUGYmW2BpuS1EtnLpCwSAwUeSWrgRI+bKaDdzwKlQEVANyooN1Zg9i4iXlJRuvUpYNrx8yS1m/lnwuPz5PBy1JcrnwEwFuKXVVqzIdSKGtz4khj/CkSOpC/k8dqXLa7saweTthJJT+F58zUnvaO8F7cIN+TC6kCAem5jkmDcYRm/6DzE01fS3nGmM3ptDvArQMJdMiaxeWzRoG+IYrvVJvSUEmkFrpEyTH3hILhwbyTOtqcckT0GyhB0zObeNlp8SlPPAkkuppW3muMIgGDhEp6oyjfM9rOU842FQeJ8Ue275NqMaNXon2M2RkCbhTrPa1NAogbvBSuxvWP/ZNT/n8JocM2GceSC7I9tL8kew0/WZ1FEcK6Ry9EjD51WXpenam2YO1D+826Vz8ZhpccKuHIqP/MyKrR9JgqkV1BfZq666OhISgebnFXQ0YCLJVJ8CSxNOC3+011iqp3+RVIHfVI4YfCJ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S9/KJy7QeahQG6iJx+tfj9ZTb6xjq+zknbLh85kJwCzejYgGfDB2gSrxacvmw3dYxnW4PI5J2GGGtz4HT6s+LlmecYdLOMaNEjAvjF2XazI0jaepxKmD2vCAo/y2G3RKTF34qerkFfGXFGycWoQB2Q2WiHYQM5bMAHYFLvd49KEKFlVxbVk+zQMih0chgiZ5lnwZ4kD4FKuIuCK1XRZwDdMtCX3w1tMrUGO5oBoxkWyWhQgKxP8SKjFv7c96coEdBgdrIXBsyd44VGvpBNU8kE6X68gfBZYIQBBdaJz92Tuf9zoBOr51e6JPQVP6EL+iGRKR9jv9Z5wUw1JNA+Ts80U/stHM0efgB/Yj4lINWC8zVWvhOnFwUFOnHirSLoi+XW88Rbmeb3fVvAvusmRhf6ek3i64wROdNucfYf7WHrVASEekDqunRhRxhsiWbT5i7AiVVQuIYvp9qPtEhO2G9i65r9beIDxJTCYoL6goUGDJ2xcwpLs5a66HfQog4gAFTZxONTsUxadSKJQtY44QBELY3xfPrmxhAqZza7FvCG2QU4pJ8Rpbekb4FcZfNJm/xCnmcY+Bmh5l8ORYabRCt4ou3zqLAvauSSLxBTP4hnYz3tzooWRMn5/OxsR/pLsmHPtR0rRAEod/PUTjBeiP+/xboyTIruaUYumwr9qnLPabv5M+kfH1hXptVyoT+ohuihyA0wiNUXGnqUw9DdNZ2RUXjciWiTFg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc09cc4b-19d4-4ab0-84ac-08db5b7535fb X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 10:05:17.9417 (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: jNwQqLrXa1wLCp6uGB04ayD5+kmuhHNs2/+21LpQZsN/oyKj3qwE3IhCYyB7AHbp9qQcrRGzNf2Zo0KjQUdNqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7305 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-23_06,2023-05-23_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 adultscore=0 mlxscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305230082 X-Proofpoint-GUID: SKZIaJ3AedFZdneBGKRRSoygEV8aAn1e X-Proofpoint-ORIG-GUID: SKZIaJ3AedFZdneBGKRRSoygEV8aAn1e Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 730fc723524e..db46df2f8fb2 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -443,8 +443,8 @@ static bool memcmp_fsid_fs_devices(struct btrfs_fs_devices *fs_devices, return true; } -static noinline struct btrfs_fs_devices *find_fsid( - const u8 *fsid, const u8 *metadata_fsid) +static noinline struct btrfs_fs_devices *find_fsid(const u8 *fsid, + const u8 *metadata_fsid) { struct btrfs_fs_devices *fs_devices;