From patchwork Mon Jun 7 05:27:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12302521 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D40FCC48BC2 for ; Mon, 7 Jun 2021 05:28:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B09FF61205 for ; Mon, 7 Jun 2021 05:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230139AbhFGF3z (ORCPT ); Mon, 7 Jun 2021 01:29:55 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:37592 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbhFGF3y (ORCPT ); Mon, 7 Jun 2021 01:29:54 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1575Q27g006947 for ; Mon, 7 Jun 2021 05:28:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=xAUdgw8y60laQgDvZZSCMnvkM5W7wWeoOTpyPsLqkCY=; b=pI0KQT+JqaU1C1yxzqy6ZI89U+I2oqhNjNyu2/KosmdZZ2bJuCz5t5VllHbtbNnqG0Hi vAwz99AiATKjou4uGSif4vb6hPOAidKEjomml1C8w3NBy6dHjfHDAE1gGhb0zBDMFmy/ Y0afsDrUuswjTJBkrN9Lszg+DD8y8rrE2XAAsE3rHNv3weQxskvEk4sUodwAcCn1W7uS PKPo5qDLOBqqFvVw3f9NRjWtLK1GbWSXD+JRVAc19n9n6kKbLtCz6AJ7Uoq4dwdo1IjO H9Ld443oNsgHwPS2IHS+UVf8oFnv8AaV0CKK1f37VaCodxlIq1FV1T6vqjjOU5Ju9EC6 yA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 3914qugaq5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 07 Jun 2021 05:28:02 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1575PmCj178624 for ; Mon, 7 Jun 2021 05:28:01 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by aserp3020.oracle.com with ESMTP id 3906snnq3j-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 07 Jun 2021 05:28:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mBYO5m1TM6cKX7bq7Y7JZzUNz7zG73SsTEWmxGP/obIbvuyBJKtVkiNVqVCVGwcQFyJDbM/EGyI0craFvmUrb9uPv7abCq8ScNtObAESu5I2xKVFdE4AQ7oosFGfZz2D5Oov52ZdN5zckFylquIceQMmIcut8BQtdAd6tafntRpbc22dTKJmN1kjUMF9ppT2HktmWaFfShzrpwiDTgmZ0rRhzwo5XgZzBWBXR2p0NFvB3un6yCppdD8oF4fxvR3azlfnLTFIzZthuUdX9J1wXNluTdkKH2nQ4hEiEPT4ZFA0E49qpUAMj7pgKaPH0oigAYiEjh6gun7ikr51RBYBAg== 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-SenderADCheck; bh=xAUdgw8y60laQgDvZZSCMnvkM5W7wWeoOTpyPsLqkCY=; b=YWsV7uTpw2DVLt/Gk3qYrsFwfeqwSCSKPdNvXwScIhf8f2fzWMbGSoa7FHMaKbnQfUxytIJHLZPzQBRdAtQBsEAcKSv9XLEfbzWRO+GOGvdhRGN2lzsECBNio4TaB3V0tK5u4ppN8VkqVMae2no4EaS+P//pdql5DEJKUrOFsZg6kfpxIgTQjsqxT27DsU7Bwty3RoLS8+b+q/USxZtoxR+t0EpToziOjEDcHEJkbKTa9k3VDohkJ3iKDBy5Z8gjMrFtop97bnXzhiyg8gSpDeFJC2bZcGMRnwaZ7Dn12SKPBCfVRmo3NHIPOL1Fr07RZzkftGJUmd4r1ivJgguf5A== 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=xAUdgw8y60laQgDvZZSCMnvkM5W7wWeoOTpyPsLqkCY=; b=yxG31UVi7ycb48Lc0Q2wtJSMRJP+J7Ga98oAcLBXZ5ENgMLdPVTSZ55Qu3Uvo3pTQsBU0MW3qbj82JSfAZEzD6om4jjRJw2si/vslpI7HAhHBvtxhVOpTzdpY/3o0Wt+qC6j1vJ9MC/EA1qxN/jVIAuu7GCXNrFmpJvGmtJpMdA= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by SJ0PR10MB4687.namprd10.prod.outlook.com (2603:10b6:a03:2d8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.23; Mon, 7 Jun 2021 05:27:58 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::a9c4:d124:3473:1728]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::a9c4:d124:3473:1728%5]) with mapi id 15.20.4195.030; Mon, 7 Jun 2021 05:27:58 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v20 10/14] xfs: Add delay ready attr set routines Date: Sun, 6 Jun 2021 22:27:43 -0700 Message-Id: <20210607052747.31422-1-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 X-Originating-IP: [67.1.210.54] X-ClientProxiedBy: BYAPR08CA0019.namprd08.prod.outlook.com (2603:10b6:a03:100::32) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.210.54) by BYAPR08CA0019.namprd08.prod.outlook.com (2603:10b6:a03:100::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.20 via Frontend Transport; Mon, 7 Jun 2021 05:27:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: faeb8be0-0235-4469-5fb7-08d9297502ce X-MS-TrafficTypeDiagnostic: SJ0PR10MB4687: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p4L4DumqDhY2a6isItxzuZ2EjOtGays8Epe5AmNQtmB8SzO2sOx0YGnj7KwuXQ/KC9I6P84D7wMBL5dJ4OzWTEreRMkEXTO9UD+mdzdwV/Kw9qN79yV+9uM4XiS38kQK2E275qv9k8uLJnAcUBwawpwFWoEohYJ23G+74VCS2xbzXFL3Nm+BrreixaG2WdY2RYmfU+CcJDX1Fd/L61ThTToq9ToO8uhrHXCUK7kudPGEAkDBVEKCA/xOadyouSa1m9B30QDrsXcxiEbZAEDlAUmyruE1WUzLVsU4ZJdsGXSnz+00fiefYzXfPFr4EAdhZjGHVqo0kJTnu7S1Vyafeii1/HjncXgkBaW0C98irEkIbJ9oN1DJr7+plgcOc21nuEOlIn2xQGpgblnDy0Ptv2lYhbnvLnNm7r8UMbfS5NHRUWsBtd3Q+tkadfn+Zne6qsH4pbuc8OboVnUuYLOFUAZj1IIJV9ED4lWLwb22mHJXp3pkhmqOPQSHgruipMPKm6NwlYMAC97OnEHW6VB0luA2s9auAqUqYSnzfrxFWAv1C/9N7Ciffa+SCOPrZ2LRbWPIAaqkRzq3WVW3QsXrt8vJKFXYYki9DcuSASyF3rOB1YCJpnG5DOpwRu7rc5HzCmkeYN2F/YLohkgcZpKTqA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(376002)(346002)(136003)(396003)(366004)(186003)(16526019)(30864003)(1076003)(316002)(6512007)(6666004)(8676002)(8936002)(38350700002)(6486002)(26005)(83380400001)(44832011)(66476007)(66556008)(66946007)(36756003)(86362001)(5660300002)(956004)(52116002)(478600001)(38100700002)(6916009)(2616005)(2906002)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?wbRhYKbNhdDPJ9acOBZoV9/OfDeYfg?= =?utf-8?q?olLC3XRN2Y3U6/c82gxkJCgz8rIoROqUT1ZMd0xVQp6OFk+re1SzUH9hB/ASULbE2?= =?utf-8?q?hb6UChdYhxiPNgCvhQP2QBFR5YZxBpI6zJnTW2K/f3goAIQlt3WbnjReCYvfg4IlU?= =?utf-8?q?1tLNgfA1FUFrYsHxzpm3z0EU5agZZwPnIlvM4WN6Yk5oHrQ0wm/N8Fl8/gkWPFuj+?= =?utf-8?q?DZpFyroJLelp3F3wVbIRlbmY7mKwZrHHD+bpnAWqVwlrD86MniMEwLvYpccLHenZe?= =?utf-8?q?ZaCQdj9HOXqtrSHCunZjIbEGiVX1j51g5sZHe5jIeGAc82Cjf+Z/6loELVJkf3Ykk?= =?utf-8?q?Fu/PBvHrFEujf1dJqJeD4Vu4bA8D7dIY97ROolPlPX8wWYhiUTh0pNRHQP0fXgjT6?= =?utf-8?q?KOZaHIm2aEShZjLwJ81hyPasrewedvH+tx23txVTkw9r55+X4JNt5CVSAfZFaZOv+?= =?utf-8?q?1YCPlSvnoLyPXdELA8bnCN3LdXGAaT+qaGHtyS/rkhVk8FCJaYtJK8BBtDaj96TY7?= =?utf-8?q?wiJMUvkE1QoRKd2vqjUAftkLSt/BULA6wqDl9ws33DKSPN5TB8N1JXRQHCxZMazs1?= =?utf-8?q?NKGhh6Qz3aSRkt5Ckf19eTdBy0x99o3yClBY6prDyZfJBakm/9/FDjlck6zRlie/w?= =?utf-8?q?+w92XWimTzPzcBmPuFJfC+mGi24iZXHabofAFpx5y/mlFzFT+Ks/yr5GOyvt4bdtu?= =?utf-8?q?dMZLrE3Zh4bGDztjkNgzMX5vbYZtsaG3r7YGBxsbf2Nvbd8h8aJgU2n6vpChgGm4G?= =?utf-8?q?TNfIgSGi41Z6MmaqjtksR00uW9D3ImDXj1GmNLeNMIQBtELuxqsXiTfb+egP3zoUx?= =?utf-8?q?RJI5Tc65hZd7janeBFlb8mlfsPVfD3P2m7SYFZ4ehroDFkTH1/Jce8M+HTEcW1Sci?= =?utf-8?q?y4bY3JHtR1UrJJrfvg2Rxo3D/rtHAUW0WvFsFrTyAFkIjK6ekMpm+EIHAookehjcq?= =?utf-8?q?1Lh537HZwAuNfvADkY0DQdW8I3oRr5YA/p6jcE9Rb7LU9pbfIo+MQmbr1kZvEVL7Q?= =?utf-8?q?0o8mgJOnT197mdDf5flu3fB44/CfATSCO2+sixwkuzQDXcvplZdRY7w1dwJqTL7Ee?= =?utf-8?q?A1sJjYndXMfwPI7Ik1QrLGnhlfDm5HJa5WXicK3Gg23H4e6ysuU9qD0G5CEVwwftG?= =?utf-8?q?qhrIzsaHt4ISaexgLOjUlH/tXtshbrK9Hlx+cfzllew+B65QncGHFaMlKXa5eZdOy?= =?utf-8?q?UCotyXvrx5Qx12yVeX50gi/TgzbZC7xCRRnNldvNom3sQ198B4fejaz2nE05Za3dx?= =?utf-8?q?neVmzQ+rR0YXPz?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: faeb8be0-0235-4469-5fb7-08d9297502ce X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2021 05:27:58.6310 (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: zdMDhUMut9MJ0B151iHC2TDhvZAyqv82hbJ8a3nZWCuY+gKRYQO+ccVS6qG/dzH8VB0keEWQ9gfoRfS+UwQlybkbreW5WKGGA59CjBN1NMc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4687 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10007 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070041 X-Proofpoint-ORIG-GUID: UMlrYSKix-cBYFSF8thZSUUw1THm3ceO X-Proofpoint-GUID: UMlrYSKix-cBYFSF8thZSUUw1THm3ceO X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10007 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 phishscore=0 spamscore=0 malwarescore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 adultscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070041 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This patch modifies the attr set routines to be delay ready. This means they no longer roll or commit transactions, but instead return -EAGAIN to have the calling routine roll and refresh the transaction. In this series, xfs_attr_set_args has become xfs_attr_set_iter, which uses a state machine like switch to keep track of where it was when EAGAIN was returned. See xfs_attr.h for a more detailed diagram of the states. Two new helper functions have been added: xfs_attr_rmtval_find_space and xfs_attr_rmtval_set_blk. They provide a subset of logic similar to xfs_attr_rmtval_set, but they store the current block in the delay attr context to allow the caller to roll the transaction between allocations. This helps to simplify and consolidate code used by xfs_attr_leaf_addname and xfs_attr_node_addname. xfs_attr_set_args has now become a simple loop to refresh the transaction until the operation is completed. Lastly, xfs_attr_rmtval_remove is no longer used, and is removed. Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Reviewed-by: Brian Foster --- fs/xfs/libxfs/xfs_attr.c | 450 ++++++++++++++++++++++++---------------- fs/xfs/libxfs/xfs_attr.h | 274 +++++++++++++++++++++++- fs/xfs/libxfs/xfs_attr_remote.c | 100 ++++++--- fs/xfs/libxfs/xfs_attr_remote.h | 5 +- fs/xfs/xfs_trace.h | 1 - 5 files changed, 610 insertions(+), 220 deletions(-) diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c index 513d9ca..df20537 100644 --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -53,15 +53,16 @@ STATIC int xfs_attr_leaf_try_add(struct xfs_da_args *args, struct xfs_buf *bp); */ STATIC int xfs_attr_node_get(xfs_da_args_t *args); STATIC void xfs_attr_restore_rmt_blk(struct xfs_da_args *args); -STATIC int xfs_attr_node_addname(struct xfs_da_args *args, - struct xfs_da_state *state); -STATIC int xfs_attr_node_addname_find_attr(struct xfs_da_args *args, - struct xfs_da_state **state); -STATIC int xfs_attr_node_addname_clear_incomplete(struct xfs_da_args *args); +STATIC int xfs_attr_node_addname(struct xfs_delattr_context *dac); +STATIC int xfs_attr_node_addname_find_attr(struct xfs_delattr_context *dac); +STATIC int xfs_attr_node_addname_clear_incomplete( + struct xfs_delattr_context *dac); STATIC int xfs_attr_node_hasname(xfs_da_args_t *args, struct xfs_da_state **state); STATIC int xfs_attr_fillstate(xfs_da_state_t *state); STATIC int xfs_attr_refillstate(xfs_da_state_t *state); +STATIC int xfs_attr_set_iter(struct xfs_delattr_context *dac, + struct xfs_buf **leaf_bp); int xfs_inode_hasattr( @@ -244,7 +245,7 @@ xfs_attr_is_shortform( * Checks to see if a delayed attribute transaction should be rolled. If so, * transaction is finished or rolled as needed. */ -int +STATIC int xfs_attr_trans_roll( struct xfs_delattr_context *dac) { @@ -265,29 +266,58 @@ xfs_attr_trans_roll( return error; } +/* + * Set the attribute specified in @args. + */ +int +xfs_attr_set_args( + struct xfs_da_args *args) +{ + struct xfs_buf *leaf_bp = NULL; + int error = 0; + struct xfs_delattr_context dac = { + .da_args = args, + }; + + do { + error = xfs_attr_set_iter(&dac, &leaf_bp); + if (error != -EAGAIN) + break; + + error = xfs_attr_trans_roll(&dac); + if (error) { + if (leaf_bp) + xfs_trans_brelse(args->trans, leaf_bp); + return error; + } + } while (true); + + return error; +} + STATIC int xfs_attr_set_fmt( - struct xfs_da_args *args) + struct xfs_delattr_context *dac, + struct xfs_buf **leaf_bp) { - struct xfs_buf *leaf_bp = NULL; - struct xfs_inode *dp = args->dp; - int error, error2 = 0; + struct xfs_da_args *args = dac->da_args; + struct xfs_inode *dp = args->dp; + int error = 0; /* * Try to add the attr to the attribute list in the inode. */ error = xfs_attr_try_sf_addname(dp, args); - if (error != -ENOSPC) { - error2 = xfs_trans_commit(args->trans); - args->trans = NULL; - return error ? error : error2; - } + + /* Should only be 0, -EEXIST or -ENOSPC */ + if (error != -ENOSPC) + return error; /* * It won't fit in the shortform, transform to a leaf block. GROT: * another possible req'mt for a double-split btree op. */ - error = xfs_attr_shortform_to_leaf(args, &leaf_bp); + error = xfs_attr_shortform_to_leaf(args, leaf_bp); if (error) return error; @@ -296,102 +326,130 @@ xfs_attr_set_fmt( * push cannot grab the half-baked leaf buffer and run into problems * with the write verifier. */ - xfs_trans_bhold(args->trans, leaf_bp); - error = xfs_defer_finish(&args->trans); - xfs_trans_bhold_release(args->trans, leaf_bp); - if (error) { - xfs_trans_brelse(args->trans, leaf_bp); - return error; - } + xfs_trans_bhold(args->trans, *leaf_bp); + /* + * We're still in XFS_DAS_UNINIT state here. We've converted + * the attr fork to leaf format and will restart with the leaf + * add. + */ + dac->flags |= XFS_DAC_DEFER_FINISH; return -EAGAIN; } /* * Set the attribute specified in @args. + * This routine is meant to function as a delayed operation, and may return + * -EAGAIN when the transaction needs to be rolled. Calling functions will need + * to handle this, and recall the function until a successful error code is + * returned. */ int -xfs_attr_set_args( - struct xfs_da_args *args) +xfs_attr_set_iter( + struct xfs_delattr_context *dac, + struct xfs_buf **leaf_bp) { - struct xfs_inode *dp = args->dp; - struct xfs_buf *bp = NULL; - struct xfs_da_state *state = NULL; - int forkoff, error = 0; + struct xfs_da_args *args = dac->da_args; + struct xfs_inode *dp = args->dp; + struct xfs_buf *bp = NULL; + int forkoff, error = 0; - /* - * If the attribute list is already in leaf format, jump straight to - * leaf handling. Otherwise, try to add the attribute to the shortform - * list; if there's no room then convert the list to leaf format and try - * again. - */ - if (xfs_attr_is_shortform(dp)) { - error = xfs_attr_set_fmt(args); - if (error != -EAGAIN) - return error; - } + /* State machine switch */ + switch (dac->dela_state) { + case XFS_DAS_UNINIT: + /* + * If the fork is shortform, attempt to add the attr. If there + * is no space, this converts to leaf format and returns + * -EAGAIN with the leaf buffer held across the roll. The caller + * will deal with a transaction roll error, but otherwise + * release the hold once we return with a clean transaction. + */ + if (xfs_attr_is_shortform(dp)) + return xfs_attr_set_fmt(dac, leaf_bp); + if (*leaf_bp != NULL) { + xfs_trans_bhold_release(args->trans, *leaf_bp); + *leaf_bp = NULL; + } - if (xfs_attr_is_leaf(dp)) { - error = xfs_attr_leaf_try_add(args, bp); - if (error == -ENOSPC) { - /* - * Promote the attribute list to the Btree format. - */ - error = xfs_attr3_leaf_to_node(args); - if (error) + if (xfs_attr_is_leaf(dp)) { + error = xfs_attr_leaf_try_add(args, *leaf_bp); + if (error == -ENOSPC) { + error = xfs_attr3_leaf_to_node(args); + if (error) + return error; + + /* + * Finish any deferred work items and roll the + * transaction once more. The goal here is to + * call node_addname with the inode and + * transaction in the same state (inode locked + * and joined, transaction clean) no matter how + * we got to this step. + * + * At this point, we are still in + * XFS_DAS_UNINIT, but when we come back, we'll + * be a node, so we'll fall down into the node + * handling code below + */ + dac->flags |= XFS_DAC_DEFER_FINISH; + return -EAGAIN; + } else if (error) { return error; + } - /* - * Finish any deferred work items and roll the transaction once - * more. The goal here is to call node_addname with the inode - * and transaction in the same state (inode locked and joined, - * transaction clean) no matter how we got to this step. - */ - error = xfs_defer_finish(&args->trans); + dac->dela_state = XFS_DAS_FOUND_LBLK; + } else { + error = xfs_attr_node_addname_find_attr(dac); if (error) return error; - /* - * Commit the current trans (including the inode) and - * start a new one. - */ - error = xfs_trans_roll_inode(&args->trans, dp); + error = xfs_attr_node_addname(dac); if (error) return error; - goto node; - } else if (error) { - return error; + dac->dela_state = XFS_DAS_FOUND_NBLK; } - - /* - * Commit the transaction that added the attr name so that - * later routines can manage their own transactions. - */ - error = xfs_trans_roll_inode(&args->trans, dp); - if (error) - return error; - + return -EAGAIN; + case XFS_DAS_FOUND_LBLK: /* * If there was an out-of-line value, allocate the blocks we * identified for its storage and copy the value. This is done * after we create the attribute so that we don't overflow the * maximum size of a transaction and/or hit a deadlock. */ - if (args->rmtblkno > 0) { - error = xfs_attr_rmtval_set(args); + + /* Open coded xfs_attr_rmtval_set without trans handling */ + if ((dac->flags & XFS_DAC_LEAF_ADDNAME_INIT) == 0) { + dac->flags |= XFS_DAC_LEAF_ADDNAME_INIT; + if (args->rmtblkno > 0) { + error = xfs_attr_rmtval_find_space(dac); + if (error) + return error; + } + } + + /* + * Repeat allocating remote blocks for the attr value until + * blkcnt drops to zero. + */ + if (dac->blkcnt > 0) { + error = xfs_attr_rmtval_set_blk(dac); if (error) return error; + return -EAGAIN; } + error = xfs_attr_rmtval_set_value(args); + if (error) + return error; + + /* + * If this is not a rename, clear the incomplete flag and we're + * done. + */ if (!(args->op_flags & XFS_DA_OP_RENAME)) { - /* - * Added a "remote" value, just clear the incomplete - *flag. - */ if (args->rmtblkno > 0) error = xfs_attr3_leaf_clearflag(args); - return error; } @@ -404,7 +462,6 @@ xfs_attr_set_args( * In a separate transaction, set the incomplete flag on the * "old" attr and clear the incomplete flag on the "new" attr. */ - error = xfs_attr3_leaf_flipflags(args); if (error) return error; @@ -412,29 +469,37 @@ xfs_attr_set_args( * Commit the flag value change and start the next trans in * series. */ - error = xfs_trans_roll_inode(&args->trans, args->dp); - if (error) - return error; - + dac->dela_state = XFS_DAS_FLIP_LFLAG; + return -EAGAIN; + case XFS_DAS_FLIP_LFLAG: /* * Dismantle the "old" attribute/value pair by removing a * "remote" value (if it exists). */ xfs_attr_restore_rmt_blk(args); + error = xfs_attr_rmtval_invalidate(args); + if (error) + return error; + /* fallthrough */ + case XFS_DAS_RM_LBLK: + /* Set state in case xfs_attr_rmtval_remove returns -EAGAIN */ + dac->dela_state = XFS_DAS_RM_LBLK; if (args->rmtblkno) { - error = xfs_attr_rmtval_invalidate(args); + error = __xfs_attr_rmtval_remove(dac); if (error) return error; - error = xfs_attr_rmtval_remove(args); - if (error) - return error; + dac->dela_state = XFS_DAS_RD_LEAF; + return -EAGAIN; } + /* fallthrough */ + case XFS_DAS_RD_LEAF: /* - * Read in the block containing the "old" attr, then remove the - * "old" attr from that block (neat, huh!) + * This is the last step for leaf format. Read the block with + * the old attr, remove the old attr, check for shortform + * conversion and return. */ error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, &bp); @@ -443,97 +508,116 @@ xfs_attr_set_args( xfs_attr3_leaf_remove(bp, args); - /* - * If the result is small enough, shrink it all into the inode. - */ forkoff = xfs_attr_shortform_allfit(bp, dp); if (forkoff) error = xfs_attr3_leaf_to_shortform(bp, args, forkoff); /* bp is gone due to xfs_da_shrink_inode */ return error; - } -node: + case XFS_DAS_FOUND_NBLK: + /* + * Find space for remote blocks and fall into the allocation + * state. + */ + if (args->rmtblkno > 0) { + error = xfs_attr_rmtval_find_space(dac); + if (error) + return error; + } - do { - error = xfs_attr_node_addname_find_attr(args, &state); - if (error) - return error; - error = xfs_attr_node_addname(args, state); - } while (error == -EAGAIN); - if (error) - return error; + /* fallthrough */ + case XFS_DAS_ALLOC_NODE: + /* + * If there was an out-of-line value, allocate the blocks we + * identified for its storage and copy the value. This is done + * after we create the attribute so that we don't overflow the + * maximum size of a transaction and/or hit a deadlock. + */ + dac->dela_state = XFS_DAS_ALLOC_NODE; + if (args->rmtblkno > 0) { + if (dac->blkcnt > 0) { + error = xfs_attr_rmtval_set_blk(dac); + if (error) + return error; + return -EAGAIN; + } + + error = xfs_attr_rmtval_set_value(args); + if (error) + return error; + } - /* - * Commit the leaf addition or btree split and start the next - * trans in the chain. - */ - error = xfs_trans_roll_inode(&args->trans, dp); - if (error) - goto out; + /* + * If this was not a rename, clear the incomplete flag and we're + * done. + */ + if (!(args->op_flags & XFS_DA_OP_RENAME)) { + if (args->rmtblkno > 0) + error = xfs_attr3_leaf_clearflag(args); + goto out; + } - /* - * If there was an out-of-line value, allocate the blocks we - * identified for its storage and copy the value. This is done - * after we create the attribute so that we don't overflow the - * maximum size of a transaction and/or hit a deadlock. - */ - if (args->rmtblkno > 0) { - error = xfs_attr_rmtval_set(args); + /* + * If this is an atomic rename operation, we must "flip" the + * incomplete flags on the "new" and "old" attribute/value pairs + * so that one disappears and one appears atomically. Then we + * must remove the "old" attribute/value pair. + * + * In a separate transaction, set the incomplete flag on the + * "old" attr and clear the incomplete flag on the "new" attr. + */ + error = xfs_attr3_leaf_flipflags(args); if (error) - return error; - } - - if (!(args->op_flags & XFS_DA_OP_RENAME)) { + goto out; /* - * Added a "remote" value, just clear the incomplete flag. + * Commit the flag value change and start the next trans in + * series */ - if (args->rmtblkno > 0) - error = xfs_attr3_leaf_clearflag(args); - goto out; - } - - /* - * If this is an atomic rename operation, we must "flip" the incomplete - * flags on the "new" and "old" attribute/value pairs so that one - * disappears and one appears atomically. Then we must remove the "old" - * attribute/value pair. - * - * In a separate transaction, set the incomplete flag on the "old" attr - * and clear the incomplete flag on the "new" attr. - */ - error = xfs_attr3_leaf_flipflags(args); - if (error) - goto out; - /* - * Commit the flag value change and start the next trans in series - */ - error = xfs_trans_roll_inode(&args->trans, args->dp); - if (error) - goto out; + dac->dela_state = XFS_DAS_FLIP_NFLAG; + return -EAGAIN; - /* - * Dismantle the "old" attribute/value pair by removing a "remote" value - * (if it exists). - */ - xfs_attr_restore_rmt_blk(args); + case XFS_DAS_FLIP_NFLAG: + /* + * Dismantle the "old" attribute/value pair by removing a + * "remote" value (if it exists). + */ + xfs_attr_restore_rmt_blk(args); - if (args->rmtblkno) { error = xfs_attr_rmtval_invalidate(args); if (error) return error; - error = xfs_attr_rmtval_remove(args); - if (error) - return error; - } + /* fallthrough */ + case XFS_DAS_RM_NBLK: + /* Set state in case xfs_attr_rmtval_remove returns -EAGAIN */ + dac->dela_state = XFS_DAS_RM_NBLK; + if (args->rmtblkno) { + error = __xfs_attr_rmtval_remove(dac); + if (error) + return error; + + dac->dela_state = XFS_DAS_CLR_FLAG; + return -EAGAIN; + } - error = xfs_attr_node_addname_clear_incomplete(args); + /* fallthrough */ + case XFS_DAS_CLR_FLAG: + /* + * The last state for node format. Look up the old attr and + * remove it. + */ + error = xfs_attr_node_addname_clear_incomplete(dac); + break; + default: + ASSERT(dac->dela_state != XFS_DAS_RM_SHRINK); + break; + } out: return error; } + /* * Return EEXIST if attr is found, or ENOATTR if not */ @@ -997,18 +1081,18 @@ xfs_attr_node_hasname( STATIC int xfs_attr_node_addname_find_attr( - struct xfs_da_args *args, - struct xfs_da_state **state) + struct xfs_delattr_context *dac) { - int retval; + struct xfs_da_args *args = dac->da_args; + int retval; /* * Search to see if name already exists, and get back a pointer * to where it should go. */ - retval = xfs_attr_node_hasname(args, state); + retval = xfs_attr_node_hasname(args, &dac->da_state); if (retval != -ENOATTR && retval != -EEXIST) - goto error; + return retval; if (retval == -ENOATTR && (args->attr_flags & XATTR_REPLACE)) goto error; @@ -1034,8 +1118,8 @@ xfs_attr_node_addname_find_attr( return 0; error: - if (*state) - xfs_da_state_free(*state); + if (dac->da_state) + xfs_da_state_free(dac->da_state); return retval; } @@ -1048,19 +1132,23 @@ xfs_attr_node_addname_find_attr( * * "Remote" attribute values confuse the issue and atomic rename operations * add a whole extra layer of confusion on top of that. + * + * This routine is meant to function as a delayed operation, and may return + * -EAGAIN when the transaction needs to be rolled. Calling functions will need + * to handle this, and recall the function until a successful error code is + *returned. */ STATIC int xfs_attr_node_addname( - struct xfs_da_args *args, - struct xfs_da_state *state) + struct xfs_delattr_context *dac) { - struct xfs_da_state_blk *blk; - struct xfs_inode *dp; - int error; + struct xfs_da_args *args = dac->da_args; + struct xfs_da_state *state = dac->da_state; + struct xfs_da_state_blk *blk; + int error; trace_xfs_attr_node_addname(args); - dp = args->dp; blk = &state->path.blk[state->path.active-1]; ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC); @@ -1077,18 +1165,15 @@ xfs_attr_node_addname( error = xfs_attr3_leaf_to_node(args); if (error) goto out; - error = xfs_defer_finish(&args->trans); - if (error) - goto out; /* - * Commit the node conversion and start the next - * trans in the chain. + * Now that we have converted the leaf to a node, we can + * roll the transaction, and try xfs_attr3_leaf_add + * again on re-entry. No need to set dela_state to do + * this. dela_state is still unset by this function at + * this point. */ - error = xfs_trans_roll_inode(&args->trans, dp); - if (error) - goto out; - + dac->flags |= XFS_DAC_DEFER_FINISH; return -EAGAIN; } @@ -1101,9 +1186,7 @@ xfs_attr_node_addname( error = xfs_da3_split(state); if (error) goto out; - error = xfs_defer_finish(&args->trans); - if (error) - goto out; + dac->flags |= XFS_DAC_DEFER_FINISH; } else { /* * Addition succeeded, update Btree hashvals. @@ -1120,8 +1203,9 @@ xfs_attr_node_addname( STATIC int xfs_attr_node_addname_clear_incomplete( - struct xfs_da_args *args) + struct xfs_delattr_context *dac) { + struct xfs_da_args *args = dac->da_args; struct xfs_da_state *state = NULL; struct xfs_da_state_blk *blk; int retval = 0; diff --git a/fs/xfs/libxfs/xfs_attr.h b/fs/xfs/libxfs/xfs_attr.h index 1267ea8..8de5d1d 100644 --- a/fs/xfs/libxfs/xfs_attr.h +++ b/fs/xfs/libxfs/xfs_attr.h @@ -164,6 +164,264 @@ struct xfs_attr_list_context { * v * done * + * + * Below is a state machine diagram for attr set operations. + * + * It seems the challenge with understanding this system comes from trying to + * absorb the state machine all at once, when really one should only be looking + * at it with in the context of a single function. Once a state sensitive + * function is called, the idea is that it "takes ownership" of the + * state machine. It isn't concerned with the states that may have belonged to + * it's calling parent. Only the states relevant to itself or any other + * subroutines there in. Once a calling function hands off the state machine to + * a subroutine, it needs to respect the simple rule that it doesn't "own" the + * state machine anymore, and it's the responsibility of that calling function + * to propagate the -EAGAIN back up the call stack. Upon reentry, it is + * committed to re-calling that subroutine until it returns something other than + * -EAGAIN. Once that subroutine signals completion (by returning anything other + * than -EAGAIN), the calling function can resume using the state machine. + * + * xfs_attr_set_iter() + * │ + * v + * ┌─y─ has an attr fork? + * │ | + * │ n + * │ | + * │ V + * │ add a fork + * │ │ + * └──────────┤ + * │ + * V + * ┌─── is shortform? + * │ │ + * │ y + * │ │ + * │ V + * │ xfs_attr_set_fmt + * │ | + * │ V + * │ xfs_attr_try_sf_addname + * │ │ + * │ V + * │ had enough ──y──> done + * │ space? + * n │ + * │ n + * │ │ + * │ V + * │ transform to leaf + * │ │ + * │ V + * │ hold the leaf buffer + * │ │ + * │ V + * │ return -EAGAIN + * │ Re-enter in + * │ leaf form + * │ + * └─> release leaf buffer + * if needed + * │ + * V + * ┌───n── fork has + * │ only 1 blk? + * │ │ + * │ y + * │ │ + * │ v + * │ xfs_attr_leaf_try_add() + * │ │ + * │ v + * │ had enough ──────────────y─────────────┐ + * │ space? │ + * │ │ │ + * │ n │ + * │ │ │ + * │ v │ + * │ return -EAGAIN │ + * │ re-enter in │ + * │ node form │ + * │ │ │ + * └──────────┤ │ + * │ │ + * V │ + * xfs_attr_node_addname_find_attr │ + * determines if this │ + * is create or rename │ + * find space to store attr │ + * │ │ + * v │ + * xfs_attr_node_addname │ + * │ │ + * v │ + * fits in a node leaf? ────n─────┐ │ + * │ ^ v │ + * │ │ single leaf node? │ + * │ │ │ │ │ + * y │ y n │ + * │ │ │ │ │ + * v │ v v │ + * update │ grow the leaf split if │ + * hashvals └── return -EAGAIN needed │ + * │ retry leaf add │ │ + * │ on reentry │ │ + * ├────────────────────────────┘ │ + * │ │ + * v │ + * need to alloc │ + * ┌─y── or flip flag? │ + * │ │ │ + * │ n │ + * │ │ │ + * │ v │ + * │ done │ + * │ │ + * │ │ + * │ XFS_DAS_FOUND_LBLK <────────────────┘ + * │ │ + * │ V + * │ xfs_attr_leaf_addname() + * │ │ + * │ v + * │ ┌──first time through? + * │ │ │ + * │ │ y + * │ │ │ + * │ n v + * │ │ if we have rmt blks + * │ │ find space for them + * │ │ │ + * │ └──────────┤ + * │ │ + * │ v + * │ still have + * │ ┌─n─ blks to alloc? <──┐ + * │ │ │ │ + * │ │ y │ + * │ │ │ │ + * │ │ v │ + * │ │ alloc one blk │ + * │ │ return -EAGAIN ──┘ + * │ │ re-enter with one + * │ │ less blk to alloc + * │ │ + * │ │ + * │ └───> set the rmt + * │ value + * │ │ + * │ v + * │ was this + * │ a rename? ──n─┐ + * │ │ │ + * │ y │ + * │ │ │ + * │ v │ + * │ flip incomplete │ + * │ flag │ + * │ │ │ + * │ v │ + * │ XFS_DAS_FLIP_LFLAG │ + * │ │ │ + * │ v │ + * │ need to remove │ + * │ old bks? ──n──┤ + * │ │ │ + * │ y │ + * │ │ │ + * │ V │ + * │ remove │ + * │ ┌───> old blks │ + * │ │ │ │ + * │ XFS_DAS_RM_LBLK │ │ + * │ ^ │ │ + * │ │ v │ + * │ └──y── more to │ + * │ remove? │ + * │ │ │ + * │ n │ + * │ │ │ + * │ v │ + * │ XFS_DAS_RD_LEAF │ + * │ │ │ + * │ v │ + * │ remove leaf │ + * │ │ │ + * │ v │ + * │ shrink to sf │ + * │ if needed │ + * │ │ │ + * │ v │ + * │ done <──────┘ + * │ + * └──────> XFS_DAS_FOUND_NBLK + * │ + * v + * ┌─────n── need to + * │ alloc blks? + * │ │ + * │ y + * │ │ + * │ v + * │ find space + * │ │ + * │ v + * │ ┌─>XFS_DAS_ALLOC_NODE + * │ │ │ + * │ │ v + * │ │ alloc blk + * │ │ │ + * │ │ v + * │ └──y── need to alloc + * │ more blocks? + * │ │ + * │ n + * │ │ + * │ v + * │ set the rmt value + * │ │ + * │ v + * │ was this + * └────────> a rename? ──n─┐ + * │ │ + * y │ + * │ │ + * v │ + * flip incomplete │ + * flag │ + * │ │ + * v │ + * XFS_DAS_FLIP_NFLAG │ + * │ │ + * v │ + * need to │ + * remove blks? ─n──┤ + * │ │ + * y │ + * │ │ + * v │ + * remove │ + * ┌────────> old blks │ + * │ │ │ + * XFS_DAS_RM_NBLK │ │ + * ^ │ │ + * │ v │ + * └──────y── more to │ + * remove │ + * │ │ + * n │ + * │ │ + * v │ + * XFS_DAS_CLR_FLAG │ + * │ │ + * v │ + * clear flags │ + * │ │ + * ├──────────┘ + * │ + * v + * done */ /* @@ -180,12 +438,22 @@ enum xfs_delattr_state { XFS_DAS_RMTBLK, /* Removing remote blks */ XFS_DAS_RM_NAME, /* Remove attr name */ XFS_DAS_RM_SHRINK, /* We are shrinking the tree */ + XFS_DAS_FOUND_LBLK, /* We found leaf blk for attr */ + XFS_DAS_FOUND_NBLK, /* We found node blk for attr */ + XFS_DAS_FLIP_LFLAG, /* Flipped leaf INCOMPLETE attr flag */ + XFS_DAS_RM_LBLK, /* A rename is removing leaf blocks */ + XFS_DAS_RD_LEAF, /* Read in the new leaf */ + XFS_DAS_ALLOC_NODE, /* We are allocating node blocks */ + XFS_DAS_FLIP_NFLAG, /* Flipped node INCOMPLETE attr flag */ + XFS_DAS_RM_NBLK, /* A rename is removing node blocks */ + XFS_DAS_CLR_FLAG, /* Clear incomplete flag */ }; /* * Defines for xfs_delattr_context.flags */ #define XFS_DAC_DEFER_FINISH 0x01 /* finish the transaction */ +#define XFS_DAC_LEAF_ADDNAME_INIT 0x02 /* xfs_attr_leaf_addname init*/ /* * Context used for keeping track of delayed attribute operations @@ -193,6 +461,11 @@ enum xfs_delattr_state { struct xfs_delattr_context { struct xfs_da_args *da_args; + /* Used in xfs_attr_rmtval_set_blk to roll through allocating blocks */ + struct xfs_bmbt_irec map; + xfs_dablk_t lblkno; + int blkcnt; + /* Used in xfs_attr_node_removename to roll through removing blocks */ struct xfs_da_state *da_state; @@ -220,7 +493,6 @@ int xfs_attr_set_args(struct xfs_da_args *args); int xfs_has_attr(struct xfs_da_args *args); int xfs_attr_remove_args(struct xfs_da_args *args); int xfs_attr_remove_iter(struct xfs_delattr_context *dac); -int xfs_attr_trans_roll(struct xfs_delattr_context *dac); bool xfs_attr_namecheck(const void *name, size_t length); void xfs_delattr_context_init(struct xfs_delattr_context *dac, struct xfs_da_args *args); diff --git a/fs/xfs/libxfs/xfs_attr_remote.c b/fs/xfs/libxfs/xfs_attr_remote.c index c26193b..c1b09fa 100644 --- a/fs/xfs/libxfs/xfs_attr_remote.c +++ b/fs/xfs/libxfs/xfs_attr_remote.c @@ -439,9 +439,9 @@ xfs_attr_rmtval_get( /* * Find a "hole" in the attribute address space large enough for us to drop the - * new attribute's value into + * new attributes value into */ -STATIC int +int xfs_attr_rmt_find_hole( struct xfs_da_args *args) { @@ -468,7 +468,7 @@ xfs_attr_rmt_find_hole( return 0; } -STATIC int +int xfs_attr_rmtval_set_value( struct xfs_da_args *args) { @@ -628,6 +628,69 @@ xfs_attr_rmtval_set( } /* + * Find a hole for the attr and store it in the delayed attr context. This + * initializes the context to roll through allocating an attr extent for a + * delayed attr operation + */ +int +xfs_attr_rmtval_find_space( + struct xfs_delattr_context *dac) +{ + struct xfs_da_args *args = dac->da_args; + struct xfs_bmbt_irec *map = &dac->map; + int error; + + dac->lblkno = 0; + dac->blkcnt = 0; + args->rmtblkcnt = 0; + args->rmtblkno = 0; + memset(map, 0, sizeof(struct xfs_bmbt_irec)); + + error = xfs_attr_rmt_find_hole(args); + if (error) + return error; + + dac->blkcnt = args->rmtblkcnt; + dac->lblkno = args->rmtblkno; + + return 0; +} + +/* + * Write one block of the value associated with an attribute into the + * out-of-line buffer that we have defined for it. This is similar to a subset + * of xfs_attr_rmtval_set, but records the current block to the delayed attr + * context, and leaves transaction handling to the caller. + */ +int +xfs_attr_rmtval_set_blk( + struct xfs_delattr_context *dac) +{ + struct xfs_da_args *args = dac->da_args; + struct xfs_inode *dp = args->dp; + struct xfs_bmbt_irec *map = &dac->map; + int nmap; + int error; + + nmap = 1; + error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)dac->lblkno, + dac->blkcnt, XFS_BMAPI_ATTRFORK, args->total, + map, &nmap); + if (error) + return error; + + ASSERT(nmap == 1); + ASSERT((map->br_startblock != DELAYSTARTBLOCK) && + (map->br_startblock != HOLESTARTBLOCK)); + + /* roll attribute extent map forwards */ + dac->lblkno += map->br_blockcount; + dac->blkcnt -= map->br_blockcount; + + return 0; +} + +/* * Remove the value associated with an attribute by deleting the * out-of-line buffer that it is stored on. */ @@ -669,37 +732,6 @@ xfs_attr_rmtval_invalidate( } /* - * Remove the value associated with an attribute by deleting the - * out-of-line buffer that it is stored on. - */ -int -xfs_attr_rmtval_remove( - struct xfs_da_args *args) -{ - int error; - struct xfs_delattr_context dac = { - .da_args = args, - }; - - trace_xfs_attr_rmtval_remove(args); - - /* - * Keep de-allocating extents until the remote-value region is gone. - */ - do { - error = __xfs_attr_rmtval_remove(&dac); - if (error && error != -EAGAIN) - break; - - error = xfs_attr_trans_roll(&dac); - if (error) - return error; - } while (true); - - return error; -} - -/* * Remove the value associated with an attribute by deleting the out-of-line * buffer that it is stored on. Returns -EAGAIN for the caller to refresh the * transaction and re-call the function. Callers should keep calling this diff --git a/fs/xfs/libxfs/xfs_attr_remote.h b/fs/xfs/libxfs/xfs_attr_remote.h index 002fd30..8ad68d5 100644 --- a/fs/xfs/libxfs/xfs_attr_remote.h +++ b/fs/xfs/libxfs/xfs_attr_remote.h @@ -10,9 +10,12 @@ int xfs_attr3_rmt_blocks(struct xfs_mount *mp, int attrlen); int xfs_attr_rmtval_get(struct xfs_da_args *args); int xfs_attr_rmtval_set(struct xfs_da_args *args); -int xfs_attr_rmtval_remove(struct xfs_da_args *args); int xfs_attr_rmtval_stale(struct xfs_inode *ip, struct xfs_bmbt_irec *map, xfs_buf_flags_t incore_flags); int xfs_attr_rmtval_invalidate(struct xfs_da_args *args); int __xfs_attr_rmtval_remove(struct xfs_delattr_context *dac); +int xfs_attr_rmt_find_hole(struct xfs_da_args *args); +int xfs_attr_rmtval_set_value(struct xfs_da_args *args); +int xfs_attr_rmtval_set_blk(struct xfs_delattr_context *dac); +int xfs_attr_rmtval_find_space(struct xfs_delattr_context *dac); #endif /* __XFS_ATTR_REMOTE_H__ */ diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index 3c1c830..96f93a7 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h @@ -1943,7 +1943,6 @@ DEFINE_ATTR_EVENT(xfs_attr_refillstate); DEFINE_ATTR_EVENT(xfs_attr_rmtval_get); DEFINE_ATTR_EVENT(xfs_attr_rmtval_set); -DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove); #define DEFINE_DA_EVENT(name) \ DEFINE_EVENT(xfs_da_class, name, \ From patchwork Mon Jun 7 05:27:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12302515 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2690C47082 for ; Mon, 7 Jun 2021 05:28:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 966D161208 for ; Mon, 7 Jun 2021 05:28:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229449AbhFGF3x (ORCPT ); Mon, 7 Jun 2021 01:29:53 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:56688 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbhFGF3x (ORCPT ); Mon, 7 Jun 2021 01:29:53 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1575OE4t164324 for ; Mon, 7 Jun 2021 05:28:02 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-type : mime-version; s=corp-2020-01-29; bh=XPX0XefVAdL3Ax0Fs8jqJb0IcNvVihKj12e7+yansjY=; b=0iR8Ro/X+W7O8aRgckQ4jxC6iT6MRoAv6jljoYC46VTuVxmhsv/hrdI3lrhjx9SMTWxa OI6aWZfXqcQa3/r82lOLQJ7WDwxBGxdBMTGfEpJTcLqUZmoUNfOGQWQd0NmKY81RlZBP 5XOZSS7I7kPx3/X3DdYzssyaT3m6bo+YpQO7NbjE7shEBc7fXT30YQxFqB+4yqIQKpLm 4pg/MAMft8/R2OkDct0xVEagjBccsRvr5rVzC1e95prS/smY41zem9Rz+yc803a0gdLz tSr0zJWJNS9kiTcCLv0aZXrrs1Q7kYGWGjeKzYNI4X5dcOwVIrwbofeuve6oFE8TNbdW 7A== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 3900ps1ttu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 07 Jun 2021 05:28:01 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1575PmCi178624 for ; Mon, 7 Jun 2021 05:28:00 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by aserp3020.oracle.com with ESMTP id 3906snnq3j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 07 Jun 2021 05:28:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LRi+M7WT8tF71W3HuHwsDeRRaMe9KvUwqTDV4uvtOLZiCXY0Lelabmryx82iyQrcj98c2KHQTZ4TMt/aJgLLEpvr7noyX0y1ylGJAh60HT6dveuNHS26a7ZD7g+Cl2Vq3pSasxoImMNWvprrPQDWvmxftWWtQ7wI7x07PTQ3NB8av0sVsdU+qKm6KNqxaYLCKcA7d/V//POnBbfJ+gO+FeKbxuW27wK8bxXp59Tm+YNItETl83T6L5Mnbi97NkfdCLTVuFNB/hEb7aOqIRukr3qx2rOrQR9MneUnthrqvEpK02i4KD9YsVLSriulv92a8IEcB05N9EVnIfMpGWf8rw== 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-SenderADCheck; bh=XPX0XefVAdL3Ax0Fs8jqJb0IcNvVihKj12e7+yansjY=; b=SOeDAxytubYrtu7GyVdDO2VwLWkeBMlyj7SLcFYmC/LbL10sXHiikwGVrUvfNa3cniB+BFxiEor++1pNiXANx/lmfCA3V021drH9tLFgivKdtiCAmugEtX8ScYGuO1Sm4wdUpOKQX4V0FZBkgxbWODyBCsR4iduG25leK2gG7ChmABS0Yrski5rFdECR50Cvxmsj/4up2Y1p4iU75h59YtgYdgaKAbg9byBIcgl29Ct4D9Bh3OLxxB4PZtkUlitL7F9+gBtnWUN2zEQ8F2Udozlbhm1MdzCC1FKPIbBwY4eIDL2WbvdSmzBOBuxfiViTSLquIY8vPpadWSik+mp9Wg== 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=XPX0XefVAdL3Ax0Fs8jqJb0IcNvVihKj12e7+yansjY=; b=F7geGEBvWUP2FcUAXGTCyMcojBNtShPYwNZymdnV1XKOMmHdNmxKqEmeStghCQCEEciXC7FkJ7hrq7oU/xkNL03hCgKaS1ZYxAtGPgh6EJR5yrJaV6Iey1AdiRplkk2PszL1bV7xsVzw+1ck6Ei3zXB8J8+Urkf3fTuP/+w09Sc= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by SJ0PR10MB4687.namprd10.prod.outlook.com (2603:10b6:a03:2d8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.23; Mon, 7 Jun 2021 05:27:59 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::a9c4:d124:3473:1728]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::a9c4:d124:3473:1728%5]) with mapi id 15.20.4195.030; Mon, 7 Jun 2021 05:27:59 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v20 11/14] xfs: Remove xfs_attr_rmtval_set Date: Sun, 6 Jun 2021 22:27:44 -0700 Message-Id: <20210607052747.31422-2-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210607052747.31422-1-allison.henderson@oracle.com> References: <20210607052747.31422-1-allison.henderson@oracle.com> X-Originating-IP: [67.1.210.54] X-ClientProxiedBy: BYAPR08CA0019.namprd08.prod.outlook.com (2603:10b6:a03:100::32) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.210.54) by BYAPR08CA0019.namprd08.prod.outlook.com (2603:10b6:a03:100::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.20 via Frontend Transport; Mon, 7 Jun 2021 05:27:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a9ae60a6-0257-4b85-5c0d-08d929750318 X-MS-TrafficTypeDiagnostic: SJ0PR10MB4687: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CDBLAZCaM17FWHHPUGuqtRp4YSYDc0Cx5GdQNVFxTenyApyqsO+1XU11FwABgqFgi64vwNbB6ei9qmNgvJ7ihmd68FEYTPLwmQ8VWHcGvRB0LP2bOf2Q7zgqPbAP/rRck+kC5IJgZ31XlgKdpiMD7nwGuM7CMvv2Fiv2VeKcT1DPApygorzp6IK03if9WOKKNktWnhuypvp0T/1lCQewvRzyuQ8sOn0lTJzFUr5foQC4Grxuxw3kkF7F1beLew+YC0DCBcIsVu0Z/3SxHf1dPJnKipwUOaOPUbk2ZHRT0jE5Gzx+T7Nn31PZmCL+LppZpD6NdE2ieTg6TXpE6e6/viT9e1Qb9KpMiQ2rvGl63AonIuq14yw0CWlo9FqwwaWz1ZyREI21MPdnBJK/F9Bj7FDXHM71524RRRdHHuNVMMrFTai24lLq7vEtK/N7ASdCkawKvG/OLgtOnSXCxgJPpMITWEKu1HV1E2PeezEwO6qfKOJmrSp7nwBhyF/bSz4/Hd/YcnZVgqi9ey8bPCibhv56piqq8okypqakuNSiUAryh9mvSJsmlS84C378o0kM57YJhovex4lt57NgU5RNliASPfvZhL85EqVlTH3EWz8fY4/bp8Qe8gOuO/vozdwB0CvFqtJLHfnDTvQr4Cdks+/gWOnB9avuIn9OTl7fe9KqkmFwugpCudJOOKNCS0R2 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(376002)(346002)(136003)(396003)(366004)(186003)(16526019)(1076003)(316002)(6512007)(6666004)(8676002)(8936002)(38350700002)(6486002)(26005)(83380400001)(44832011)(66476007)(66556008)(66946007)(36756003)(86362001)(5660300002)(956004)(52116002)(478600001)(38100700002)(6916009)(2616005)(2906002)(6506007)(69590400013);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: O/T3u8e8j7bpWOU/g2siT+fHky8CZYZuurD8ZUi3bD5KTH85ugyp/ZccRewFhFdT6ErPsiYe2VPliB8itBCjFOcglmyj4UfheiaZZhZ2XABFInftLJ2wbls668mYKmedMiYnUzGIfhS1zw9/26PFZdpTMzONlCat/iBpbSYElLxTVWvA3M2DttRWHR6u0OUx2mndMWuCFN/sq3S2y4Tisl/rIRbjPMSH10vMtgA5b09yJbm66ci8n+bZC/7HTH7uGF+XdNEMPQ7aF19+yQjYCnrOqpCaZbjOKfm7fozwXtPwgLkNDjswlofw/8ryM5J0zKa+GN8YCFUeqIjWUwVPsxa/uVrXk0YxrqEHMDFptzWN0/PUSV1wh+qrqtpBcxhhHrwUhNjmiHoYlg+aBdJ4nVLNDfEfZUOERMkf1kEhGi21M1wGh5+0MjW8/egp0T5YYGd8oMhd/1xYsg+Q7iFhgHz5HoYFHx1bWz9UQGQ+fzsIvj5QBpcI0Z/GMnB0gCjhYRhdw6zh8RQddwgLXWchSc6groDEjOwU+cjsdtPzlagaRNqzezRNTJwkIxNgZhLcu+X92Udtmcv/Q0FeVUolk3cjFWa/cqNgCWNp/Zcggdyr/HJIobbRbxa4nfyn07KTw7ahEmbazlZ+YYb8DuaBrqITnoBiFtj+v8AkYLJKnRZglbqkx73/XI7PCsy5aPrq63lHn2m+ZUTcabvYQEoHKFfzZf0JGjm1Zuv460F9L8XXRaCYxaHPAtDWhzIS7CBIqR3B22OZUFuf1/xK4A1njyuLWDKLigTFODG5GtpYdKNmHsqYgjfFkXZ3v3KZndnugXwuC5N78MQSRxxVRgK/xH1wPgINUU1NIZ0qZZt+W/34flIEszE6NdZ+cgGYtjUw7UN7PaaTVdylgMGOm1mzNkEzNTd9UAHtP2ZLv8DnedpwIoeEedOjJ+LPY0cuQ9R8MZ/AQgXwuLQ+F6zibj3jlFRyVIezghUbTPc+AmMsd+5g2vXZwyY07Yq7tGK1m0Cq6JiBnIuJQuf3ytnpZn77xEEFQSoNardwo7kMmFSG8+D1KEx7+uuDMZj5H31lTjhvOoPQbGhiDIoR3Rq5InOeoifbFhC1B//fpArM8ZERitXODAxtLjR5YCSTWvVP822PwzKuwQm4zZxseLWGS6vg7MDazPl0+P5vwm5a3RrhC9RVetsWn52TvTLm7GtFer+vCvc4r1u507pROxG4MoTsvypxOczRMt1uJpmQlJQ8nxJFL/Kk+sn495PwUI6Cu+l8hAC62hAdZj635yzl/wWTr2ZaxtMWWJ6ripB+2JdnvFju7CdeyTq7C+ugTx9IirYt X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9ae60a6-0257-4b85-5c0d-08d929750318 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2021 05:27:59.1129 (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: vAYcraKoi9azTb02CsrMiArnB7dahCcDdHuO4n5hCfhj/KCwi2I3ArAUmfzNRDqXg9fVW94/8M+xUDPVBJPdtd0HeW99qlCjTq9WlqSD130= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4687 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10007 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070041 X-Proofpoint-GUID: p40G7nnknaC9ckPrxS8KqVQHNQ53X3ph X-Proofpoint-ORIG-GUID: p40G7nnknaC9ckPrxS8KqVQHNQ53X3ph X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10007 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 clxscore=1015 bulkscore=0 spamscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070041 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This function is no longer used, so it is safe to remove Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R --- fs/xfs/libxfs/xfs_attr_remote.c | 66 ----------------------------------------- fs/xfs/libxfs/xfs_attr_remote.h | 1 - 2 files changed, 67 deletions(-) diff --git a/fs/xfs/libxfs/xfs_attr_remote.c b/fs/xfs/libxfs/xfs_attr_remote.c index c1b09fa..0c8bee3 100644 --- a/fs/xfs/libxfs/xfs_attr_remote.c +++ b/fs/xfs/libxfs/xfs_attr_remote.c @@ -562,72 +562,6 @@ xfs_attr_rmtval_stale( } /* - * Write the value associated with an attribute into the out-of-line buffer - * that we have defined for it. - */ -int -xfs_attr_rmtval_set( - struct xfs_da_args *args) -{ - struct xfs_inode *dp = args->dp; - struct xfs_bmbt_irec map; - xfs_dablk_t lblkno; - int blkcnt; - int nmap; - int error; - - trace_xfs_attr_rmtval_set(args); - - error = xfs_attr_rmt_find_hole(args); - if (error) - return error; - - blkcnt = args->rmtblkcnt; - lblkno = (xfs_dablk_t)args->rmtblkno; - /* - * Roll through the "value", allocating blocks on disk as required. - */ - while (blkcnt > 0) { - /* - * Allocate a single extent, up to the size of the value. - * - * Note that we have to consider this a data allocation as we - * write the remote attribute without logging the contents. - * Hence we must ensure that we aren't using blocks that are on - * the busy list so that we don't overwrite blocks which have - * recently been freed but their transactions are not yet - * committed to disk. If we overwrite the contents of a busy - * extent and then crash then the block may not contain the - * correct metadata after log recovery occurs. - */ - nmap = 1; - error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)lblkno, - blkcnt, XFS_BMAPI_ATTRFORK, args->total, &map, - &nmap); - if (error) - return error; - error = xfs_defer_finish(&args->trans); - if (error) - return error; - - ASSERT(nmap == 1); - ASSERT((map.br_startblock != DELAYSTARTBLOCK) && - (map.br_startblock != HOLESTARTBLOCK)); - lblkno += map.br_blockcount; - blkcnt -= map.br_blockcount; - - /* - * Start the next trans in the chain. - */ - error = xfs_trans_roll_inode(&args->trans, dp); - if (error) - return error; - } - - return xfs_attr_rmtval_set_value(args); -} - -/* * Find a hole for the attr and store it in the delayed attr context. This * initializes the context to roll through allocating an attr extent for a * delayed attr operation diff --git a/fs/xfs/libxfs/xfs_attr_remote.h b/fs/xfs/libxfs/xfs_attr_remote.h index 8ad68d5..61b85b9 100644 --- a/fs/xfs/libxfs/xfs_attr_remote.h +++ b/fs/xfs/libxfs/xfs_attr_remote.h @@ -9,7 +9,6 @@ int xfs_attr3_rmt_blocks(struct xfs_mount *mp, int attrlen); int xfs_attr_rmtval_get(struct xfs_da_args *args); -int xfs_attr_rmtval_set(struct xfs_da_args *args); int xfs_attr_rmtval_stale(struct xfs_inode *ip, struct xfs_bmbt_irec *map, xfs_buf_flags_t incore_flags); int xfs_attr_rmtval_invalidate(struct xfs_da_args *args); From patchwork Mon Jun 7 05:27:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12302517 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D2C9C4743F for ; Mon, 7 Jun 2021 05:28:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A8CB16120F for ; Mon, 7 Jun 2021 05:28:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229923AbhFGF3y (ORCPT ); Mon, 7 Jun 2021 01:29:54 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:56690 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbhFGF3x (ORCPT ); Mon, 7 Jun 2021 01:29:53 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1575PK10165338 for ; Mon, 7 Jun 2021 05:28:03 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-type : mime-version; s=corp-2020-01-29; bh=9oy4iuErDo/7ws3+56O+cjNmEjSSIJdXWWmfsVT2OPM=; b=S3Pc+CDAdsPTOMe0TZgOVQqWlqduPRnPOxFuYy6EPjzsI54OwuZ6jRCGeBZ/EOlUB953 fABPIlbLGPnjlXh+qTBQYyBV2JQ+ZmMSN5oAMF5TXhkmt4vGk0bdaf8OgDB/TklFrU9c oDbQNC66h4j3A5a69e/VkwYSnOg9zTBWcX0JjsFGHCiS9J7IFWoplgQqWWNQseiyzBmT dL7rFJXpTaNCWrMApPkn7UPzz6ffyIyWmBlWKN68QK7RAT9wmMlpivriPmc8YQh1IZGQ T2ewmFX0vaodeShEr387rhyjmuQSk70mkgtiIVILeLD4LAtgKBruWEWNiYeG9DJ56qJ7 Yw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 3900ps1ttv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 07 Jun 2021 05:28:02 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1575PmCk178624 for ; Mon, 7 Jun 2021 05:28:02 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by aserp3020.oracle.com with ESMTP id 3906snnq3j-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 07 Jun 2021 05:28:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mrLXjA3/+cus5wWg8RczVEuLFcsuhp9TM5xtQYU18cYdTIeAi1zeZO0xccBtpnKNgnhGHkE5XdJcYo2OI1nA2lnS5aBK3IsEbjbEkmyaxgZx2UDuL8lLL5DgHb1+dG9WXSVlJeAdzqeDgpTK1gYM/R0J2Re5sz901F6nxXeUwOf6OzrR2ROaULgu8WSgbqoqV2pKHgVE39cD3pLpCONXvwLNMjhJ+KDZHy2HBYPZ+fLYPbHbYpHrjPbZRSlosfWSbyi1bvvVKw/JJX85SHaAjrvw5yN7fW/2tmk9neoZN0/tf66FjRxfimFXL6VqWYXqDDG7+G7gTcIEjVTP+DYVTw== 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-SenderADCheck; bh=9oy4iuErDo/7ws3+56O+cjNmEjSSIJdXWWmfsVT2OPM=; b=R1yAUs6WDKWE8GzBXjV1pAKmRXqQS40hXRmtuobvnSBooP9etRgBF3HrIIK6bhpUNSDjKBAAwWhSg5AFT4llqxVPYqJYdMDiStguhi3Q2U4IkxU/N+2lR7qdoIY0V9+Mt1OJArktyTd7N82tyb6ltX9zWolLRelhD02qeahz8DefanmPGbTbC7jGvi8Y332L9eKgqNJ/RXGx7PWyrzvETaiTgKLrPDAhYrrjVITzxdzW/MbZSYexaJzNeIL3du+hGf/fxfZmjZ+90XgoW2/prWsZlMIsl+WV7t5QPvkY7rvKFt+TpX/IZ0dfXFHHOySuEW6i10MOgxudr5Jb0xT09Q== 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=9oy4iuErDo/7ws3+56O+cjNmEjSSIJdXWWmfsVT2OPM=; b=UK2bPiyn3YvTcA4eVfD8WGtHQH2Q6RqnwcDCZiQvW/a/L/zqMgPPbXLaDq6/eXuxIQJ4EvgHSTtFRX5JHzx6d68HAgXKlLwsjd8zoWuzlb4/w/aGWNREvOg6HUQMGQN4HnkC74plE7pKwjuEakLofQJ5v6ZELHtKr4WnHXFSrTA= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by SJ0PR10MB4687.namprd10.prod.outlook.com (2603:10b6:a03:2d8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.23; Mon, 7 Jun 2021 05:27:59 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::a9c4:d124:3473:1728]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::a9c4:d124:3473:1728%5]) with mapi id 15.20.4195.030; Mon, 7 Jun 2021 05:27:59 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v20 12/14] xfs: Clean up xfs_attr_node_addname_clear_incomplete Date: Sun, 6 Jun 2021 22:27:45 -0700 Message-Id: <20210607052747.31422-3-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210607052747.31422-1-allison.henderson@oracle.com> References: <20210607052747.31422-1-allison.henderson@oracle.com> X-Originating-IP: [67.1.210.54] X-ClientProxiedBy: BYAPR08CA0019.namprd08.prod.outlook.com (2603:10b6:a03:100::32) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.210.54) by BYAPR08CA0019.namprd08.prod.outlook.com (2603:10b6:a03:100::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.20 via Frontend Transport; Mon, 7 Jun 2021 05:27:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 040a602a-4f97-46e3-930a-08d929750368 X-MS-TrafficTypeDiagnostic: SJ0PR10MB4687: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SzoSBUZzuVQVjJZCtUFSkLEQxa0f2/HyOwwIRl+rbfUge5/lCNdxzk9+aM+Y0sfFptnF5PvPezZa434s4jLqf2tKMgifweyPUvBvk8/R6mCsSNcfPyc/I6r0tZpKYjXdVk3sykAS+YpM9JCbPEQ2OWlu5d9b10TAjI+AckZ3JEhwULOo/EqytAdi50R/qrsXSG3Pb95mtjKKVrnxQxtMS0oj/+zOLH2uUUy7S+3QSIHGQE+HH6NPyvPz7k2WQI4oScuX5yzFvsvtvzKk1KwMwt/SHvb2BpJGjtmvzjuTEt/CFYXJq3hSU9CusW8UJnuCUgBpRCiKDZhd5HkxPVGPdEr352SD1Lq1AsoC/5bXRKT6qGH6EsGzH2kQjDlZwc3/VerCxrwoee3W44cpP+LuxC/PCWaZvucGEPUp5NnmKiNTXgciHi0v5gvRCySMTl+ka3DgQq6OpAAVdYr2a4a3mZ1ER2fjH5FBPAH1Dkg6RpgL9OKF0Qrm0ysBgNYhe6SF/6V9ZtRZ+j350X8+DFSXnse0e+el/n/GqBEjYjbz1aJQqQErz00iX4juk/ZclLaeXAys03T1kAFHEKO7CMXnhvOMcMtGDHgyhSMms30JJjoJ7mvWaJJaAMOrBQC1IVODcqW79EpVXEJAzLNRStRGJgqmeyq54kB525lzvUwURuiEjWQ63oVBQW5+dXMJ+dGt X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(376002)(346002)(136003)(396003)(366004)(186003)(16526019)(1076003)(316002)(6512007)(6666004)(8676002)(8936002)(38350700002)(6486002)(26005)(83380400001)(44832011)(66476007)(66556008)(66946007)(36756003)(86362001)(5660300002)(956004)(52116002)(478600001)(38100700002)(6916009)(2616005)(2906002)(6506007)(69590400013);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ydMvzu+qsVA7ExcCX88+BOV+iO2YJrbinD2zfm2MFO5vQ30+ICYCsURT1TWTyrC4uynhNk3al0zKDY2lbHL5LiHFIBfO0hZ+AJuzSD99XWZx20llNypsmNmMTqncreLZRoYjAbZCEYv+HEIwwxdV71V3GND4a5YFsQSwaj3F/gpLws/9SVjc79fssHLWS3Q3uHTk3oP/rDRlVp+OdWHfhA2YdcTJE9CXdlGQJrVrlLe44Ef5foI1SgcuMoIJ62rezwfiVNYE7gpAIM+S3ocFTbEoeou0wye5ckq5Wx4tX0T/tge927Rsi+3on3ZdCDXgJVW5ipRf0TIlKlkURq/C7DcITJkQ+2VGdEMJXxqWKJt3XJxJfAMkgWWQOooZ14vxJMzfdKxUiiv1b/NqCT9/W+ICp1h7HUE6Pg11bx1ky1J/sajQSb67h3XgF+XjqvrD5pGBymhX8Qdoxg56QMfevBay2lW/tMFUESKYSrc8zGTBoWJRfiFoYHs+sJm2HKNps4QLrFx4h5rpoklakoRTNcgFQkju7FQ7QClCP/ewkK3oxzIsWBzSF41+Cj/96XmKHB6gRDVnHCyyv6lPIp5dOL6fy9IEtpH0FhC3vOMYTbdW7p8VSYPnlphz7M3EekierwVorsYDmBLI9O/QJKYMs4yqFQ7OH/VJmAUpZyKzjy7NrsA06vhCOKcIdavjYfnhPaI99OKgqe0y/uRadA1tBQpg56R0/aSY57o6xHtE+U1SiK/ANKAsp2Exc8hNEr+Is4+YkXwQ+iN5Ues4+NauSSIgT9ew+iGnQy9SL53LCZ8ecEQmpdD6IIf5b8lg2xgSuRJ4ySgbgwP53+CA8ieotHyQi7I+lTLLMU9fSQsBcHtittjaT6h67hIhEw485dggmC8RowQKgZ6MJ3luJHIwPO4RTnpzkLTYQ0Jpl+ytW0YmV4qZUASQVbiizf1q1Owrj2E2s7LbVkoHwK1TLcAMgFqL/fTWcfVRiFWZOLijZ27pdBWe0AyfLEndWV33f4PRuR0mWhXMavxsWfYY/OY/d3kxrjmmJrkGjU5ifWC5ILa5obyftMim3mk1guQAz1d9TPWcmWMdsLsNVk1gu0EZb0+bDm8+rgaIapQerhH+6EOIVQYmBJ+MvbLQraKjcnMIoIb1p/SyxS5OpOCmCl55tJJ12P3c8qHBxiQtkQmYgZQ3UL6lhH2gJFJfwlcXTCNxDECPurBSzyqPhRZITzOxJ+GpmdjlLDTvgdTf4o3peWgZM0PeJqBU7WfihylLKHXfn10cTm3KkaCqatiEgmsWIyqrrEo/dZNpaN2qGN35S1gB7qMph/0vI5BTtXXQTJ7V X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 040a602a-4f97-46e3-930a-08d929750368 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2021 05:27:59.5838 (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: dKg6E5JPrtPyJYGUJWgAG1W1G/fzphLU5AlIDxM0rSqVr2o7z06QlN6CpEGqRHjAFHNaqofD7sQ6Z9YEwO6cjxxpgF3IcCgebJqu9UxRbg0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4687 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10007 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070041 X-Proofpoint-GUID: jssUNFz6-mp7rGCzgu4xYoWdqNbuuZx3 X-Proofpoint-ORIG-GUID: jssUNFz6-mp7rGCzgu4xYoWdqNbuuZx3 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10007 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 clxscore=1015 bulkscore=0 spamscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070041 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org We can use the helper function xfs_attr_node_remove_name to reduce duplicate code in this function Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_attr.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c index df20537..2387a41 100644 --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -63,6 +63,8 @@ STATIC int xfs_attr_fillstate(xfs_da_state_t *state); STATIC int xfs_attr_refillstate(xfs_da_state_t *state); STATIC int xfs_attr_set_iter(struct xfs_delattr_context *dac, struct xfs_buf **leaf_bp); +STATIC int xfs_attr_node_remove_name(struct xfs_da_args *args, + struct xfs_da_state *state); int xfs_inode_hasattr( @@ -1207,7 +1209,6 @@ xfs_attr_node_addname_clear_incomplete( { struct xfs_da_args *args = dac->da_args; struct xfs_da_state *state = NULL; - struct xfs_da_state_blk *blk; int retval = 0; int error = 0; @@ -1222,13 +1223,7 @@ xfs_attr_node_addname_clear_incomplete( if (error) goto out; - /* - * Remove the name and update the hashvals in the tree. - */ - blk = &state->path.blk[state->path.active-1]; - ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC); - error = xfs_attr3_leaf_remove(blk->bp, args); - xfs_da3_fixhashpath(state, &state->path); + error = xfs_attr_node_remove_name(args, state); /* * Check to see if the tree needs to be collapsed. From patchwork Mon Jun 7 05:27:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12302523 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 512DAC4743C for ; Mon, 7 Jun 2021 05:28:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 34FB46120F for ; Mon, 7 Jun 2021 05:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230097AbhFGF3y (ORCPT ); Mon, 7 Jun 2021 01:29:54 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:37602 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbhFGF3y (ORCPT ); Mon, 7 Jun 2021 01:29:54 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1575S3Qi007863 for ; Mon, 7 Jun 2021 05:28:03 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-type : mime-version; s=corp-2020-01-29; bh=8BPR/yxCjs+1PKh344Vx5oDlK834YRRWJZf0nvi2DY0=; b=TsxNLjNkSWtHmFbGVOwhfKLwPtbjryEu3s24+cQXq4HNcaNBODVEfTOk4/hWyH2j5xTK 8yNxibe0H/gR1j7ytT3MOtAfncfUYVyhEedwd9uncmO+SyeC6q8jy3dKzZOdpVtOM+oK lMJAayUSotXIm2kfIX97uKsVTBLRf+ClYaReLlKTCrh0e6P5W2D1GO61F5whurKBG3jW 9BI1+HU7VdEIRaBg1EQJ6vCJtpuVfo8PM1cM/aNfryo5YX7y/5KZkbdEfB+GpZIBOz8b m/36qVAdp1jFI/AJ8hMleXC8OEbNxayxEtRR4BlIJGo/ygqc+39xvRcXFa3QbBQF2ECH IQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 3914qugaq6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 07 Jun 2021 05:28:03 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1575PmCl178624 for ; Mon, 7 Jun 2021 05:28:02 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by aserp3020.oracle.com with ESMTP id 3906snnq3j-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 07 Jun 2021 05:28:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f4NL+hrQy8HmY/WxdrDWf7VJK9h2MRSlqgEf1PhrJgtm8/CaF4KejG6cH3K1mZ7M1h9GMzpqARiCZuQweR93gAVpvNSmi3JY1aDoxiNT7HDOdI7q4P4kupu9KoT5x7nLhrE0crGytgrEzGIAiwHdA30pimFOENVvWL/57Xvgrzx7Y4R2bpeHZX20CkEdIs1gadDiXKDxFyNd1t9UvH4DdFztQyfypV3PbfLVvE8Z0Xbk/nmTbafUlpgtK83OrCQFYvkk+5lWnCdTCH0b/iHnbJp/hdMvKpcWdb5gx0lD59q7sP7uKV/VKHGdOqDGhMWQPDHMAyw+Hdv+dUcy9ekGlw== 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-SenderADCheck; bh=8BPR/yxCjs+1PKh344Vx5oDlK834YRRWJZf0nvi2DY0=; b=ll2vHl1ECCEAx0nsef9ZgP9a+iIpg/fUIZsF3KE1yIbJk+do2lcrxd+X1bSN2IK/zRohHhZzqViAmdD3oaRNbocTKm2Pao62ZlyVoKt8OdVzgZNeyIadj8Mli1wr+/9HAZXYzoJawy8dUZGoErh6+KrcN/jl1joVkXgwMJbG1A/jgilCYEyHhSs50LlV/vDHnYu5tszZzT/68SOWc6igl1BYrL9ztl0wuIXSnqP65PwY6jA4Eo/lUh7xeIhnv4JNBTAbwG+tx2gUfey23q0/ym7cTASzNJmvUoz9p15/hkCbj0zC0fwrePxfigT8574ChaDlE92PZEgBr0osb5G0MQ== 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=8BPR/yxCjs+1PKh344Vx5oDlK834YRRWJZf0nvi2DY0=; b=uxMdCALLtxRm4MQ/cXTOb8JI4dVF/OEZesYScDY4WnLNBsyLtHQeh9sH2G9+aZcMBuLm4KiRy54s/mD04lmZhmbZMWI2L9R6UJnIzlncGU1UDNfLyIpldPNXqJgCZlGIhctiKy+ADtvse6HeMRzCuZ5LNr516K+Ao16+wD/tVsE= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by SJ0PR10MB4687.namprd10.prod.outlook.com (2603:10b6:a03:2d8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.23; Mon, 7 Jun 2021 05:28:00 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::a9c4:d124:3473:1728]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::a9c4:d124:3473:1728%5]) with mapi id 15.20.4195.030; Mon, 7 Jun 2021 05:28:00 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v20 13/14] xfs: Fix default ASSERT in xfs_attr_set_iter Date: Sun, 6 Jun 2021 22:27:46 -0700 Message-Id: <20210607052747.31422-4-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210607052747.31422-1-allison.henderson@oracle.com> References: <20210607052747.31422-1-allison.henderson@oracle.com> X-Originating-IP: [67.1.210.54] X-ClientProxiedBy: BYAPR08CA0019.namprd08.prod.outlook.com (2603:10b6:a03:100::32) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.210.54) by BYAPR08CA0019.namprd08.prod.outlook.com (2603:10b6:a03:100::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.20 via Frontend Transport; Mon, 7 Jun 2021 05:27:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 77e67f92-5a04-46f5-67fd-08d9297503a6 X-MS-TrafficTypeDiagnostic: SJ0PR10MB4687: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Tn5FlftWtrk9q37NC5B+DWKk0PO2XshwM+n+9G8Lc9wGVvXahoslOKwtdk6i/zzpIzRjlqQXy6ELo/l6gPBX0Ac/M8OXqzq3imuZhQOIbdOhJLs+2FX2Asl0JDD8r0ptcQOfUx1KqWEFDkJLQCoOgWyI4PCs++foPIwD1BKRnBswRNB6rjFlSsI6sIW3Fy8xcJHrw+CWg2OLJB4hu2tRCsu6xBAXRSEtBaJJaPZyEBXO9SJgxjVYZylVR+BAvFQOd1JbRiO6Q7ateW1dsxLkk/qzFodzwuKkSwgiz1WmznfkQTfdlHjjh/Sk2zhTNR8FijcT55nd/WOFgSXOyApDfAjB3Q28o+1WRxTXicQr+Tfe0dQxsL1BCwDc2YWH0m+iCUHQpl+9YcgOUDAG20KUFwCl4bfMNdt4H/J6/lTVTf8ZKFz6JNo0DJJVCL9TZc4opASo90t5l6/dC0IKHibJjfdSNizj8Sv1/dNyR5Ebovvx2/Wwsq/rl02PogS6GVA/G0ARTHcrHzgr2zDVjDNsK408yxtv//343bZRa5Ai8a/ELKSao8FteVCZhoNZmzIV9MwSNEZsFckNCIn24UF8NRFsmWq8rBsSt1WrQv9z5+e64UMt7MeD76PXWptgNHVuMtBPjt5EJXIq2/BoDc8e/Sg0HPolC5Sgy6y3d0eQiIRf14hW8A5qDPdwIbkFazR6 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(376002)(346002)(136003)(396003)(366004)(186003)(16526019)(4744005)(1076003)(316002)(6512007)(6666004)(8676002)(8936002)(38350700002)(6486002)(26005)(83380400001)(44832011)(66476007)(66556008)(66946007)(36756003)(86362001)(5660300002)(956004)(52116002)(478600001)(38100700002)(6916009)(2616005)(2906002)(6506007)(69590400013);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: k9KFZIP98kWedozE0S/o+wkCRp3UIRBb7wxcxqX3u5M6dEx1VBgYN334/CvLw0WcwmKBSvFwW2sTqL2cGniTC251VL+3RmEttZ/NiBu9XzbUOYjowUtHZsaKNHEv0+NC+kyXd4vvosgpx85JyLhpEHgO0C7uBU/qteqbZos1oPTjsW3xYrdcoYqEHWnyEr/fhspN4FWB7F8X4DDQ5psZsjwGFMurYYvlxbnHdpjXOQLMsmICHhJHr5rRD8ZBW2f/0WSK8liFTUdIQZdz1ivFvn4z26dIR0mgOuVzgtvk6wML2nm3RIMOxzipWsJMevzJkQg9aIYIzBFJfG41/0X8OPVszId5AwTmq/dFVR0ZGy7Xp7CdvR42oxGReY7PJar/mGnNowVEZpa1EPEJWwvsAxoZdaldgQ2gCOwkj3Ene9rVcaX5JwtRYtNnnZ2Ybuwvj+M5NKcQeBW64WOszWg/M1jYTdS7UGXDUl8c1uuooOwEpb/jS9at4ypws4nO+AAGQ+pe4tG9PggYZHCUGvBCdB6DORWANEzOoIJ4PzbKx1iYSLPqwVxZ3a2YB9wDzWe9+QgiLrclcz7Hyyg5b4TgHWAK8VT52hYBxQnG+DcbW/AbbmCFA9kwrfQ3qyQSEH34BAcWB8iVdFGsjJncmOWDvQ8HwROjc0a7EITbWy5P8Re8Dxb1CnqIx50S93+X7sY2fXUKyyk9qdU2atGr/FBRTN+q1PFBzEPVq5ijcxkKRSVwJwl4J4k1ZuamjpO1wpAvr+s+7fvKg769j3Qshugs4QDPhtm/iZO4f/GjjNHu556NTrdSfgenziVe0wHz30Scnhq88KXWpjiKmgrBpOL18vak4HSWTFX5SAGbEmFzYslKoaOqUF49gBEjPH+t8uxE2vGRG8TSgeIqigbe7pipysKkMxixwPrT73JCSM3V94IPooOjROgWrNcd5q+dWfUCclYfyJ3SViCh3ugilhP0sarpM15OZ7wVtXrcoDk0vq+QiM286TFCIn/xnfzh3PoafVdemzntZ1pKpbKIqF2CNv/7PQVxjotCCyWplM5TW8gbYtqxU1ds8GyBDWO4R91tCaKtBykzXsb5a252Dv38mWEqBx8oo9FLIAQXDP4P8B4/0RmTozrF+9Ye6PJEPZ0+Q2XkQ44hv0CETcR8w40IYcei2/hpEBgh4x05jBKAFnx+YUs4K0fdW8DGvUU8dfai/X0BxAYzQv6P6a/dyT2Ty4k/YghTRLiUehV1DyGIcQMXVhhMxfu5+xy6KDaM3poh1dlKPN6xijVQeX0+LVx7Uql+5LFfEvofWSbAVpZFNE78oH4pqqZWx9px7/mgFyxt X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77e67f92-5a04-46f5-67fd-08d9297503a6 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2021 05:28:00.0129 (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: JWeOEJqED9RdGn3ZmgSfMexLRTcS3CY+C4FMx5kiwkZTqyK6J9T5U4Yt58x7LQAHPTwI40cXim3d3r4Uacwonu7QpW2JeSRmwWzEA4jtr5E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4687 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10007 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070041 X-Proofpoint-ORIG-GUID: _gdIjo0M9OFefhajPuSkXwrR-M4ZlSro X-Proofpoint-GUID: _gdIjo0M9OFefhajPuSkXwrR-M4ZlSro X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10007 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 phishscore=0 spamscore=0 malwarescore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 adultscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070041 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This ASSERT checks for the state value of RM_SHRINK in the set path which should never happen. Change to ASSERT(0); Suggested-by: Darrick J. Wong Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c index 2387a41..a0edebc 100644 --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -612,7 +612,7 @@ xfs_attr_set_iter( error = xfs_attr_node_addname_clear_incomplete(dac); break; default: - ASSERT(dac->dela_state != XFS_DAS_RM_SHRINK); + ASSERT(0); break; } out: From patchwork Mon Jun 7 05:27:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 12302519 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23C3CC48BCF for ; Mon, 7 Jun 2021 05:28:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 061E36120F for ; Mon, 7 Jun 2021 05:28:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229470AbhFGF3z (ORCPT ); Mon, 7 Jun 2021 01:29:55 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:56700 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbhFGF3y (ORCPT ); Mon, 7 Jun 2021 01:29:54 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1575POG2165358 for ; Mon, 7 Jun 2021 05:28:04 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-type : mime-version; s=corp-2020-01-29; bh=RIOafJpcx6WkdTHytKo1zW5QlHVnE6R+PNXLaX5+rXs=; b=mjBAVERq6TM/Bq/4cAQjsIOwZxaW+8pHOdftfJUNldtwe7WsAW+ziwuXz9gQV4IigVfc EEZEjJYh2+ETgz59eAQq0wXOiBv6PNxJ0srRa65d1XQczOs1XiX9PnvQqRn5pbB2YtNl ydQfEO+0FxWnqJL65Trcq+Be0qohcRY+/DHNArP/jf/yckEwMWMGhsnxyWCLixg2PWKg 4PzFgx7k1WpTvkZkKNvLvYvdxkvDV7G6o/OR80c3IBn+76TNXf/Y/FZcOcWn7K7u8z6B 4PLahpDa3NeVBx1wNSRB+9LlekggJEU5ERpznZAmTFjpCKcqiHVqUYfRWQLcDwXq9hib Og== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 3900ps1ttx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 07 Jun 2021 05:28:03 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1575PmCn178624 for ; Mon, 7 Jun 2021 05:28:03 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by aserp3020.oracle.com with ESMTP id 3906snnq3j-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 07 Jun 2021 05:28:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AzbpO9L6ObpYjnpz5dUGviqabkGv9JcejDpnoZcfzwyqAV2DFbAE+tLY5wEjb6MpjahAbuODbhgVHZ+TVjeDeoeavIQSY7qjUI9MTtcLGpZENN+e54fTHNGMC80dCvvX6dRkgimxg45pO1jK6qG4c2wqoL9pylCGk/3l8ZgNklPkfXNmWzxKEN0bIPHFVo11RAR215iAg0GJOLqgoSznXGWVuzbFyTT9Kl7/eaBmUDaASAv5hEtfKaMMPOhr2LPTenjk39wBHhcb30EdaU8AAGoFc/OcWV6kBcTeVfEyp/3GXoNGPqE+MTzhAlXpJa4h/GkjPoio4VKvFqU6thZQpQ== 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-SenderADCheck; bh=RIOafJpcx6WkdTHytKo1zW5QlHVnE6R+PNXLaX5+rXs=; b=CljuyL4ih8eIhP7hjn2dRz9FFBj7aOxhSoiN0xNfWxGcoIAc8gom1kIYdU1ujmQ3COzJPVvqFdpd4kBMONxlOr7JhXJdwg8M02+jC/BEwMV8JsyN+4wyXJyPDyto+DPvI93YPwdVWr34B1CzgxdgBPRu4EGxWW0eCZELbVMQKFLDJIRhljZc9NK/0Q/vj0CxYW7D6zY2YEIaxEYAimrmtOXE3d5O7Z2+sx6T8boLxCd+7qHTdUqs3ededqbndvj1MdZDaELbR0BgOF268BPahE9xsNIpBqpasyFZk8pC5y4Rt0Qp/eZ5CkBmRp377HCIodzkHCcKnxtC6dq58loDAA== 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=RIOafJpcx6WkdTHytKo1zW5QlHVnE6R+PNXLaX5+rXs=; b=mHTvga5ztzR14/2xvu41sPhXOdjn/fgK0Y9N+1NdhOvAsMRdX+xSj6mIrqVQVvjJHC+h3etIpiyqDwVDBSIKBHUwu0NAAX+7GunpsF+OKOoYYp9JenoLAwpgtP4uEYe4PkurhqWbckQQ8i9qfAnHMgCwmkks8PK1FvxufjIgR34= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) by SJ0PR10MB4687.namprd10.prod.outlook.com (2603:10b6:a03:2d8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.23; Mon, 7 Jun 2021 05:28:00 +0000 Received: from BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::a9c4:d124:3473:1728]) by BY5PR10MB4306.namprd10.prod.outlook.com ([fe80::a9c4:d124:3473:1728%5]) with mapi id 15.20.4195.030; Mon, 7 Jun 2021 05:28:00 +0000 From: Allison Henderson To: linux-xfs@vger.kernel.org Subject: [PATCH v20 14/14] xfs: Make attr name schemes consistent Date: Sun, 6 Jun 2021 22:27:47 -0700 Message-Id: <20210607052747.31422-5-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210607052747.31422-1-allison.henderson@oracle.com> References: <20210607052747.31422-1-allison.henderson@oracle.com> X-Originating-IP: [67.1.210.54] X-ClientProxiedBy: BYAPR08CA0019.namprd08.prod.outlook.com (2603:10b6:a03:100::32) To BY5PR10MB4306.namprd10.prod.outlook.com (2603:10b6:a03:211::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (67.1.210.54) by BYAPR08CA0019.namprd08.prod.outlook.com (2603:10b6:a03:100::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.20 via Frontend Transport; Mon, 7 Jun 2021 05:28:00 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 841919ed-0bdf-4fb1-190e-08d9297503dd X-MS-TrafficTypeDiagnostic: SJ0PR10MB4687: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C2QAo9hQqkzIPDaKzwVIux1y+UgefjDFrAbdnbqJedfgMMcl4N7mRQ7Pt3GN4vH+Ub8Ysz6xcfpxJxqawTDnZqL6cWt+ZiYMjG7KhW0AmE5C/Oa89oQQbB/qSAFtnwsxsn5V2MRglJYrvhlcT2xx6ldYS9GnU4wyaujpUD9VQgr2yJ90dsd03BOZ0cg/2RsKuYaSM5LySgShq98/6ocBneOCAfiYSIQA2SdUT+AbwtxLBtJ+lnYF7odvc0EjivA6vXiuoqDqvXIhqLnUxcJauRpcRTfY/IWW2odyOqY7cXq8/F/eqLGaeApLdwWqOu9xt0EkxInJ8q+tU2eT65VheIirdZF0QFfz5L2FSO5WxENhufFNxxvZmUIx3F1jD7NGgd31pp/LON1qi/ZT/KJUBQMAmTeZ4cNOHJSG/LXLnTTb8sA2DywG7cxDYLUVvDSIx6TxzgPp3uIu3oHYuuvXG5Kehf3XZR+EsQGmH9uo5aJlWgcgoVmGvAgHlrqIliAiOzBLDW1E9rVBpeAhB26MnJfguUr8fx2kLJg2+WFmoaRacQntSAYwQWpV621jXXrSqYYacxXNQQ71QTSBFAqLmPW8eXpPMjRGJL4dTnCW58M33wFd2oE+hqh7qee32+3+tkJhZqCYuuu4MJtOzM4nbNZrmMusLXTvNbhL8xa7hBpDEqGK3P0ByLPt+xiQC9NQ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4306.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(376002)(346002)(136003)(396003)(366004)(186003)(16526019)(1076003)(316002)(6512007)(6666004)(8676002)(8936002)(38350700002)(6486002)(26005)(83380400001)(44832011)(66476007)(66556008)(66946007)(36756003)(86362001)(5660300002)(956004)(52116002)(478600001)(38100700002)(6916009)(2616005)(2906002)(6506007)(69590400013);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: SsULyKyAtStW4UqM3yOkV95n7GYDI/GG5BQA+cFa+pqNfyqQqUTNQyzLDnUEfoWIn/0yTpL6Nfu++gelgfbVkR2+/NwFaL3Zu4QFDAJhLfI9kv5Reevs+RtkA9srbMzK86plKu4GqSGDQMUPHYLGc98sTBofPdLNXdNlztnAYji0VhPhiZOyg/nTtvrDI0B8lxHmV/PApjkHt4EO5WNXQDIStR4SsUO0hw0SeoyXjTBtfSZFSVnXVq+BND0lwpDL+YG0+vm/EROOBYXi0tuWfS0eV78ueIfXjWFvYUQdCsHM4WjoihkWIosNQZy8l0j0D8NRbKWq0dDk9WHaQlZNdY96c0sm6SgTiw57I8koYtxgX2iEl2qewb/cx+SFNw1D6+VvGz8HuXv7TP4Cm+3azuph6V7HaUhFmfgpFIokvbvSySFYeQn8tjBlzMY8VVjj7WJ6BFEKl1gxE6vX3eey4565sH3ngkcOQdRSu3tZI9XMzk2y1SGv1ZOnxM372dgAB8i0kpD3rYo1+kUYRfmSZ/Mq1zaD5WqbS5eem4HpLjdrNeeSnDzzRb01c9rTcQcI9GjZzsHL3EVGkDuv74gsPr5x0M0uuNXOH5DC5+QiC0KF1EtOOEa1wfD7IvXKgOA738GH9/7VuqWAIu8eoH86VuxkzVZkz0F8sKRrfoLfPaz5AvBge7RxXpSgIaqIrm1w6s1zC+E2KdFtSrbva9FdrkKWQIWHt1adFvW+Q/vW2/Bt+l1dcMgv1YOrEhEj4OHu5l4NZc0vaiocR3E+UBhIeiKxPI+V+nMcObnNLc80IUyDBJycJeoavtHjFcTVwNlACuE6nbJ6SgjWUsqSFcT6DEf9SzajKqwv7bdsfp1/l2L9miFy/uK3Pxu4SlV0XT6RikGvKMbFWlQ/saQGdDkR8IpsJRhEuPvo/QYr1gvhA0FzkSjgMVyMA6XnBV1eibqh9BUyJisYJ1OSax+Af2u/FOrk5UqVxigziuYc1yC4DJSa9GgJOwDXBmboMEzlm17DIRywvKXugF2kiPb829U2AFZtiQhaqQf2JH10UiebjwDSgAatDqOKul601GdUiCLemWy+9ngKd84PW84lqwTkkbTgnB5Y9z74TZDLMkbhKrX+Sgza27LBIsT07IoaDoB4iZxqZb3g9Y14fGnZzWnZfiK3AaxzK0r9W7LfOhVO1jzekKmvQdZoMMR9YqZIq8+gaeLlKv4hKbehZ0N03QkEdHveIMVheSpRAfF+0Ftx6591HF7qwgMObeIqwDnAHlft3TWFusDovyB4huwv2yJXhAPsLKx/0CVZohEMtg0By97BY7OaKqFJg0B16tCHe8BI X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 841919ed-0bdf-4fb1-190e-08d9297503dd X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4306.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2021 05:28:00.3574 (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: oGyQi6o9eOHpCnDL8g+NiXDmsHKW3f4vdliVzbWJRuZb+S4mFotAbaoBb6uQ4j2n26tTM4sbvVJjG9gRb0QgZT8uSQV1+E53Gr5fJ3Imkhk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4687 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10007 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070041 X-Proofpoint-GUID: raIyEY1mMXTAopyqZitdr1m-Z2Aqtzz1 X-Proofpoint-ORIG-GUID: raIyEY1mMXTAopyqZitdr1m-Z2Aqtzz1 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10007 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 clxscore=1015 bulkscore=0 spamscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070041 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This patch renames the following functions to make the nameing scheme more consistent: xfs_attr_shortform_remove -> xfs_attr_sf_removename xfs_attr_node_remove_name -> xfs_attr_node_removename xfs_attr_set_fmt -> xfs_attr_sf_addname Suggested-by: Darrick J. Wong Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_attr.c | 18 +++++++++--------- fs/xfs/libxfs/xfs_attr_leaf.c | 2 +- fs/xfs/libxfs/xfs_attr_leaf.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c index a0edebc..611dc67 100644 --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -63,8 +63,8 @@ STATIC int xfs_attr_fillstate(xfs_da_state_t *state); STATIC int xfs_attr_refillstate(xfs_da_state_t *state); STATIC int xfs_attr_set_iter(struct xfs_delattr_context *dac, struct xfs_buf **leaf_bp); -STATIC int xfs_attr_node_remove_name(struct xfs_da_args *args, - struct xfs_da_state *state); +STATIC int xfs_attr_node_removename(struct xfs_da_args *args, + struct xfs_da_state *state); int xfs_inode_hasattr( @@ -298,7 +298,7 @@ xfs_attr_set_args( } STATIC int -xfs_attr_set_fmt( +xfs_attr_sf_addname( struct xfs_delattr_context *dac, struct xfs_buf **leaf_bp) { @@ -367,7 +367,7 @@ xfs_attr_set_iter( * release the hold once we return with a clean transaction. */ if (xfs_attr_is_shortform(dp)) - return xfs_attr_set_fmt(dac, leaf_bp); + return xfs_attr_sf_addname(dac, leaf_bp); if (*leaf_bp != NULL) { xfs_trans_bhold_release(args->trans, *leaf_bp); *leaf_bp = NULL; @@ -840,7 +840,7 @@ xfs_attr_shortform_addname(xfs_da_args_t *args) if (retval == -EEXIST) { if (args->attr_flags & XATTR_CREATE) return retval; - retval = xfs_attr_shortform_remove(args); + retval = xfs_attr_sf_removename(args); if (retval) return retval; /* @@ -1223,7 +1223,7 @@ xfs_attr_node_addname_clear_incomplete( if (error) goto out; - error = xfs_attr_node_remove_name(args, state); + error = xfs_attr_node_removename(args, state); /* * Check to see if the tree needs to be collapsed. @@ -1339,7 +1339,7 @@ int xfs_attr_node_removename_setup( } STATIC int -xfs_attr_node_remove_name( +xfs_attr_node_removename( struct xfs_da_args *args, struct xfs_da_state *state) { @@ -1390,7 +1390,7 @@ xfs_attr_remove_iter( * thus state transitions. Call the right helper and return. */ if (dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL) - return xfs_attr_shortform_remove(args); + return xfs_attr_sf_removename(args); if (xfs_attr_is_leaf(dp)) return xfs_attr_leaf_removename(args); @@ -1453,7 +1453,7 @@ xfs_attr_remove_iter( goto out; } - retval = xfs_attr_node_remove_name(args, state); + retval = xfs_attr_node_removename(args, state); /* * Check to see if the tree needs to be collapsed. If so, roll diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c index d97de20..5a3d261 100644 --- a/fs/xfs/libxfs/xfs_attr_leaf.c +++ b/fs/xfs/libxfs/xfs_attr_leaf.c @@ -773,7 +773,7 @@ xfs_attr_fork_remove( * Remove an attribute from the shortform attribute list structure. */ int -xfs_attr_shortform_remove( +xfs_attr_sf_removename( struct xfs_da_args *args) { struct xfs_attr_shortform *sf; diff --git a/fs/xfs/libxfs/xfs_attr_leaf.h b/fs/xfs/libxfs/xfs_attr_leaf.h index 9b1c59f..efa757f 100644 --- a/fs/xfs/libxfs/xfs_attr_leaf.h +++ b/fs/xfs/libxfs/xfs_attr_leaf.h @@ -51,7 +51,7 @@ int xfs_attr_shortform_lookup(struct xfs_da_args *args); int xfs_attr_shortform_getvalue(struct xfs_da_args *args); int xfs_attr_shortform_to_leaf(struct xfs_da_args *args, struct xfs_buf **leaf_bp); -int xfs_attr_shortform_remove(struct xfs_da_args *args); +int xfs_attr_sf_removename(struct xfs_da_args *args); int xfs_attr_sf_findname(struct xfs_da_args *args, struct xfs_attr_sf_entry **sfep, unsigned int *basep);