From patchwork Thu Jun 8 06:00:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13271640 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 5F028C7EE2E for ; Thu, 8 Jun 2023 06:01:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234512AbjFHGBh (ORCPT ); Thu, 8 Jun 2023 02:01:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231596AbjFHGBf (ORCPT ); Thu, 8 Jun 2023 02:01:35 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0C821707 for ; Wed, 7 Jun 2023 23:01:33 -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 357Mk49s002003 for ; Thu, 8 Jun 2023 06:01: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=xNeufgm1uWcDz382UonOQFXhGOSOffKiPZT2XY2KMGQ=; b=LpIxHQTDAT2KsQ+1wR6AzqBQd4bkqrZWfFd4OWHZitcnSNsxXbkIa+fC2DyOmaMNKQLI oousAfJ2bSGYri03rprVl3ZXzvQn/lwLk7219lgaW/cv/sDFu95srzKb5mFENsLfC7FF rY4cXeu4/0z0LkitcIl9Gm6DNDgZwD0GIkUwCUeDRsQ+L/cfrCuZqxFHqERrZsGT+ET0 P2HN5iQ5AZmsNx5vAxFqtGJhFCMG/BH+W/OJ0NvEgzCXrZoP9F1244lRKm0thkQxMS0m b+nAX8lPE+fyhkVha/dUlxizvQTsTRAnV2zzt/6zby8PbuC4osctJDgmUyvbu7AzQ+j/ Dg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3r2a6u3e7a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 08 Jun 2023 06:01:33 +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 3585X48c003133 for ; Thu, 8 Jun 2023 06:01:32 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2048.outbound.protection.outlook.com [104.47.66.48]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3r2a6m674y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 08 Jun 2023 06:01:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kM3RrwjO1chNAF7KKGCIdUkvIs83swDKAHzCbnDExN460cyVDoxxCp/5uLL8INuiGaB9r3qrrfNgC1TThaey7JfWmtGjHHDbUzV+HavHdaF+EUsMXrNnjafFw5wCPz+o9KF6Q70NVHQ9Mt74Wt44zUlVu7U3EB5Ud3un94EH8X0mlbya++fbYKTFRn/iqcMIAT7NdA+vv+OQqB1GDatttWBbAUfdocfz+/ZqI/bRO6vh10Q5sFqKp5oqLTgEq7IX0Jp5fN2G3tAjXxJKT6CWsBuyVaemtK5K+FIs0w275nXXObOdlLMek8ddtrdQ3epkVXS+LOYvgeTfqhGDdRGtxw== 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=xNeufgm1uWcDz382UonOQFXhGOSOffKiPZT2XY2KMGQ=; b=Yx4nrYD/P5fQNNct2bOHYzCUr8sgCq2uLK0idFMxcZpe+yWEvPiTfoyGJ1XT/IZQ33jMmTteo9AueOW5v/C8hcfxaHayD6ZZybLcWMYA9HcGvW4pgEMOt+V88L2UJ3VXcys0SSIZjDvb60GD2K9FAZDQe0/pBWUEPn3c6eeWq+rrkpGXymnpCGWmhrKyhL8t6rOrsJ9nfF+o0+LoCpnQ0UrlAyGIVwFqKySICF9vSb0+EX9S8qWUR0MnFWIHhhBtc65Lqw98jAw0gP7s6CeqATDxkecgfYuzgJDd5/zFR8MPJ6Kq5DF/0fgn0o+n1zFqzSYuUUOOghBdYGej8XGoNw== 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=xNeufgm1uWcDz382UonOQFXhGOSOffKiPZT2XY2KMGQ=; b=GX2wQunr/790ccvFzPn/MnDpZrm92SwNoisPuViVMgrVftxrTBOn8LNpK1Sz4MNc9ftdiWrbMRVgUuVfRKZz1DomIl72sZliw3qTU07xEGyivFKIxPyD0HYGcK0km0KEpR1nMVSfgYK0wZXsswFIppZ36EXQsVmJa0U1v1cwaD4= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by DM4PR10MB6181.namprd10.prod.outlook.com (2603:10b6:8:88::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Thu, 8 Jun 2023 06:01:29 +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.6455.030; Thu, 8 Jun 2023 06:01:29 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 1/7] btrfs-progs: check_mounted_where: declare is_btrfs as bool Date: Thu, 8 Jun 2023 14:00:58 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR04CA0006.apcprd04.prod.outlook.com (2603:1096:4:197::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_|DM4PR10MB6181:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ae29f12-d25c-47a5-0cd6-08db67e5cd5a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MPRBZWQTh0ABiYeHfG3bRxr7Nve2JEPrZ3VPtkDHY9YTYDV40c6x9JIe3BzL/HC/UzGbD96KSjIxOH5UioS4O56dki6uyVbBgXNzZGqsBXbebIsmeQaIAOHTMZ/UNx6WxWO7rI//mWUEZ38eVKM/TnnXybfm97Cy6c2eehp67bnLNkzNobrNx31jqcBYxfR6Amh0viOglHSniNtwHv8YzfiKI2FhKbW00gbMRukdq7/+csk4kWgQQ3rsI0McRTDL1JxMWuUDB7DjQuH41LNGMh+hp+rg9Ty1vp5AWkkcGUZlO4Ro18Mt9mzYTiyRmoLyhOP3spLXgShOkfq9kc/dla9Th0V9qBodz3+bfK6m/ukXe6t+F+kRodS9NrFLaUmwYDgzmnvlPpCt9BE+bLX8uxsqKsIGeTmxgtllf6r3Jg5z2/8YlAIfEK3LyxVNDL3HILQysUkJdD+5QDFdethIlUmN5MjDZ+GIeUJ3rnEOxnpYLLHPpk+hc83rodnAPqrIBk5uDz9sjIohTiYlVWWpdu+ViqVqsHAorhvZvgYOqRf2pzUs8vniv2vkbYobXRu+ 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)(366004)(346002)(136003)(39860400002)(376002)(396003)(451199021)(8676002)(8936002)(107886003)(478600001)(41300700001)(316002)(5660300002)(6666004)(6486002)(26005)(6916009)(44832011)(186003)(4326008)(66476007)(66556008)(66946007)(6512007)(6506007)(83380400001)(2616005)(2906002)(4744005)(38100700002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6cdaq3dsxVUc5AfNhUlhpCinXODfh4x3cKH2lCztNaS4jZ+8B3dua0UBSC1cQKdQEjTbCugiEfEjBD/ofJShrg7bQsYEtYIj+N2sUj0HqnrbvddIqef8RQDs+hHslp4beik/VGfwUoR2HXXYfWt05iDvArQLMUYhx2bJ8sLGMwTujZqDIcNAAfmj0It6Jycal6TzE8aZj80UWW63Hgx6OR80BdoyK3KuAr9SyXrO+coBolxtkXQHFu1nhc2Qq4SDyYvttMZgOr6Cgob9oQDfyxAoqxjcJY03HQTLUpinW1q7XU19oWKjGc9BR4GucO3zdIpn8ZdkpzHlqhi83TyHw9lhU8RkyYJte0zfC1u3RPVthRHwn1sRzuVOfHgZb1FmcMk/xckmY7Ykr9T/3j8pQwPju2nVjeQF0mimtz3HZLG7yTEo8bBDnzvsl4ydM0X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DUfAp8G2opNI3PRNT2uVFX19qlKu0zMimt3uAEHXECMBIt2/Qwz2wdvJREJYUpt6UFBpv8UAE2VcL1ZjSo1f73AYrxg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: XQDkFxLY+ZdlfOJthSuyxB+udAZv5yq9lJ28Da8DyzrfYjFhftb8Dxds31XWAZmXGmYSnkZ4c3gA0NEJEB1fldcvbunxGxvBQLx4hBvozUSbYcCe/mw418SisJCSdR9llRho2HHs2Ow8rwi5KXMaPxm7l6LSdM5vnugQBh2x6tqo/0ub7e6saFL+4MvIU0KywcNT2TaOpxf7Yo2d+G9t2nWWUkzy0XK7ov8IQusGScbnf2fLypyH8IXmh4b0JkCvLM0lsPahVGigWUDxLSXnKFi20pkfNsKxfsN79VgyGHyYW2eOmMM0G3yjuxuh92F0/XxBwVZiCdef34jAS1FnbfUtzjd90L4+KgaAcvNdLTj2cpFTjcx1S3CMkMgcabDK3bEXVFH6yDNkkVyTKIbNbYmmvh8ZqKtrfyeKpH2WmMOWjFq/Yli9C7WKlFdypomhfmYPfz/txshj9/VleKzyG7QZH5mMGJuy1mpg42GLTlYtkt64JrU2Bk1Z5j0V8XqsMBpgfZy+bB5AVXcoeK5bPJ4obCN4GQmQ5HAfjnXia1cdCOdXzJV6XToI93jjNcuitsstWmWfMmNJG4jYGjopRFfAo78KM6wcQL4H6gVmZp7XjIGxMGVr7vw+0pfNPJrOX8XImznJnu85jy5DBFmNaHeaappHUX5yd+W4ZTUYm/rV00JRjZazosq2o7Eofi/0bQ4fXUpXJ56YBiCXGRdP4WJ9sxf3TTDv8rjv1NbxeTwqym+U5YmmdKLQlNVfKKFp X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ae29f12-d25c-47a5-0cd6-08db67e5cd5a X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2023 06:01:29.4342 (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: L8DDOP+53yFR+SZ2rGEwVm3wa8FEsbISC7U6CRYSvITZ55B07yOxj65R1mY+FSTxyjxuxC0FkJH/cYL0t54aDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6181 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-06-08_03,2023-06-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306080049 X-Proofpoint-GUID: 4j1Ef2Wr6RCSfHSwn6UVfzU0h-Eig5dM X-Proofpoint-ORIG-GUID: 4j1Ef2Wr6RCSfHSwn6UVfzU0h-Eig5dM Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The variable 'is_btrfs' is declared as an integer but could be a boolean instead. Signed-off-by: Anand Jain Reviewed-by: Qu Wenruo --- common/open-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/open-utils.c b/common/open-utils.c index d4fdb2b01c7f..01d747d8ac43 100644 --- a/common/open-utils.c +++ b/common/open-utils.c @@ -57,7 +57,7 @@ int check_mounted_where(int fd, const char *file, char *where, int size, { int ret; u64 total_devs = 1; - int is_btrfs; + bool is_btrfs; struct btrfs_fs_devices *fs_devices_mnt = NULL; FILE *f; struct mntent *mnt; From patchwork Thu Jun 8 06:00:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13271641 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 2962DC7EE2E for ; Thu, 8 Jun 2023 06:01:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234522AbjFHGBn (ORCPT ); Thu, 8 Jun 2023 02:01:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231596AbjFHGBl (ORCPT ); Thu, 8 Jun 2023 02:01:41 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE7BA1707 for ; Wed, 7 Jun 2023 23:01:40 -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 357MLH1h019428 for ; Thu, 8 Jun 2023 06:01:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=mpA3xoWNI1qzNj9lqb5vSUJa7aQ8VqesA0p1LrO45YA=; b=KswUurdoQTlK1oeBGJM5enh5CvBxbx/GCWnGqNpfR/IKZZQj6do6pPkNRrq5AFXnMn5H xgFFP42MJx+IeCQI1OHalVAfgbS+nxQoOrx2huUiRBzkl2vJ4rD5tWvVfdLAOs2MnHQ8 ndvNQ612lZ0sPINhKQpB9VfM/9RvOkIGFtOh0DLG5ZrJhbbV4unOgtQiXAI2zZLhqZV1 CkiN+HliFg/nYjTK4V2CXiSaBNc/yiWnTOcgZvxjsh3YXzY4lpuXRXzJ79+9dCinl5Ri vFyCx3o8qJxnEWB55cwZVVUu6OQcYFRFpcgX9AZG/7AtsCucBZi7nCOxdhGcmnbnKEv9 OA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3r2a6skfwj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 08 Jun 2023 06:01:40 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3585VVFh036674 for ; Thu, 8 Jun 2023 06:01:39 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3r2a6knsx4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 08 Jun 2023 06:01:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a/ATHGUe3fVcwSUZMw8FSgtLh5nyLvzGTHtxfZkAzALzXA3ifleK/MHsTfnLdeTBoEEe6ZE3qvVA3nJ4Tbw0gQ00gh/uCPUJbI65yec28qUPhOyR1j63YaU8BMH8nXLgGIwT7/5rfj8Sp5DRiCOBwEmBEFIZry3p+lvFVWccjmZUlyvXHt/RFc6lVfRO8c5mBdNSXa9KLnkB4pMl/D2fwhHCzBxhJ3INFCVH4PV9AhilF35eewcGjdZmvtNISPXJpmL6rn088aqd61ztAHatK/QbiK1/TpciAsSXvY2UyNMwAyKgnLVD+xVIhib2bgYPtCCgjmOwsSrIZXi4f5HvGQ== 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=mpA3xoWNI1qzNj9lqb5vSUJa7aQ8VqesA0p1LrO45YA=; b=jrDrXXDUEGDmTeaYhNEYWIOQOwF4m34+vZuMOJR+TBw/w2yfg00G4iEA+rIEQyXIarVV6012vUgWsAEW5cLxURnAg6XPsPshcF9YQ2yvz/KN4Tj+KVqHVrgNoM+4TYSdQJ6PpoN8bAImLsUJTldRZngBSdLxBLMP5eVqp6G3bca13eqEqrjocqZZL/VNh6oMH62XoZfaryUF8al+wqh6jKliID1FdOGT8p7dPAnEuusuoK3WCiiZsIiyGeMc6kI3DeKsDnVvKxCqVe1Bxo7NW9Ia9KmkOWotuH50OsuiqLfwsUXTR21ZFSv12KiML7N5/A5rtYouYEtRFA0VZ4tXGA== 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=mpA3xoWNI1qzNj9lqb5vSUJa7aQ8VqesA0p1LrO45YA=; b=xZfoe+h0mm7+p/96kws6FLqtWnePbed8vptSH5fw7u2ANeSQm5A+nkUNqFjuF9U1yKtSfSK6ssLuuvkoKFYdu0eNQaXfo3z9xeIu+a7/kDTYDMYZC/iCHLcOBfuiz4JV+8+1foWnenBCT9yCiwSUcpQ2Z08aUxhCGXLRzWZ7a+I= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by DM4PR10MB6181.namprd10.prod.outlook.com (2603:10b6:8:88::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Thu, 8 Jun 2023 06:01:37 +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.6455.030; Thu, 8 Jun 2023 06:01:37 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 2/7] btrfs-progs: check_mounted_where: pack varibles type by size Date: Thu, 8 Jun 2023 14:00:59 +0800 Message-Id: <20d70d9b1ab791c796c73bfc84c23abe956af52c.1686202417.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR02CA0007.apcprd02.prod.outlook.com (2603:1096:4:194::23) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|DM4PR10MB6181:EE_ X-MS-Office365-Filtering-Correlation-Id: 377c355a-5cca-4469-8604-08db67e5d1ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eSeGU3vdkCLh0SQ6aa5E5GJ5LEAyxkT/UiB7GF2/Wov/55gwoBiloeq+f2Ld3zHKndTCqQY/jP67lJ+uWDKbDhCm5qlsZVZOy2e79Rgo08J9quraLWPwaVS6tz3dWJcr1/d4uCyEULEXR6UB63oKieZtmfj0132Y/I4lSF8iel5R52XH87KjEKDts/MdHkZKQvjtaaDs8TNZ85POqdg7wYCscY5BzagfvdLDO5XQaoQeOYoRvq5orZ5kME+fhSksNNDaHLt4YPYwBIa8AZiH9iSzJKhT/lA29QVMmwkk3j9qNB11XlNgVBFSvE05LjvUAbtd/q2Xqh2+oDJjoj+ppHkjZgM/C96cGXIb3eCVAZpVz+FLVW7SoArWNxqagcR0IZzrWdrw5hOfZXEtUzYXLE8wtp/aW5bVeJ09gwBEiOm6VxVbxgSPsynBJXKDtXQ5TyCf8CrnZEQ9sq1aOBvg1Ussdce8TURWxbqfvQ7y1JLgN8w7yvDNrR/HIrC6+9mx5i43V6FrJPaRYttQXPWZ3Xr7yCns94lpBoceErmHMJ6lZw6hZoa8PV78p2feQ1DY 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)(366004)(346002)(136003)(39860400002)(376002)(396003)(451199021)(8676002)(8936002)(107886003)(478600001)(41300700001)(316002)(5660300002)(6666004)(6486002)(26005)(6916009)(44832011)(186003)(4326008)(66476007)(66556008)(66946007)(6512007)(6506007)(83380400001)(2616005)(2906002)(38100700002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: O+uOnkHi2of48i9Ejmwh5XT14O6ShaPDw2QPRnehvakH1WGJBktGY5VhymfLSrNThPXPc4BhQ2EIwkhSOU+0ltcpPFXArueevC3dmaHUqodKe1bf2dsqlCSA9o/qO8pBaI8qU9LucwTMBfG1sspNs+WSN/cdOPQ1AtkDrTnDZXt8YEG879yxed8sndWdhz8PDRMZhLusyh8qE2rOrwbVMV/s6zsJdqxy7ICVT4VzGvvcwQ0LZpG11oqw4B8u6wfSzifx0N8z/hMz84bs8zJAWRG3NIWY256vYHP9LaBPN1ixB/boYg/zhhv6zy4tZy15DFU1lZlRhLBX809C7RSMlvM4wTNosnHAi8vN7U4N9MLBnWLTcvBwoIA/WtCu0DrN2X4jRsCNWsT7Sk+6Vk+FntxjSorprgSh5tYG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Q5soPQz37K2lK9ZJEti/hyzfkqiDwJsXZCxrxCPjYeqsvx6srqZ7ywIdLAs+TqGeZQ/69QNCXV3/KNbL/D8qTOu0n4J6qUtccGw2uEMLD0yJkq3qAQU46aS1zw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 8XpqD/1KMqN0FNw5V6YaH2e5v5HnKQEqnPt1capcvPVLFLd2YbVrOjXSToUNfKW62us2UZFk/vqJacuLnmqPploBy2gkh7vDkxuplwQaZb0bEf0Z5hQWd7XjDZgfjiErfx8RYOMMyd9NzpaCceCPuYmow2yboA7sgxgye71mODpMK0GAueM08w92RvBOZhBnqQ6QxkDVz+B3GmGbIjkLAGMR0/ADNPWJO9ZUeFvc1zt2U+bMc8fv8QziWh46P5ezYG+tRM2GLlbKFvNhSCT+PkbIGWoLGFAnBQq1NUCjFGmnCwcqEH6eTAKPr1pIcCoPSb8vtLMwIP6rgsOIPv6WdNifCWRgWEVwOj8CKgZiMg6WMO1aTVCavl27l//PSZnKThYQsxkISvj97T31W6CVeyRUqHBFImGRZTlLF9QyNAnRZ/HscIFEShEdEAExJdLiPNdXXNZy0pYnyQ3+WC6p443Z0x1GMyT7H+CJi9Ey66WbagfqKhkFSR8NzQLuHEP7IzejSgu4Bgf5AIV7ESTDX32/RAvBZFuGsm2avGcY9A1TUlH3VkUTvIih8slW5lwzyvCJtYJLtuonBMe/ZLgR3dnWDjc5utOBwq5ggb3hNE6bk/mqtFPy30jacm9TlphCjpDEp59id/SiF/lXT0TclvYynBuTcU3CiFRdUYbHphzoZlkM+/HZna8gigxf+YlP+E6rsrjX+dst54b9f43yfAONaUi4FczOkL+KLJIXWirH1FdvjVdMlLR8BuG/2/lK X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 377c355a-5cca-4469-8604-08db67e5d1ff X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2023 06:01:37.2295 (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: 3Pjuciji1wY9ZKix+mvg+M3C2hepTJOyxBY9rv+D2sXrPyuTn94v8u1I/eEm9oQ+3Izs4W7sYgBp6pRjiE0HVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6181 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-06-08_03,2023-06-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 suspectscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306080049 X-Proofpoint-GUID: hgf6oS9tf4rYtIpbKZk0h7nmoO_qkyl0 X-Proofpoint-ORIG-GUID: hgf6oS9tf4rYtIpbKZk0h7nmoO_qkyl0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Pack variables by their type; it may save some space. Also, fixes a line indentation. Signed-off-by: Anand Jain Reviewed-by: Qu Wenruo --- common/open-utils.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/open-utils.c b/common/open-utils.c index 01d747d8ac43..1e18fa905b51 100644 --- a/common/open-utils.c +++ b/common/open-utils.c @@ -55,16 +55,16 @@ static int blk_file_in_dev_list(struct btrfs_fs_devices* fs_devices, int check_mounted_where(int fd, const char *file, char *where, int size, struct btrfs_fs_devices **fs_dev_ret, unsigned sbflags) { - int ret; - u64 total_devs = 1; - bool is_btrfs; struct btrfs_fs_devices *fs_devices_mnt = NULL; - FILE *f; struct mntent *mnt; + u64 total_devs = 1; + FILE *f; + int ret; + bool is_btrfs; /* scan the initial device */ - ret = btrfs_scan_one_device(fd, file, &fs_devices_mnt, - &total_devs, BTRFS_SUPER_INFO_OFFSET, sbflags); + ret = btrfs_scan_one_device(fd, file, &fs_devices_mnt, &total_devs, + BTRFS_SUPER_INFO_OFFSET, sbflags); is_btrfs = (ret >= 0); /* scan other devices */ From patchwork Thu Jun 8 06:01:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13271642 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 546E9C7EE2E for ; Thu, 8 Jun 2023 06:01:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234525AbjFHGBv (ORCPT ); Thu, 8 Jun 2023 02:01:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231596AbjFHGBu (ORCPT ); Thu, 8 Jun 2023 02:01:50 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5FD81707 for ; Wed, 7 Jun 2023 23:01:48 -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 357Mv4DI026210 for ; Thu, 8 Jun 2023 06:01:48 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=+Hm6odQIKDYBtP1VMvY7VPZVH8gAr89gKvEjwz6myPI=; b=U12G+6/0akSF7bxSpXX1M6i81D6dZBIg1EtCZpyB5ve2UnY3Pwlt35k+bph1SiiLxwyT cDjZk4ycV/760p0xDugHBarcCzj3MkB5oaVOx2HnF8MQQ46TW5g5XsIO75VMllkmqE1M 9NXDzTYGPn0UYz6NnM6KB71rfgQFwYWggAqsSJMwBd+NnqKVxh6UjktePFDfZs7C/6BX EvUfD9QWf3Q/MPNNVXBqD6vWwl7DKRIoNng1rN97uf3whflqvtAqRoyKpU2A58MLBD39 fzN9Nde5SLCAUJHO0OGO2tkI5nb96KSLB/cSnE88sPgfvfw9ir54cU7/WUMggGB+mdMZ uA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3r2a6rbdxg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 08 Jun 2023 06:01:47 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3584fAYj037347 for ; Thu, 8 Jun 2023 06:01:47 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2109.outbound.protection.outlook.com [104.47.70.109]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3r2a6j5p32-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 08 Jun 2023 06:01:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TtvcSium503quSkmcAQJVrfaEczCo7fCaSi2MubjQ8LHFxkmUzQbb3fORIhwILy0+1VapHOFI9ToIDQ4ru13+fGOCfBnMyPt9Yig2FBfUXyYBlSs1C9zP9+4pu7y0CtuaSM9lbl/o6SeeGoF5LIStab4rgciexmoS7OeGuO/jy5EAvw+F6CP1QW6iIF2UpOagiinS8sCTPaIczLwBZyEi2bGUtdEimXP6sv6/POI2aD9mDRa6jDBn/Y7LjmKQ0EVsTwvIZuU2Og7O5/6/1ooJT+nk0f6koK1+QeDVEOCNaLs2nbNQhnpgLLBEjmkiQhF15gnfaRFRmj+Z+Atnp94sQ== 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=+Hm6odQIKDYBtP1VMvY7VPZVH8gAr89gKvEjwz6myPI=; b=mt/UyCo0T/QGJeWUepw8HLxXX6HtQ2wBG7bgDf/L7lFjTwawGfGrpKmvpBxKtN08+Hg7147k7TUL3lSQoh1SIhIEHs6k71Kj5FPS41rJAdlPVmGQNmiWNh07CeAIy4U5qUKuh6hZaE6qoAoDeICiwOQ3SBuE3Mtqn9UKkHjrTp2nRjPiy66mfCSVk7vLBR15Vv6foIeVdEDkUk0lxCO3EkOyNDjZlffSjshPNNPnwNprUsE1CVQHpWhsFMee0ALkmi/CA3UNqyKVKVI59wUOnV9bvx4ERXX2SB58TDS0QCBkQDqir0hSULjz4G+ZF4jhd0CnQ5iMBQ7fqhF3MUQnyw== 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=+Hm6odQIKDYBtP1VMvY7VPZVH8gAr89gKvEjwz6myPI=; b=Snd7Th3WIdWY0BuA8KrbU0SrJnVzEavy8NCaxb9PSM0MOUdCWr/cXqkaMZiMo3FfjuN3aBaVYENR8cfUjFzPeqlCX6X2dCZPS9J7uFUILYsd8Lq9fkGH0E3+MsVD2gzA2REAzz3m7VDR8KniW+9UTEWT1bGNley7hAk7PWgsXY8= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by DM4PR10MB6181.namprd10.prod.outlook.com (2603:10b6:8:88::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Thu, 8 Jun 2023 06:01:44 +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.6455.030; Thu, 8 Jun 2023 06:01:44 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 3/7] btrfs-progs: rename struct open_ctree_flags to open_ctree_args Date: Thu, 8 Jun 2023 14:01:00 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2P153CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::10) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|DM4PR10MB6181:EE_ X-MS-Office365-Filtering-Correlation-Id: a8373f5f-3997-4f98-1d37-08db67e5d63c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f+Nw+mdu7pTDK1F0zxfXkRyMUgmIBIzJ0UGCL+ljTN8SUBNOF1Ujd/xh2E1W+Wq73yquZR4IqnzArJ4akf/m4NoQrWDFCi4GndTkpovOUOvTeCH2CGozgJj+HHuBZ80Wn9zqhcE1rPOqdf7+lgwdxYlUiTJx9/BTCy6i8QnpGAyOCQx0mnI/EK7f+RHuNM6ZEsJ+NNKOZzySIojEivuvYvKJqvlYusPCrSAH96n7CeTv9LO8a2XBXUNBsZuOVh1l2RvvW1bhz7zr/jVZPJx9DgacnRcEs0G5uNX2qt1hVn5wiqDDPz3LphY8UIKHOO+6/YOKkX4DEHXM2FYsWwoh5VJK2Knss12VkYxYvmczsRZSsSQE6TgWe0sgmWH0AcychB7tYQDZisOH+J5MYKNX70ej595srv7WEewi9i522qep8VxGgcRw5rV+PWFFMKXPgRKrew9oAQDKc9qQ2vZyUp0k4J0X+BT/D3lpxPohxDmLA0mOTPuW0tHS1MKB0ZyTYhtG0vwcQBPmxaPuHHq8omeuuKo174H43RESb2fYMDM8u1/ixh7EA1Kc6ffZzOHx 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)(366004)(346002)(136003)(39860400002)(376002)(396003)(451199021)(8676002)(8936002)(107886003)(478600001)(41300700001)(316002)(5660300002)(6666004)(6486002)(26005)(6916009)(44832011)(186003)(4326008)(66476007)(66556008)(66946007)(6512007)(6506007)(83380400001)(2616005)(2906002)(38100700002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: q1uo5ZBvxCQ49wvpX03W0bZllgMhCNpyhli9Hd7x10gK4GKHrASRX2+RqaCHiO9CIh3S7mAStPgOF0gmpwknu4gUv1pM4qVFUCb203wBzkmM083/5taU9DbXcFrJ7GpYmoAsgVCgBnx31sBydUyT4JE4KUQyp1MGwKEpiqEwDi9zK3KxVc29oe/fDf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fbkvEIxbnuN7YuynXCut1TJ1qR4crxEvymKyjjJUWQ/BZvYEHHV1WSBIK6XnqsGxdD/jG0Guo2IjPQDoVZemKzMhrihBN3kvDUii1OdqlL4l0Zdi1uP4RmVtovaYgwAedh X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8373f5f-3997-4f98-1d37-08db67e5d63c X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2023 06:01:44.3559 (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: A1N0JCy5qOhl+sAFQvIKK1f9NQgL2Y07dyCrh3J3SNQMBQzuwHDBoN94SCJlX3gOF2NpmFA0vxF8cfNfPj35jA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6181 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-06-08_03,2023-06-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 mlxscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306080049 X-Proofpoint-ORIG-GUID: 3KVwXNBKMhnf9wcKMhQdRFjEHKr4FNQs X-Proofpoint-GUID: 3KVwXNBKMhnf9wcKMhQdRFjEHKr4FNQs Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The struct open_ctree_flags currently holds arguments for open_ctree_fs_info(), it can be confusing when mixed with a local variable named open_ctree_flags as below in the function cmd_inspect_dump_tree(). cmd_inspect_dump_tree() :: struct open_ctree_flags ocf = { 0 }; :: unsigned open_ctree_flags; So rename struct open_ctree_flags to struct open_ctree_args. Signed-off-by: Anand Jain --- btrfs-find-root.c | 2 +- check/main.c | 2 +- cmds/filesystem.c | 2 +- cmds/inspect-dump-tree.c | 2 +- cmds/rescue.c | 4 ++-- cmds/restore.c | 2 +- image/main.c | 4 ++-- kernel-shared/disk-io.c | 8 ++++---- kernel-shared/disk-io.h | 4 ++-- mkfs/main.c | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/btrfs-find-root.c b/btrfs-find-root.c index 398d7f216ee7..52041d82c182 100644 --- a/btrfs-find-root.c +++ b/btrfs-find-root.c @@ -335,7 +335,7 @@ int main(int argc, char **argv) struct btrfs_find_root_filter filter = {0}; struct cache_tree result; struct cache_extent *found; - struct open_ctree_flags ocf = { 0 }; + struct open_ctree_args ocf = { 0 }; int ret; /* Default to search root tree */ diff --git a/check/main.c b/check/main.c index 7542b49f44f5..f7a2d446370a 100644 --- a/check/main.c +++ b/check/main.c @@ -9983,7 +9983,7 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv) { struct cache_tree root_cache; struct btrfs_root *root; - struct open_ctree_flags ocf = { 0 }; + struct open_ctree_args ocf = { 0 }; u64 bytenr = 0; u64 subvolid = 0; u64 tree_root_bytenr = 0; diff --git a/cmds/filesystem.c b/cmds/filesystem.c index 47fd2377f5f4..c9e641b2fa9a 100644 --- a/cmds/filesystem.c +++ b/cmds/filesystem.c @@ -636,7 +636,7 @@ static int map_seed_devices(struct list_head *all_uuids) fs_uuids = btrfs_scanned_uuids(); list_for_each_entry(cur_fs, all_uuids, list) { - struct open_ctree_flags ocf = { 0 }; + struct open_ctree_args ocf = { 0 }; device = list_first_entry(&cur_fs->devices, struct btrfs_device, dev_list); diff --git a/cmds/inspect-dump-tree.c b/cmds/inspect-dump-tree.c index bfc0fff148dd..35920d14b7e9 100644 --- a/cmds/inspect-dump-tree.c +++ b/cmds/inspect-dump-tree.c @@ -317,7 +317,7 @@ static int cmd_inspect_dump_tree(const struct cmd_struct *cmd, struct btrfs_disk_key disk_key; struct btrfs_key found_key; struct cache_tree block_root; /* for multiple --block parameters */ - struct open_ctree_flags ocf = { 0 }; + struct open_ctree_args ocf = { 0 }; char uuidbuf[BTRFS_UUID_UNPARSED_SIZE]; int ret = 0; int slot; diff --git a/cmds/rescue.c b/cmds/rescue.c index 5551374d4b75..aee5446e66d0 100644 --- a/cmds/rescue.c +++ b/cmds/rescue.c @@ -233,7 +233,7 @@ static int cmd_rescue_fix_device_size(const struct cmd_struct *cmd, int argc, char **argv) { struct btrfs_fs_info *fs_info; - struct open_ctree_flags ocf = { 0 }; + struct open_ctree_args ocf = { 0 }; char *devname; int ret; @@ -368,7 +368,7 @@ static int cmd_rescue_clear_uuid_tree(const struct cmd_struct *cmd, int argc, char **argv) { struct btrfs_fs_info *fs_info; - struct open_ctree_flags ocf = {}; + struct open_ctree_args ocf = {}; char *devname; int ret; diff --git a/cmds/restore.c b/cmds/restore.c index 9fe7b4d2d07d..aa78d0799c4a 100644 --- a/cmds/restore.c +++ b/cmds/restore.c @@ -1216,7 +1216,7 @@ static struct btrfs_root *open_fs(const char *dev, u64 root_location, { struct btrfs_fs_info *fs_info = NULL; struct btrfs_root *root = NULL; - struct open_ctree_flags ocf = { 0 }; + struct open_ctree_args ocf = { 0 }; u64 bytenr; int i; diff --git a/image/main.c b/image/main.c index 50c3f2ca7db5..9e460e7076e7 100644 --- a/image/main.c +++ b/image/main.c @@ -2795,7 +2795,7 @@ static int restore_metadump(const char *input, FILE *out, int old_restore, /* NOTE: open with write mode */ if (fixup_offset) { - struct open_ctree_flags ocf = { 0 }; + struct open_ctree_args ocf = { 0 }; ocf.filename = target; ocf.flags = OPEN_CTREE_WRITES | OPEN_CTREE_RESTORE | @@ -3223,7 +3223,7 @@ int BOX_MAIN(image)(int argc, char *argv[]) /* extended support for multiple devices */ if (!create && multi_devices) { - struct open_ctree_flags ocf = { 0 }; + struct open_ctree_args ocf = { 0 }; struct btrfs_fs_info *info; u64 total_devs; int i; diff --git a/kernel-shared/disk-io.c b/kernel-shared/disk-io.c index 442d3af8bc01..3b709b2c0f7f 100644 --- a/kernel-shared/disk-io.c +++ b/kernel-shared/disk-io.c @@ -1437,7 +1437,7 @@ int btrfs_setup_chunk_tree_and_device_map(struct btrfs_fs_info *fs_info, return 0; } -static struct btrfs_fs_info *__open_ctree_fd(int fp, struct open_ctree_flags *ocf) +static struct btrfs_fs_info *__open_ctree_fd(int fp, struct open_ctree_args *ocf) { struct btrfs_fs_info *fs_info; struct btrfs_super_block *disk_super; @@ -1608,7 +1608,7 @@ out: return NULL; } -struct btrfs_fs_info *open_ctree_fs_info(struct open_ctree_flags *ocf) +struct btrfs_fs_info *open_ctree_fs_info(struct open_ctree_args *ocf) { int fp; int ret; @@ -1646,7 +1646,7 @@ struct btrfs_root *open_ctree(const char *filename, u64 sb_bytenr, unsigned flags) { struct btrfs_fs_info *info; - struct open_ctree_flags ocf = { 0 }; + struct open_ctree_args ocf = { 0 }; /* This flags may not return fs_info with any valid root */ BUG_ON(flags & OPEN_CTREE_IGNORE_CHUNK_TREE_ERROR); @@ -1665,7 +1665,7 @@ struct btrfs_root *open_ctree_fd(int fp, const char *path, u64 sb_bytenr, unsigned flags) { struct btrfs_fs_info *info; - struct open_ctree_flags ocf = { 0 }; + struct open_ctree_args ocf = { 0 }; /* This flags may not return fs_info with any valid root */ if (flags & OPEN_CTREE_IGNORE_CHUNK_TREE_ERROR) { diff --git a/kernel-shared/disk-io.h b/kernel-shared/disk-io.h index 3a31667967cc..93572c4297ad 100644 --- a/kernel-shared/disk-io.h +++ b/kernel-shared/disk-io.h @@ -175,7 +175,7 @@ struct btrfs_root *open_ctree(const char *filename, u64 sb_bytenr, unsigned flags); struct btrfs_root *open_ctree_fd(int fp, const char *path, u64 sb_bytenr, unsigned flags); -struct open_ctree_flags { +struct open_ctree_args { const char *filename; u64 sb_bytenr; u64 root_tree_bytenr; @@ -183,7 +183,7 @@ struct open_ctree_flags { unsigned flags; }; -struct btrfs_fs_info *open_ctree_fs_info(struct open_ctree_flags *ocf); +struct btrfs_fs_info *open_ctree_fs_info(struct open_ctree_args *ctree_args); int close_ctree_fs_info(struct btrfs_fs_info *fs_info); static inline int close_ctree(struct btrfs_root *root) { diff --git a/mkfs/main.c b/mkfs/main.c index a31b32c644c9..23db58b7186d 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -990,7 +990,7 @@ int BOX_MAIN(mkfs)(int argc, char **argv) struct btrfs_root *root; struct btrfs_fs_info *fs_info; struct btrfs_trans_handle *trans; - struct open_ctree_flags ocf = { 0 }; + struct open_ctree_args ocf = { 0 }; int ret = 0; int close_ret; int i; From patchwork Thu Jun 8 06:01:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13271643 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 97D99C7EE2E for ; Thu, 8 Jun 2023 06:02:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234532AbjFHGB6 (ORCPT ); Thu, 8 Jun 2023 02:01:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231596AbjFHGB4 (ORCPT ); Thu, 8 Jun 2023 02:01:56 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDCEB1707 for ; Wed, 7 Jun 2023 23:01:54 -0700 (PDT) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 357LSOZg017767 for ; Thu, 8 Jun 2023 06:01:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=VwQv9vIP1P5sPNfaf8zp88U0HVgV9WMGN74+usTVadk=; b=1EoU1L6VUqHDJxpFvXoKet4d9KdqAzRunGQ/oClkJ0G13hN/NtX+A2849OQMb8UY+AGJ RW/dlIXpoShDTwPyf9zVc/zmtskrr+9h59szotcU/cx1drbgIKksICuyEWokGb1dkFEi PrZMZ7TfWIMzJIN+84+2iMF9WZhbSNKutiHzz8FZ7DEKZ540p0lEugmH30RJzJEuh4Ki dUB64aqhyZ8SNeff2NKS4C/A1rhho1p5ROUssNFd9oyMpQ6/O98bfXk3MdNUxUIx27gX vrboHb2/jCDX1ym0RLv601DZRru/Wk9T5FLI3rzYvv4FRv0ZkUF3hgx76d+D4dVkYenE Zw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3r2a6pkfqs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 08 Jun 2023 06:01:53 +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 3585dXW0015980 for ; Thu, 8 Jun 2023 06:01:53 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3r2a6mp2qn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 08 Jun 2023 06:01:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MWiU59QfPY7gqNv6Ar22sN9XqIU66cWEtKTKu8xie+L5FXBVAkKsLSQVpuutzJl1PRtrwrW0Tu0r7PaRc7owlcHjQEqGKupWbxfCn3ApO9h2aeHH5/E8YHuYx8EXPunflZXJWvxI8nyImJ/85cYEvwn75z6sEegGADZte1zxxBM+M5WXLMh6+LMCo4b/K3npvNHeYfjA+8ea0mGqb9iPAFN/whea0nxN/wr+VxNl1leJmpelrHS2AnevQQpTtz37F+WDkovzQZ9kZJpWWzGMgKiH+3LlH95qJYO8SNhqBhCbhAYHFk6I6KLBPkFWUu2o6wS1kK89FRKm3DS93KaWRw== 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=VwQv9vIP1P5sPNfaf8zp88U0HVgV9WMGN74+usTVadk=; b=ZgZpz0xqFIKqQIN2XLDUlgEcKNNXuUki1KHhePeuDnjxod6HVlL+N7W2d25e7sCujvw/yaTdnfxFnFoespDoCF9yQxAiRbov9Xlan3pi+DMbc7y2S6Lh3GKvpXNmbTqO0p0zYz4iUku5gTkyfIS8swb+1wqLNPTggDOdRziGz8M+APXc5hkviy8V5Th+8T2EZjNHYQlZdWbfBlb/CsapFXgWOZ0QEGl0EuMpUyI0C7NjZLCdhzqvcnZ5pdvgkcbTkTwp+n4VNi25frIk23fkn47WtYXFcqU1cO/SkrGTjp558kDLwFx0pTbkDS4CsdepSHUM1k2VIhk3mFAUk0mkew== 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=VwQv9vIP1P5sPNfaf8zp88U0HVgV9WMGN74+usTVadk=; b=VvQavOpysPFpH245pFNO38zAWq4awRAQooWrgdxckkvqrp68fOA8YgoXvqRS2aG6EK1duRHSDzVl8LvYUTh6zmBqv2sQlXQFi9WlhXPajuir3YevKkJcnFixcsaMVFEBChFY1diipQGP+P510PqpH4OG92XUzeH6ABUHQxaFx9g= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by DM4PR10MB6181.namprd10.prod.outlook.com (2603:10b6:8:88::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Thu, 8 Jun 2023 06:01:50 +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.6455.030; Thu, 8 Jun 2023 06:01:50 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 4/7] btrfs-progs: device_list_add: optimize arguments drop devid Date: Thu, 8 Jun 2023 14:01:01 +0800 Message-Id: <6b296396c512a2dd7cb024575a35a6e0c1132a14.1686202417.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:4:196::19) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|DM4PR10MB6181:EE_ X-MS-Office365-Filtering-Correlation-Id: 91b8e4e0-900a-4db4-9cb6-08db67e5d9d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0BxH1U2IYEB45eBAvUzNpulcE0IfTk62ntzgYqryEKWx0qKD/IjQD0I5tZC9AC4nmXRCW0l5QvaCXKeUAp8iay36BOtrf0zLdzwnXzDTPA9HaW6cEXJKYBI62AFCc2iye5CydOEOGT4IUyFtYKMyfwYao1b10h65NoUaRnN394v2spuyRc1AMGW3xE/D7xwXGmLIJa9D8f3K4L5Fj24ZrqAEOdLr7diCq1TbOkitCgIBN07JnCc0GdOUbSl474+m4x12Aq6oY3vIpIrcqqkfEnVdhfa2O+CAMUvpv3AXzuX0jlhFkO1zmHx4S2igOwGrFeNyusplHkQ2DUbkw/ncskIxi3hhFW0wsW/WNpMB5Ntmh55/3A9uoekn1a9IcQTcBGTV+mHV1FChQXKXEZFRP5menIVtfAkgh3AjZVspVtbUyxcTd29vElYOHmvYR+9JcN1J08fzvqnDzToTCyHjA4O+3s5HlKpDkpcrHDixeENUsB5ydts6gEo94cJKEf6Ht+AULH1WoBwBiu5/d1UwtaIA30TwlmpBH4ZhGIdazJcU7WwAQs5g4v9ZhZVxyxw4 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)(366004)(346002)(136003)(39860400002)(376002)(396003)(451199021)(8676002)(8936002)(107886003)(478600001)(41300700001)(316002)(5660300002)(6666004)(6486002)(26005)(6916009)(44832011)(186003)(4326008)(66476007)(66556008)(66946007)(6512007)(6506007)(83380400001)(2616005)(2906002)(38100700002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2YBnxbN+yP4DDu3GATCTWsU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teOYygGTxUQKC3jN/+kJLKdoI/iQgZbLj3d75TnZGELFQwnUnoLxBmG4jYsICGxTGi6twDplQYl3g/cSBlNe19HOgrryAsc3XyKMRxWKU8ZYAlm9PdHOD2ftJAcqj9qotkmWHBBzL6f2DlSHM1BBBucTX0Pa7BrO1P8sOmpttQ5woAXUNCWS4ajy6BpbNPAOu2gKWkArgEQJ8nfhnPGqRc5zbtguRI/ACCPge5EWDirBkrFMVdH2Z0/k/8I7gF2uuiI0n785UI3hP0OCDr/8ZXCfXAT9 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91b8e4e0-900a-4db4-9cb6-08db67e5d9d6 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2023 06:01:50.4006 (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: arB4RW56kgreJWl4X7AW+kHBjpZxqFY/f/Xybx5EgSTTj0bgFZvRaI6aKcvNMECZLSEtu425JgZ4ilY/NW6TVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6181 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-06-08_03,2023-06-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306080049 X-Proofpoint-ORIG-GUID: oVF9_MQlfKOnVxVM3jLok9TcQaXrt-nw X-Proofpoint-GUID: oVF9_MQlfKOnVxVM3jLok9TcQaXrt-nw Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Drop the devid argument; instead, it can be fetched from the disk_super argument. Signed-off-by: Anand Jain Reviewed-by: Qu Wenruo --- kernel-shared/volumes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel-shared/volumes.c b/kernel-shared/volumes.c index 95d5930b95d8..81abda3f7d1c 100644 --- a/kernel-shared/volumes.c +++ b/kernel-shared/volumes.c @@ -334,11 +334,12 @@ static struct btrfs_fs_devices *find_fsid(u8 *fsid, u8 *metadata_uuid) static int device_list_add(const char *path, struct btrfs_super_block *disk_super, - u64 devid, struct btrfs_fs_devices **fs_devices_ret) + struct btrfs_fs_devices **fs_devices_ret) { struct btrfs_device *device; struct btrfs_fs_devices *fs_devices; u64 found_transid = btrfs_super_generation(disk_super); + u64 devid = btrfs_stack_device_id(&disk_super->dev_item); bool metadata_uuid = (btrfs_super_incompat_flags(disk_super) & BTRFS_FEATURE_INCOMPAT_METADATA_UUID); @@ -545,18 +546,17 @@ int btrfs_scan_one_device(int fd, const char *path, { struct btrfs_super_block disk_super; int ret; - u64 devid; ret = btrfs_read_dev_super(fd, &disk_super, super_offset, sbflags); if (ret < 0) return -EIO; - devid = btrfs_stack_device_id(&disk_super.dev_item); + if (btrfs_super_flags(&disk_super) & BTRFS_SUPER_FLAG_METADUMP) *total_devs = 1; else *total_devs = btrfs_super_num_devices(&disk_super); - ret = device_list_add(path, &disk_super, devid, fs_devices_ret); + ret = device_list_add(path, &disk_super, fs_devices_ret); return ret; } From patchwork Thu Jun 8 06:01:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13271644 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 53D76C7EE2E for ; Thu, 8 Jun 2023 06:02:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234530AbjFHGCC (ORCPT ); Thu, 8 Jun 2023 02:02:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231596AbjFHGCA (ORCPT ); Thu, 8 Jun 2023 02:02:00 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4CC410FB for ; Wed, 7 Jun 2023 23:01: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 357NRKiY018013 for ; Thu, 8 Jun 2023 06:01:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=RMZAREKSvEDI5pxcXS1k9S4YwPL1ght3d5y4fGz5kfo=; b=NKPBvDqPWxK/qrOIeehx6hV++sD/+zRrKCJJ29+mFuZmzS08KI3rnlHx9D2lnvQwg/s4 /H4caQrLldL6qzlQyRe7C7oot3xFiiR+f/ZKeCL4bd+63sDqONpeagsF2o+A5kJopCPn IoEN8nsT85vKu4Q4KohZGtS8FmWMJzwxe6I0IkKRSGDoS4pcJbU8ntIb81NPYrrakVqv KosoX1c9a7uO29glrCCgUEVsmvwj8ZEnaCoc3MsZPHLyLg7dRxQqAnkuZTbHcl2guzez JrSb+35zF1B+KhMUM3EXBQ+VCCxX8FKIP94oo/eAMURt/LSPOolqiiTBFINfAqYlK04E gQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3r2a6ubcdb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 08 Jun 2023 06:01:58 +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 3585hjbQ036628 for ; Thu, 8 Jun 2023 06:01:58 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3r2a6kntkg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 08 Jun 2023 06:01:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hKuvVR1HtzzREJhOXc37kl2vY+BB0YsZe3XnyDEvvOX1+M+TESlzN1HtxgsH7iawz7t7hqK/tgnp8tCgYuclUwRFEHKDLleBALHeoraXWQN44cllEWtdr5YNT9+pagoB0YD18O9jcACKxrE+OZz1Lfa7uclrMZgaidbWJiyvs9N2AKg1KGXzvtr3VFLssxnXa0k9VulrENaneUJpo3IwzJmoXyYvWJmckxMQqFtvSk/fI0dURQC/r9hdMy/LtnEtQqSU19ulVjzTQuhOEv2kCLJFdR9ZeWu7y/obZIvSzJhUlwxigR0H+TPQ578OXdgt53vbIKRs5BJhaiSD01TsLw== 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=RMZAREKSvEDI5pxcXS1k9S4YwPL1ght3d5y4fGz5kfo=; b=GKFrbNgBk85m39kz8Ly59sh51wc9EGGPQl9JIX+q+MKZXwGvrKZ4oS7o2EeWXlp2TzD2HrHWqsfomf/HFRzz6vryDBgJ//8ZWXJUDgRkzSEmvZipYdLhsclEeYs61pfy8luKDv2HXNYFkt3TrMU6Xw4RsaDJQNYhdNZXB2WAJMKOUPVKYh4zZVreODHCvEWXBE/s/uLkjo61QpdmZTapxEodKSmPO80TY2vjRhvKyd4fMcLze+bpzMGv7ize2STFmquIKtksKye1RzKsJf1ttyxVWpAzVVcDL9WUSYXfC9IqwH8IqkMKov6PLSYY36C739ua59PPRTPRQQodskfLrg== 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=RMZAREKSvEDI5pxcXS1k9S4YwPL1ght3d5y4fGz5kfo=; b=t7q6eXBCgDXVqvw795Jz8MHLrt3BAxQDjnwansRbKT8NS1L1hL7fDd+tSJyZi4w0+2ZPIRGOYqjy0DSERRKV+Uoq+ld/xgTUnwlSRHy4ehiiS1fQgZE2J+iDOifUWRmfSJuu0+AIhDdLFnDmNe5Jk5rmy+/myY9F6TpH3QaOYDI= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by DM4PR10MB6181.namprd10.prod.outlook.com (2603:10b6:8:88::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Thu, 8 Jun 2023 06:01: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.6455.030; Thu, 8 Jun 2023 06:01:55 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 5/7] btrfs-progs: btrfs_scan_one_device: drop local variable ret Date: Thu, 8 Jun 2023 14:01:02 +0800 Message-Id: <718713677855382e44cb57d1ad590063ca20d8f7.1686202417.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR01CA0045.apcprd01.prod.exchangelabs.com (2603:1096:4:193::19) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|DM4PR10MB6181:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c66d07b-b0e3-4e5b-cbf2-08db67e5dcb4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xMZpUPp29Nxt9QzVhh+x3TnnLxOdzyWIJA5VQE0D2gXyKrQ29isEwocKgetRwOBbELPabFt9JXcgAV+hM9gldXSZNZzpcjWhwP74AcIhGnjxv91PM637MWjQ/lGO8PozZ0W2r5NDui+KULVd25fN/XQCrvcAlZT6pBwgj1sp+A6Y4tkwrOUBLiCW00eaxG4O86ebg9MiyUDloGrL8eiSvKu0nxzK2/UOMWNcNaFsvwA2KHmrNc/IkE9Stnvl2wjAWKk83H8XJr8rEtvLleS6mf7y5PDFDzeU45XP3/gD/6cz/4XuVdkkbC0r/k03wHyZbQvE7zfzoe0LeRT4RG/YdjAvS1A2WfupQK4mOS/S5mFC0qcLxdD/hdG90zWAMrC5C0xAIU1w6yAPzyiwACU9IYB2rxZxlwOg7/oIMOjI60I5uuMA5Y9iow9gA9/hl2KlXnOxuDOFvtPLegDDTVRzvxwUf4jX5PrTbYipVscNsqC5p7X0m/1uh9vAgFe/ix3vR4ZXSAI9rwZ6kUdaPw3I8wHclJuJOLIRdD2o52EnOxkqx6fissc7ZfaEIS+52O2P 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)(366004)(346002)(136003)(39860400002)(376002)(396003)(451199021)(8676002)(8936002)(107886003)(478600001)(41300700001)(316002)(5660300002)(6666004)(6486002)(26005)(6916009)(44832011)(186003)(4326008)(66476007)(66556008)(66946007)(6512007)(6506007)(83380400001)(2616005)(2906002)(38100700002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DNLRlz1fxve91JcKQ+Bk6HM4syzRR7Gj8rbq5oyvuKEKNU5yDz6+9HLzXlZRAsdH/g9/hFgGXT+J3WqBQ6XtQ7yc25JSKxRhAcqVRRcV/jb6QDY8NKL1YIYsKC66U5LIn1L1vFDy+aYSSLn4OiFTf8vmxkmTOEcwzP7pXDxquuawTK7TVND1jDdBS0OP+VQd+257AZX9Tvz7ENVt/dzllcC1RT15aMp5wfGolYp2KqC7oEdy2QHouQo6DLqXAnvsxh9WBzeWIm9tzBcSvDESyt3jWcqlaAe1BKOqC+V3t1/7HUhcLHFNUahnKdkcPMg0J7RtpxobgBWgLEfWhE/cgKvn3RCILhZzdPhbyiYmc41BSwG9Ah8I1uZrg/n9xmb81244kn5I8vGXAtJonqGs3X56FxmasahU6OYpb/HQ628OCKYNaeBO7uJnzRYotttD5bOVpSa5GaZdobBDPXUl53kYmxmW53+s7dWQOooxyJpEOjI773Wkv83yBcNpm17E9k3BFt1TTERxNgmX6uN+ewgpsouWco+KxvsfTJdj63ajlYtgbRkGcNGwan//V46m6/qqkRWWzJ4u5Kh2eIkQHxTKOMjD4qYbKHYDC2pJbZs1z0SjJhdTXs98uQYy8rZTy5hQhno+Eb0sIcs5nyC+Ho+rRfSlyjI08dSmIuPGf7yGG5wWZe6qmL17b+X6O/hS11BGtEU+hrURVCyDDomt7IhGUWmHME1vVJOF0KBTs7clVSAVc2m3dMonKeyoy9PLusqRZrIp/4rxkczXUCiYczbjwYUBZpCKTMeO1QZAYQ18XhlZNttGtzWnHdzOp6yQNzaID8mRmDC6val8FDzPhPLZJtc6o/Uucm+U/A82Kp5GdVrGB0dJRzR5vaahOHhRcj5xlwoUF/ji/3T5H324wBYdR2be4GShv69VlbmdJ3EgQGrfdZOSkmKS14+0dpFDSfF9RtXHPYPElBATh1M9ro5hccoQbC6yYTCcCtGibXLbEHVCSUhibdi9Rujvuu7zPIZfxnbto3W8fM4QQz3mXlmyi55P8rwjQKsw/V6POPUkGOQFwErWJHSbPyE0rqhFKbmGM9Ah9y50gLHXA+4sC/yb7Ud+s0dfJcobRSotZvcJygCVmzSZUBdYkpsFAxM6yW4PyxzrYEhAp8fT4JHyNXK7cuQEHobIWZQkiuLoD5eY5VusclvrbnpsXt2HZ+GX8pUhUcPaM32rQL0v8a4IqfAjsQylMDMSEUMNZSch3zG/hTT6J31xbRiiTM5QCWKiTMEuEhTxYAagXtigUhhKUGNf0s9lPbJN5NQSOH16oPSDhBt4NZtpjyUr3V1P8uDbUzh2edCJW97hgmU2N0zSHDUPma6v64Zt5p5CHp2814kvAXOeTQei3kjdgsHxhjTXhc18VgNZsAAYwNl6IEM+fJWY5pAp9e2bP81DHrK6Z9WwI92PJDmtD0KUcrB2hEYegYG1WelXMeE+E7BgroKH07ZpONmtRYqgPGMP24SKIyWrmQenZUgeURu4FLog2EX7zBYADOGBNYoV4Bogu6cUeRa53IHskX4rOZMeiqhKVkEB6ex5ABxgWq6PrzOYFu0Uu//ZPY5bQX1voe5q8cZpEA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: YIiIBc14/PHO38REkKTizGi1iAnTu3Q679LoPXK7sDdq+Q38v6l8n3kt3GqFjnjRamUJAF9yrKVkzmYxYhfcXOn+WlgtMbMn6HA+R8Y9DzTaoXW860ec7ozr/0Pcm1ARbicJzcOnQk1W+6RzHadpPBN7U+NajYNgB32gsF+jnzunT5ybxL00hDUHNgUPwyLS2grqA0YxCjXkw5cl0CW08n+y+onCpra3r+ff1Va/wRIOS77Y2+LacM3RXh7X0HoEcTTobkbPqV+Xg2ps/UA7GZGmdDbe6Y7XbkFAWNnRg/phYRnikqbVqxGPv5txbCj+f486P1zgscUwjEaLHU4nMiJPerQZKFt5BKG8rqa3NxKn2kOimhOK5Nbje1lmoXnK0eKrl1JQKiuuz3ItprVlxBf+JplQ0FBRZ8+DTFhvr1o8c+2Uh0RW360ZPc9YAI2YSOL1+1d5WSBV+x2mw25UlAJchX4Op0ksW4pO2Zi4kOxkmDCG7ZDAek9ZDldHf9qZ+s62KDovekjONouEeACX2a1Bk0N/342V6yUhvel8GT1f4lkNViRaeFgT9bVNM/st7aY0L7PpFY8mBykxUvnfpNrJvRcUO8T+ZPtuwmBvzK94tCyXw/dd1MF3ZMkBpq+v7myk1dGVl/ZPpVrSbc/Gql3sXz624KF019cQXFN7pFKy+0aKGgY75QyoWp2/Nffmzn66yGcHSKKv+8GFt3aRFzCpns1x2wAKTuD/G1e0EqDJlDaaUOcExOl7EBefXSDF X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c66d07b-b0e3-4e5b-cbf2-08db67e5dcb4 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2023 06:01:55.1997 (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: MpRkDf+ECM82+NqI3+6GC57FvkUtKUr7FIDv5O7MmUqYLTlfleoDI5SS0B6Vtth10HQn2Hq+IMceAqZhiWJHjw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6181 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-06-08_03,2023-06-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 suspectscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306080049 X-Proofpoint-GUID: 7R8liW7InY1jS-SPsaeTYyLap3nIx1tb X-Proofpoint-ORIG-GUID: 7R8liW7InY1jS-SPsaeTYyLap3nIx1tb Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Local variable int ret is unnecessary, drop it. Signed-off-by: Anand Jain --- kernel-shared/volumes.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/kernel-shared/volumes.c b/kernel-shared/volumes.c index 81abda3f7d1c..c8053ae1c7f7 100644 --- a/kernel-shared/volumes.c +++ b/kernel-shared/volumes.c @@ -545,10 +545,8 @@ int btrfs_scan_one_device(int fd, const char *path, u64 *total_devs, u64 super_offset, unsigned sbflags) { struct btrfs_super_block disk_super; - int ret; - ret = btrfs_read_dev_super(fd, &disk_super, super_offset, sbflags); - if (ret < 0) + if (btrfs_read_dev_super(fd, &disk_super, super_offset, sbflags) < 0) return -EIO; if (btrfs_super_flags(&disk_super) & BTRFS_SUPER_FLAG_METADUMP) @@ -556,9 +554,7 @@ int btrfs_scan_one_device(int fd, const char *path, else *total_devs = btrfs_super_num_devices(&disk_super); - ret = device_list_add(path, &disk_super, fs_devices_ret); - - return ret; + return device_list_add(path, &disk_super, fs_devices_ret); } static u64 dev_extent_search_start(struct btrfs_device *device, u64 start) From patchwork Thu Jun 8 06:01:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13271645 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 D6B0DC7EE2E for ; Thu, 8 Jun 2023 06:02:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234331AbjFHGCJ (ORCPT ); Thu, 8 Jun 2023 02:02:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231596AbjFHGCF (ORCPT ); Thu, 8 Jun 2023 02:02:05 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72DDC1707 for ; Wed, 7 Jun 2023 23:02:04 -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 357Ma8qg002221 for ; Thu, 8 Jun 2023 06:02:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=fkI/rQCb+tTR95bzQXIn02vemslrIl26hP4yAXTNTpo=; b=2p1FLCegVTpN7jdJbu6FyQWhzp5CN8l3CI1yPQlQ09St48iZuKswGKQLiIRGsmWKVLuK KMfvVOnsyiRf73Sh5BtGxHzVFB7IGPM0JFdJBWc9qxZ0FmhfLfd6+Qu7s1iw2+O7ofXe siFyyK0HeFxH6EK9lw1oMfyyBuSIBFyWBgBzirNnzqORzTqL69Zfn75Qo54fqofOx+J2 9ExGgmzvXEtRsZ8Ulk66FJDPi/sCSGkx24I7LDDSPbztmynKYvXGMiIyTkZievWns37D uEile+QLtHZEdWQN8goJrptThk/E6Ys8PcdCaXJiqxCW4cO9xouCvdfrGKnnrNL0p+MM Xg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3r2a6u3e88-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 08 Jun 2023 06:02:04 +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 3585AIhE015848 for ; Thu, 8 Jun 2023 06:02:03 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3r2a6mp30f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 08 Jun 2023 06:02:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N0Yu/cib0Tp6Zz5Hs7y/LJ42P+LeEZq5Wg5Ify/FT9rGmxr0Ts21i7lP5IBGBoDgJ95IllAaG9yBIeD3dmlGSlGli3J9yrEpLipuxX9Dk1vj8huybt2Zny8/E963klNl3OI+FddILODgkAfGtAMrp5D1SL/Bxd56ILQI+J3HjOzyV0TQxJ2yd1TAgVXdaCaO1E9TBDOFEQIWF3ODt5hDPwuJFj4/+hvHir+0vjQz0qebEWbMjLeeESwU5keIy+BMDsIs0BbJiJYz7Nwd09rlCmJUY3znci4A6m+OVJJb4KAyE4dIRVbeiKUIoB2uT7wjVWTym5OUIP7aLLiWVsbu2g== 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=fkI/rQCb+tTR95bzQXIn02vemslrIl26hP4yAXTNTpo=; b=Hy/dFHrX272CQHbtt7jo8MW3fXPWN/XcWPwfM8SRP16wGU81GRyTa9mA7MtXyqYv/XEVfe+x8isjNoI/4xnxXIb7DyMfdVYq+nOARJK+vFepm9xp4QJ+O7hQbSNPAoZwxCiSFZ3v49fZU+2QHXau2P3F91R24VbS8hyWUHNnn0iajqfvdbMAYhWSGZClETo6O/RLT7j6K1mBlXlDoIwu/vMzCEnDy8CbsX4jfaA/TmNjOxBhFVweRpgpO7rcK1CqXz24GEmqukK8ijUgGJYfTh0AK8fRhPvCk1CgDbB6Q0gPkygV6Oj3+/Ctq7yYOucfLhP0RpIW1yaIpewiAfEhnQ== 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=fkI/rQCb+tTR95bzQXIn02vemslrIl26hP4yAXTNTpo=; b=m8qA3bmgc3WW9hE0KCg/QCemN5D+zGnD87s2MBTgHrquxIN7FJTbyHNH6drBNqzwVngj4d4Y+G9KDCXy6sB5hEj02TfEubDT5WRPcj6cKofhCWzXKG9KyBqR13cQqa3Z4v2BKNj5Ae5TRKHEmdyb4qAqGOijeI9up0Aht8Ftres= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by DM4PR10MB6181.namprd10.prod.outlook.com (2603:10b6:8:88::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Thu, 8 Jun 2023 06:02:01 +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.6455.030; Thu, 8 Jun 2023 06:02:01 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 6/7] btrfs-progs: factor out btrfs_scan_stdin_devices Date: Thu, 8 Jun 2023 14:01:03 +0800 Message-Id: <3c660a0d48f5e8d50fb932dee473fc1d86c0838e.1686202417.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR02CA0039.apcprd02.prod.outlook.com (2603:1096:4:196::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_|DM4PR10MB6181:EE_ X-MS-Office365-Filtering-Correlation-Id: 2d7f8b79-f0a2-471b-4e8a-08db67e5e030 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b/L94NDELP2wuaLhdVnBOCEC/b+8JVK5LHjmAeg8jnRzQ/sTuWyTW2+7irbZ0NC6xgtWn3RmAmtagfCE9YVyevhRbPqYP75t0PVdjq8TVr3Mp0UWUo86s9vX7fpQSE/0kclqIiSzx6eu35/OAmF3ianEzHFVLiOPgQWLCBwSI5bXcOwBM7vMSFTHMrQ5BLL2Gkk9XR/iSyxfLvA8qD0Nec53QyAIr09aL1DaHr7Tv0YEgoirXra+c5fG0ocq+BaxZcnZebqGSKonJXfGAE9ERLL9PI2Wq4NTD/e5ea+/DyF+fAAIu5kWJo5zWUMA8T/3xKC3tGiMgXc1HAo57jlGxzQVRx2504Z6IsaaQO5Bg+44/RyENo3rf4dtuC8ocBkKysTFNfCjXpguJmv3s6fRTUy51bSFJ1DZKeWt+uig9pazV531gmrFuPk29MZ5djd7NOeQhH2Q+yZFKoHRsxNY08vxOQjamfpC52hmMNYMeJ1KQbhNTny61nQG5sc/OBFCwurLnbaJ8/y7eVDVfnFYgcsAHKctMW9cHa8D1SReWrnjoYNpLj/0X+M8fLBNSO2+ 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)(366004)(346002)(136003)(39860400002)(376002)(396003)(451199021)(8676002)(8936002)(107886003)(478600001)(41300700001)(316002)(5660300002)(6486002)(26005)(6916009)(44832011)(186003)(4326008)(66476007)(66556008)(66946007)(6512007)(6506007)(83380400001)(2616005)(2906002)(38100700002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1yYSD+foSwIPzj9ck/tLU4QDJNoa9EVfOHkdqcsUZUm/qsrESKLpQc3iW/sdG7o10oJi/IkhgEyOlwMCmTmJSd9Pv0FniiHw9zpMqTrH29i7Hzgqth6lITDLHOG8j5kxul0O4+Ai1XeC92J61QW7DWoh+UIOV0FqbbJ6IwqW5pvgxJTvHU0mjF8GNBtzpOq/hgjay2S16HU0RJ+aTQAp4KnGZrqZE09nU/2RIWbH0wzvERboVXvH6cjVeCHOiSa83JBE0avSE6Ztfg3IDJA97LMGa3ycg97/HZ7fvTCaJRWJ3LK8tkwMPytq9jh1OzVzgIlGDz0R5wtXXlcOwLohEXo9xu8360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7QoQZn+2I6OaHrj1jkdgm2F0YYkoMIOabLyTbLfPTEJVLNWonXKuFs/238Us/QkrAr+4CqbQOzfFYnPp9VKfz+zH57rg4IzDebv/xxYb8E5PCPP8zKrZauLEo+4YMBsFU7QcHL5lwNyllO4GsufKDdkBTnzyXzHOFIGFFWX7sa8HEsEZFUPIw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: nc7uzLXRnEhZlrmVVkv/FvS0Zt9GD/Zfpj/VUYd0VphfkvRRbwTiUfpdQ1sHblvxMW5pTuVaedIJtLdPTsIE8eX6UYpfOkufjiQ5qL8e05XeVMBxjJwwHd6FUI1b3XhpTyB/9m31O8kc9YpH9+LqdVBDMLOn3RmvptycZPNwsyc2v/WXaCoX0mMzuZpY1jRDjakWc6XnbQqxP9Fq8Xw6/qGB3Kb8JLEBwf1oKenj6TAebJIhR7n1spodVQTYDROlaHKSvw9fntc5OCB9Ry5pwLdtPs/T0tQIV+gNF4+bzwu9oVItw5Rr7RkArq2WrDDVaw7ndM6hS2+DUMMpmYFqZnmFNV+aSjbEKuQMoLEiIPz+UARxOWGxsUmcRYCvgr6aw+F7Rji0YJVcHzDpsGW/QZc38MGovwRQ03AvDo9pW1P2qV1weN1FjToYFDh1SsR9fNnQkuduXFmVi6+X2S9OTg1eQZVPgnbW9EsvmHvl0AirKng2rJwMvqctYaL6shO/3HwwleN1Ft5IkCb6BeRTuWH/mc840VOq6ajg3aqSZmAAVBFuSEKFpojI95WecvxqgSHjADh1meTfdnhVnwYbAYaHqIIyV0jPBlIeLtKarHLy2va7HxqvFCULrbMEiOHHI8doQgYB3m4A1u1z6Fl2cLC9yK32NMlemsHIek6e6lGaVy+Kq/LOP+nBT0IGt9SIdYv9HtDLJ+KneX9P2aVCVQv7ecP/oFDzUNDuZZbe3PkYOARE4PTCazMw9SdZS1vo X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d7f8b79-f0a2-471b-4e8a-08db67e5e030 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2023 06:02:01.0663 (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: hjqVjmoHurP0m3pGLySxay9QshGbXirqVqurgIrugQ1ZpU4c9uCHTvqBGD/jCPms+t0ZcpaY4UkApC2ayPiXCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6181 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-06-08_03,2023-06-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306080049 X-Proofpoint-GUID: hecCkzhbKhmJ-uh1D5IH5fJSKv5L6zm- X-Proofpoint-ORIG-GUID: hecCkzhbKhmJ-uh1D5IH5fJSKv5L6zm- Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org To prepare for handling command line given devices factor out btrfs_scan_stdin_devices(). Signed-off-by: Anand Jain --- cmds/inspect-dump-tree.c | 37 +++---------------------------------- common/device-scan.c | 39 +++++++++++++++++++++++++++++++++++++++ common/device-scan.h | 1 + 3 files changed, 43 insertions(+), 34 deletions(-) diff --git a/cmds/inspect-dump-tree.c b/cmds/inspect-dump-tree.c index 35920d14b7e9..311dfbfddab6 100644 --- a/cmds/inspect-dump-tree.c +++ b/cmds/inspect-dump-tree.c @@ -327,7 +327,6 @@ static int cmd_inspect_dump_tree(const struct cmd_struct *cmd, bool roots_only = false; bool root_backups = false; int traverse = BTRFS_PRINT_TREE_DEFAULT; - int dev_optind; unsigned open_ctree_flags; u64 block_bytenr; struct btrfs_root *tree_root_scan; @@ -456,39 +455,9 @@ static int cmd_inspect_dump_tree(const struct cmd_struct *cmd, if (check_argc_min(argc - optind, 1)) return 1; - dev_optind = optind; - while (dev_optind < argc) { - int fd; - struct btrfs_fs_devices *fs_devices; - u64 num_devices; - - ret = check_arg_type(argv[optind]); - if (ret != BTRFS_ARG_BLKDEV && ret != BTRFS_ARG_REG) { - if (ret < 0) { - errno = -ret; - error("invalid argument %s: %m", argv[dev_optind]); - } else { - error("not a block device or regular file: %s", - argv[dev_optind]); - } - } - fd = open(argv[dev_optind], O_RDONLY); - if (fd < 0) { - error("cannot open %s: %m", argv[dev_optind]); - return -EINVAL; - } - ret = btrfs_scan_one_device(fd, argv[dev_optind], &fs_devices, - &num_devices, - BTRFS_SUPER_INFO_OFFSET, - SBREAD_DEFAULT); - close(fd); - if (ret < 0) { - errno = -ret; - error("device scan %s: %m", argv[dev_optind]); - return ret; - } - dev_optind++; - } + ret = btrfs_scan_stdin_devices(optind, argc, argv); + if (ret) + return ret; pr_verbose(LOG_DEFAULT, "%s\n", PACKAGE_STRING); diff --git a/common/device-scan.c b/common/device-scan.c index 515481a6efa9..38f986df810f 100644 --- a/common/device-scan.c +++ b/common/device-scan.c @@ -500,3 +500,42 @@ int btrfs_scan_devices(int verbose) return 0; } +int btrfs_scan_stdin_devices(int dev_optind, int argc, char **argv) +{ + int ret; + + while (dev_optind < argc) { + int fd; + u64 num_devices; + struct btrfs_fs_devices *fs_devices; + + ret = check_arg_type(argv[optind]); + if (ret != BTRFS_ARG_BLKDEV && ret != BTRFS_ARG_REG) { + if (ret < 0) { + errno = -ret; + error("invalid argument %s: %m", argv[dev_optind]); + } else { + error("not a block device or regular file: %s", + argv[dev_optind]); + } + } + fd = open(argv[dev_optind], O_RDONLY); + if (fd < 0) { + error("cannot open %s: %m", argv[dev_optind]); + return -EINVAL; + } + ret = btrfs_scan_one_device(fd, argv[dev_optind], &fs_devices, + &num_devices, + BTRFS_SUPER_INFO_OFFSET, + SBREAD_DEFAULT); + close(fd); + if (ret < 0) { + errno = -ret; + error("device scan %s: %m", argv[dev_optind]); + return ret; + } + dev_optind++; + } + + return 0; +} diff --git a/common/device-scan.h b/common/device-scan.h index f805b489f595..e2480d3eb168 100644 --- a/common/device-scan.h +++ b/common/device-scan.h @@ -58,5 +58,6 @@ int add_seen_fsid(u8 *fsid, struct seen_fsid *seen_fsid_hash[], int fd, DIR *dirstream); void free_seen_fsid(struct seen_fsid *seen_fsid_hash[]); int test_uuid_unique(const char *uuid_str); +int btrfs_scan_stdin_devices(int dev_optind, int argc, char **argv); #endif From patchwork Thu Jun 8 06:01:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13271646 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 DD3B3C7EE2E for ; Thu, 8 Jun 2023 06:02:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234359AbjFHGCN (ORCPT ); Thu, 8 Jun 2023 02:02:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234378AbjFHGCM (ORCPT ); Thu, 8 Jun 2023 02:02:12 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CE1B1984 for ; Wed, 7 Jun 2023 23:02:11 -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 357M8YRT001986 for ; Thu, 8 Jun 2023 06:02:11 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=NT0Mkltyxjhs+WiBu2arp+DNh30boxCweahITMuWCpw=; b=ELKLEP5HivWYqFX2LET8QXEpH9OfrQTPzh3cvQ98bk6Xzi2lRyf4CWDDaOiWKYSs1N0R xoUmgZ/AtuWLI+PSsLu/zNFDJ+zM02D9jvZ/IxPSmj5neYno5T5h/kzZIV2PqNSQVDdD uT9TPguswNO+RcMjyR0ttuIQXdggHjGu8gyl5ylYp7xZXpvkhI2tMh/Nb7jzTGuGCztG lS9AY9E2A/JiPCogJYrdWUMn4IvOpbfNRVfKwQqZ5VMrvWTgYjSrs7sWBAe9HdE9THAl 0Otb33dxAFlfy9jAGE04xwTFTdErH6DuWkL4yfeOlVuYoA5T20YLkH4XqNyM6h0bzbMI qA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3r2a6u3e8d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 08 Jun 2023 06:02:10 +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 3583M1Qk036875 for ; Thu, 8 Jun 2023 06:02:10 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2103.outbound.protection.outlook.com [104.47.70.103]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3r2a6kntwd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 08 Jun 2023 06:02:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ad72i7urgtaAMpprQ1rTJpAYrKwlqlLFkh7PXOAu4bKG3LxdxVoYvxKHKExCmFJ09QbLLYW8uk27O8XFC555VZ38q/a3ifY/xnTIZzACSdt1G+7o3sX87H1SboGOI0VzhO0zBaULkHwjYoQEBR+oxJm0U5mR/rkwMcRAZhCLHbgXuuodijY5GzcvJSvmCrn9RRfZRYUYc3Lp5BaSS9KSTnl8KUN/VFkbk/Y772es3PF6mai0VLW4gB87UMJXfN/PkjPr8jJMsw5poacCwALh7XXbTc91AvkH71LzmXCZQ3Czxt/Ylpez14Y9mRErQQBEHyEycFT4Nk3s0w/ztIL4ZQ== 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=NT0Mkltyxjhs+WiBu2arp+DNh30boxCweahITMuWCpw=; b=QNEkJsEEYch1bEJkTzbZdfet0Vt33Ddqa5gZaTebShkdNYLahfd1pi2FG4h68ygPmew29y7xJ/9W3tnV3iy4ONYCKVaamH+oq+4Ep4D259KIKR6ShBOfycHol/5DPxnwKamsQFiKUyXhg3KScfGQ0CEzecyMERgcQQ4LgxBRQ14FxC64eUKgmZAYXF048VieBx2KB4Gy4pMCDkrrnVzveaJMLu0zFv0rsSGj6w7b5fbBD/tFmhqYfHCZ8V1S7m6bUE8w9ltXc02EUU8SCXV1goPedWwitYIHjD6Kf7nJXFRQsGCbonzA5hXEahWNEH2e50uxFvpsHk4/bd1tUKHq/w== 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=NT0Mkltyxjhs+WiBu2arp+DNh30boxCweahITMuWCpw=; b=qXl+B7+3vMYnDR44BlzBMEPUHBu1Ot3HDNj8u9ra0mo1eA2vf1JJ8fKS4NY+TOMUbq/E68pN03K7qLdy88YCqgFB3W27wjlyHyK6/MgyEy+PPajvYPNM5kW6GljRyYKEI+q4IYb8B1p1Ygm2ydZBEa1zogd088DHZLoZoR+p9Rs= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by DM4PR10MB6181.namprd10.prod.outlook.com (2603:10b6:8:88::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Thu, 8 Jun 2023 06:02:07 +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.6455.030; Thu, 8 Jun 2023 06:02:07 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain Subject: [PATCH 7/7] btrfs-progs: refactor check_where_mounted with noscan argument Date: Thu, 8 Jun 2023 14:01:04 +0800 Message-Id: <0a2e9bf9050a6fa5d24ef4a3dd7322c7f1d3a120.1686202417.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SG3P274CA0010.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::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_|DM4PR10MB6181:EE_ X-MS-Office365-Filtering-Correlation-Id: 3de79dbc-2f40-4987-d9f1-08db67e5e41b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yKf+6yXXsbSFHFTTZsnHhbEzCoC72sQnnv85B+K8li3T9xK+jTh0ydSWzgj/hKfa5LMlbviHeEk6TaU11VbocETgMNtQrorIm7sshEAE7EOWDg7uel2PBDksm4LsmTm+xxtgw6iIn1gqtzYstBaGad4BDQPNpIS0zsSmGKwymfiHZ7vFmlMjvUeiyxrvxuM9jj4AdLhmdzRCW86hgX3IKK6BxlwsdEB74lEQORyaaoKsrwKq+VtCGC8vqYd7ZcF0dtmHnWgz1VrzVVJ4Gf1OjoW9cTCFsy4GAy2rK9eDrA5MF1+oWSpsF2oy78+NChgNHiGm8gEtvAZ/JdGQuxVAUGdtNG48Tj4wMBDM8y6i7NZISpDcfvrZ9zMoBD8GrqzK2upgARccMh8LxiB9dXWyTUHtUkcS/2k8GH2nhJkQVI2LJG4rYr1Etf3mtpUDOTUPcvfTQGL3vJKCPfmEvsVKPf8xjqv+4dVdQG1YVvjD2qsWIneM9yFH3HGNtc17BKrLMWv3VvFh5/cxhvkhVZHjldGlFACo0yysjB9wHvK7EKQZ0eqZsr0zVbDbKAVB9VIr 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)(366004)(346002)(136003)(39860400002)(376002)(396003)(451199021)(8676002)(8936002)(107886003)(478600001)(41300700001)(316002)(5660300002)(6666004)(6486002)(26005)(6916009)(44832011)(186003)(4326008)(66476007)(66556008)(66946007)(6512007)(6506007)(83380400001)(2616005)(2906002)(38100700002)(36756003)(86362001);DIR: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wBmLqyeWIo/S/h/t0AZGcDBiBXbUkOblhsAJykH01ekYeCG27rSbBvGYg7ak3PfHf2dxn18FXzUC38YPitB0oB1PTxAPvXchBgXyY484kKH6LsXlRvaURIwj7B4SXYSAzh6aF2SOC9sH4VzbG8ymziyntdT3H80cP+z5tJmQGwOFLLkdvRBVPKq6uVBRjdIqig/juH39Faf3S3HkXTITGeh5WlhPf3wdxyrRv9GtKnOV75U238XXl6CauO3kz5fYkoeR+P2iNuvO803pTQYObxtojMYS6L/lEjUeEWA3lY7DdvGaL+gKAsdbGinYqKlSu+NVq7bGOALWiDuRZ/RZUI903tUYcJt/BxaLD5a7+Uzo8kDYUNvm/oj2X6ztZZPBEvnwASHF1mXHrm04dqbDZkmJ3/MGsXljmEUWelltkl7KvsnOS6AFtPMDyrMpSfaLWElLQAYYf7r7mDJSxYBz+6rcBwsdnwHOApzyxhlieJAs/x/IXBXhzvMASmheR7lWetE9Ep7QhoVTPyudIpDSLIxyaD4PazkcTzcgcukz1h9thpTa/FQYaMXv4QDbKTtPWkWVoonfM1+gC7641LKjDijgYzQFpL85xnfGztdg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Wvgbk4PCgPp3MhhPE4+dPC1fC1ebt/Gun/CPZ8m4l9E5XaKJA1/h/bDVPzDehseq/KMl4YUdY2Hg/OkouwpeUaZkznJXZe6xmj20CDViIW9z7M+e6c1m0rka8BKdlEE+06k0P8HQRyTNLXb6hJYuGg3kD8aqeKqh3RG+mYj2l/13xlHTIVWk91E0nCeBYcVch+56raDNK6i51qWOy49S9vGITSLFHiQVWd96ex+YuSF/TqbZhGCr3o+b+BNwqM4iVDhgwGIIYhCNSHAQOVj5Crh5AX/9nycHugYxpSidiDMzAGoQC2wW9ElTvboBlqOux787Mghuu46Ff2sWx7HNVyMFdurMFEH98kXgvrC0iRu17Qpjq3RMQYPAJW+hvWI8QjKd3005urtrz8E4M5Jq4G+Vi1PH2ZXyOXD6/z7R1upIPsR9O+J/vXm6/I4ya8WR4llzGZ8B3vtSe54aeTy4kXUjkQCTrjjSeAisRoKWuBwE434URFayRkZVmYJP62rDCawtI2JZQuaHevH3egV/9IkysvFnVPCEbWGONQCtBFZDw6zlsr95t/N+Rx5oHnGyaUVULVto8AhONomqHz8vye5aB74hmixUMv3FOYjsJJ8eeLZu61lnhFaFODA4p80ot1fl0T4aGe6q/v2jCLevClzM9ph3Nph6XwxORiSYLMZlvJubZ4MNTNbM8/AeV+MNrOipYqFaGrpYaebCcVIi5eqMnndYbmLsYIJaTh4FFKkBigPippstgLWxbjnEsCnN X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3de79dbc-2f40-4987-d9f1-08db67e5e41b X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2023 06:02:07.6439 (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: F2AsSrYqs75Kmi3TdxZMhl+eHvBABshAunrz3TcblANWXBbvmwtAJvgkk0Z05hGO4d8dZCE/ey1uO5/zy0cvkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6181 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-06-08_03,2023-06-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 suspectscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306080049 X-Proofpoint-GUID: 7b_j1Eul72S0nW1SoXxd56Lf68JnUMEU X-Proofpoint-ORIG-GUID: 7b_j1Eul72S0nW1SoXxd56Lf68JnUMEU Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The function check_where_mounted() scans the system for all other btrfs devices, which is necessary for its operation. However, in certain cases, devices remained in the scanned state is undesirable. So introduces the 'noscan' argument to make devices unscanned before return. Signed-off-by: Anand Jain --- common/open-utils.c | 9 ++++++--- common/open-utils.h | 3 ++- common/utils.c | 3 ++- tune/main.c | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/common/open-utils.c b/common/open-utils.c index 1e18fa905b51..e34abee97f60 100644 --- a/common/open-utils.c +++ b/common/open-utils.c @@ -53,7 +53,8 @@ static int blk_file_in_dev_list(struct btrfs_fs_devices* fs_devices, } int check_mounted_where(int fd, const char *file, char *where, int size, - struct btrfs_fs_devices **fs_dev_ret, unsigned sbflags) + struct btrfs_fs_devices **fs_dev_ret, unsigned sbflags, + bool noscan) { struct btrfs_fs_devices *fs_devices_mnt = NULL; struct mntent *mnt; @@ -108,6 +109,8 @@ int check_mounted_where(int fd, const char *file, char *where, int size, } if (fs_dev_ret) *fs_dev_ret = fs_devices_mnt; + else if (noscan) + btrfs_close_all_devices(); ret = (mnt != NULL); @@ -132,7 +135,7 @@ int check_mounted(const char* file) return -errno; } - ret = check_mounted_where(fd, file, NULL, 0, NULL, SBREAD_DEFAULT); + ret = check_mounted_where(fd, file, NULL, 0, NULL, SBREAD_DEFAULT, false); close(fd); return ret; @@ -168,7 +171,7 @@ int get_btrfs_mount(const char *dev, char *mp, size_t mp_size) goto out; } - ret = check_mounted_where(fd, dev, mp, mp_size, NULL, SBREAD_DEFAULT); + ret = check_mounted_where(fd, dev, mp, mp_size, NULL, SBREAD_DEFAULT, false); if (!ret) { ret = -EINVAL; } else { /* mounted, all good */ diff --git a/common/open-utils.h b/common/open-utils.h index 3924be36e2ea..27000cdbd626 100644 --- a/common/open-utils.h +++ b/common/open-utils.h @@ -23,7 +23,8 @@ struct btrfs_fs_devices; int check_mounted_where(int fd, const char *file, char *where, int size, - struct btrfs_fs_devices **fs_dev_ret, unsigned sbflags); + struct btrfs_fs_devices **fs_dev_ret, unsigned sbflags, + bool noscan); int check_mounted(const char* file); int get_btrfs_mount(const char *dev, char *mp, size_t mp_size); int open_path_or_dev_mnt(const char *path, DIR **dirstream, int verbose); diff --git a/common/utils.c b/common/utils.c index 436ff8c2a827..b62f9f04ad5a 100644 --- a/common/utils.c +++ b/common/utils.c @@ -230,7 +230,8 @@ int get_fs_info(const char *path, struct btrfs_ioctl_fs_info_args *fi_args, goto out; } ret = check_mounted_where(fd, path, mp, sizeof(mp), - &fs_devices_mnt, SBREAD_DEFAULT); + &fs_devices_mnt, SBREAD_DEFAULT, + false); if (!ret) { ret = -EINVAL; goto out; diff --git a/tune/main.c b/tune/main.c index e38c1f6d3729..0ca1e01282c9 100644 --- a/tune/main.c +++ b/tune/main.c @@ -268,7 +268,7 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) } ret = check_mounted_where(fd, device, NULL, 0, NULL, - SBREAD_IGNORE_FSID_MISMATCH); + SBREAD_IGNORE_FSID_MISMATCH, false); if (ret < 0) { errno = -ret; error("could not check mount status of %s: %m", device);