From patchwork Fri May 3 09:08:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13652517 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80A3B1367 for ; Fri, 3 May 2024 09:09:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714727373; cv=fail; b=l4XwmxwHgED9VsU+Vh4BNJGqAgzJZnFFqJVqVth/879LXHzrxdrLSlFysCJqjMxRBEISNDlQ6be/YEVm2+QP/2c9tuVicrfP9OS804ZSJVVHqQcyJIkwEBMcy63CvusJwM/eIr0HSNgbJbYvIiTV3W4SBeyqwKoM/dMAj1bU5x8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714727373; c=relaxed/simple; bh=Krs3jhmQz7NuUXFJsdHbG5zTfzVQmZQ3kEA6m6ru9PM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=VtMv5A74HhtsCkJWyQuS0NYhq/Hb6Wu5/SenPMbtj1vf9dNHbpr6ITUJ1tnCRAv6aPkO1cdS0yzV5KhyZwJDNWO7ZF/3lut16F4igg1XAM+J+b2ak4ArTpt9axvQs/0KYNANjuhEOeBlGNKewaGCyWnvwvnx8+YG1D0Hp4tsdP4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=LVNYPyM2; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=xcI5/cd8; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="LVNYPyM2"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="xcI5/cd8" 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 4436hweS026009 for ; Fri, 3 May 2024 09:09:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=kV3N5z1KDNpRfp76uxvthtVHAfsy+jaKZRPmlyCFv8Q=; b=LVNYPyM2flJ8hKLWDEYy7Z0YgBZpIvDGoVlH7k8Upiwc6kgPasBcyLYL1URTk2yvMym6 VWXlYYqdtGbAw6gYMyXiW4usXo9qiVzS8Bw4YotUts44HBdjMAWAJeSReaG/r5dcmYUT L+cFqIWJd/arOK+EExE/4W4kgXL8KY6BmqPZbEVcD2rgmR6Tnr9SKZHghj50AkmtihX7 TBfrwh3XQQgXIjbnd8kkR1rE9l1RHmXAfy/ortkUZwcwQ1Iob1s9V5IOjLbjMYg6WEPa XpAuXXhkACTEaGCvPbqddkCI7P0Xv67h4iRaMsq6/GeY/Efs+KJIE6zelK3S3PNeNq5h TQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xrryvgcdy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 03 May 2024 09:09:30 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 4438UYJo034694 for ; Fri, 3 May 2024 09:09:29 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2041.outbound.protection.outlook.com [104.47.74.41]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3xrqtbuuj7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 03 May 2024 09:09:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jghjj33Njy2v31Glve1LdHR2uNe6ZlX3NOfvCULlHKNA0cFRmrYzu85nDte7dWYtjeC+rhNK1an8TJCX4mOOox0yyawFPcepf9Qv0mP4Zy3mz/z8wVBURxQcmXn0yDlqyOglJZJSLy0IGq9NYCwkj5JIZomCY7GWhI8Ra7cL8/9znSXS7h8lpr6YV4ZePCDtiLLg4xYaaCxoJ0z2XwukDqkr2moInsaymRJ2Tclq4UbPqPeefJ8rxGbDQlweb8aji0Cv71EKaVnQNlO9+AxvXGvcyxjjw9VhmaescpzYx/ZXaI8I+ykiWCsu7zbKaUyo03lKk8mu3QfbXk7kmgZtqA== 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=kV3N5z1KDNpRfp76uxvthtVHAfsy+jaKZRPmlyCFv8Q=; b=UVY9mZ3TEvyweRlZGxe3hAzB+KZGieT/5R6TweQRUaqxQqoaS7XA1bhfaEUSAUiF/XQEGiSwg9V8VGFws0cZ3ONo2DPMMD1oiw7WIVv5UUSsyGbXWD8jfhZs1/KpcYdY0Fn1BrM7qOL22WZPs8+CR5CxoM4ba1rWA1DKGg1oAxRakSq1TCdGwNmI9KP31XUgzKC23Q5VBeWpquIpAu2nR+7eWvFAvUnNRxsbUi7ZvUhEygpmynLz9vXkRDEd6s/QD5/n6NFRcSK+9WfaVAXtDWSOYN326m2CWt9J3gCPC1rYJMVBDVgY76L4OgDo0AHY09wk3e2HbjoXHk7CArB9bA== 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=kV3N5z1KDNpRfp76uxvthtVHAfsy+jaKZRPmlyCFv8Q=; b=xcI5/cd8ZJcke+JgMCaL0GmKQXZUsgTXWbwGkOXsuKigQ8waUPMuxE9qS4DU9+lGwCxnYpP0nmxjNotNyOY7I3Xlc+pxwguAaMw4J4CP+VNI5Ke9N0h/+tHFueWisf+lO6x0T2yYNqNrNznWJSvaJz6AnNtsfm2JFkNkeDnwuEk= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by LV8PR10MB7752.namprd10.prod.outlook.com (2603:10b6:408:1e7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.30; Fri, 3 May 2024 09:09:28 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65%5]) with mapi id 15.20.7544.023; Fri, 3 May 2024 09:09:28 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 1/4] btrfs-progs: convert: refactor ext2_create_file_extents add argument ext2_inode Date: Fri, 3 May 2024 17:08:52 +0800 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: X-ClientProxiedBy: SG2PR04CA0178.apcprd04.prod.outlook.com (2603:1096:4:14::16) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|LV8PR10MB7752:EE_ X-MS-Office365-Filtering-Correlation-Id: 411f0c6c-1077-490a-7db8-08dc6b50bc41 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: c9kczHBCBxdP3dg4GTs8/9qC6lyMnwlFfVL63t4CCPuqt6zxRF7+cnMfQ1CfHcmWVnLV11q7oVsqi8yagh1PvXKClBWNreHHuvONnN2x1jnxNBRKjSEEM1DfBa7uvYAIZjUO+mMc2xlVT2EAdR+aI1426/JonV80Z01WE6ZzUeDQahbkOMRr2xfSGUJFXHNQ6PhCo+PaaRIQ4x1JbS9Tmiu5Wcf/7cnMmtoYtEVn5eJhM5KMbh3DWsDmlLQ4HIaKqL+uIadn3coVEH1r0VlYmGkAksg/Qi9oaSO8qUhApNLThck3eboF1JKjv7wPL57dkpgLDcjhkREe4qLcwUalwkrFvpXQ6PWG3tijph6uyEKMe+QRXEZ3h+ixIXh0DLo77y/DlOKTOPVIZtFR5YqYFfaxbyGjl+r80jY5FPVcuUVGizSU4LcrY3QN4HfAA1YM24o8NE3835RqRFUBJG7rmvtH3zIUuoU+37FWNK2v8fwO9RL7/qCjl+5gnipSAntS4QC9cYiR5MMH2wI8YYdMAyfbArOAUYKWhZXqlBQIaG9VdoK7ibJ71vPWb573fApru4YTNg4c+pRy+lGetPL6TuV06y3dB4JBQQ2r8DQiEurezrzOHZPGCLsnxX1AdoOKoPXO7GtRGQQsvzkF5LfHG9j1ru+yl8JOlnwM7yoPGSphCG+rQ7hkF4G5RMXmBjGerVbW//nHzUH7OuTA5YMCPCpx6v2PwPYt9yJoeFqKdKDa33mltp5eHqvG8Z6eTLJ3LFahP6WnLPxsIFXN6hwzUrfPW8anUqOE1E3KmjTHYdmZBqKNxklad14kiiYGEARXvxSAN4cZerZOB/e/wzqNkOtKqMKi/9co9hXSSh4rgXXnEBBSeRfph0fiGbtluLv2h3mpQ1cR8br84Jscmu8w9tVDusuRepgycl52bQIZQRVyKBsObUTDjTCgKKwJ6RqIplpR10VDSRtE5S4k5Ay3UPFBBA2CELAroK8OtqmiJfnfStEqfu26npOXeMtdQV7Kvu/Bo3wj3KtNcXKjCfU0yPxjenoYZr4SNVJ/AfdC3sz73gBf5bJulYVMyXQzPPEAelyxAUFcS0QTsM/VF0jrT1pJ7kUXQHfy7L1xA8/DcteB/damjgtXuuX1kHtfFsYBALTgpPujby1yo1QETZ7HeywwxhZEu4LNVYy9h5s3H/54Y3G9OEBb6jeqbGpR7mNOVLpn2r/Yo9jaWmLwi1t7OK2wNnJ37m/RRfynCreBNrALh/omAv41KNksmUu3GQQT+MYHfXSGclKkplZkp7G4nw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: acUJxAGKH4PlngY/9H3gwM4EW9nf7eb5/oz22pr0sqnlRUhu719EYXlaJgXpDW5NDqJzN2U8qFl7El19LbP4pEjacNfbkhfhegy9MM8QqHjLeYIuq8C7yg+tKNCqnn7u/oWWGvNHUcqGEFb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PuaAMLF34pYuq8Hy2K1XvRLexHXc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 411f0c6c-1077-490a-7db8-08dc6b50bc41 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2024 09:09:28.2374 (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: jC8ZDOFWTE0zW15L0NtSbkTgRiBh24/DikEzdQKcTcgHEhfYaEZ2PioKzvwppKYeAH/mHs03mXjDESnNiYTPAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR10MB7752 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-03_05,2024-05-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2405030065 X-Proofpoint-GUID: gOjTS0PsLQYkCcKj9ifJ79rfuhs7EZjq X-Proofpoint-ORIG-GUID: gOjTS0PsLQYkCcKj9ifJ79rfuhs7EZjq This is a preparatory patch adds an argument '%ext2_inode' for the function __btrfs_record_file_extent(); to be used in the following patches. Signed-off-by: Anand Jain --- convert/source-ext2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/convert/source-ext2.c b/convert/source-ext2.c index 2186b2526e38..a3f61bb01171 100644 --- a/convert/source-ext2.c +++ b/convert/source-ext2.c @@ -310,6 +310,7 @@ static int ext2_create_file_extents(struct btrfs_trans_handle *trans, struct btrfs_root *root, u64 objectid, struct btrfs_inode_item *btrfs_inode, ext2_filsys ext2_fs, ext2_ino_t ext2_ino, + struct ext2_inode *ext2_inode, u32 convert_flags) { int ret; @@ -384,6 +385,7 @@ static int ext2_create_symlink(struct btrfs_trans_handle *trans, btrfs_set_stack_inode_size(btrfs_inode, inode_size + 1); ret = ext2_create_file_extents(trans, root, objectid, btrfs_inode, ext2_fs, ext2_ino, + ext2_inode, CONVERT_FLAG_DATACSUM | CONVERT_FLAG_INLINE_DATA); btrfs_set_stack_inode_size(btrfs_inode, inode_size); @@ -903,7 +905,7 @@ static int ext2_copy_single_inode(struct btrfs_trans_handle *trans, switch (ext2_inode->i_mode & S_IFMT) { case S_IFREG: ret = ext2_create_file_extents(trans, root, objectid, - &btrfs_inode, ext2_fs, ext2_ino, convert_flags); + &btrfs_inode, ext2_fs, ext2_ino, ext2_inode, convert_flags); break; case S_IFDIR: ret = ext2_create_dir_entries(trans, root, objectid,