Message ID | 62a85767a21fb76b548801a002a85c7831e8e25c.1736221254.git-series.apopple@nvidia.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9445E77197 for <linux-mm@archiver.kernel.org>; Tue, 7 Jan 2025 03:43:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4C22E6B0099; Mon, 6 Jan 2025 22:43:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4496A6B009A; Mon, 6 Jan 2025 22:43:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2276C6B009B; Mon, 6 Jan 2025 22:43:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id F2C2F6B0099 for <linux-mm@kvack.org>; Mon, 6 Jan 2025 22:43:26 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 9B2FF1A065A for <linux-mm@kvack.org>; Tue, 7 Jan 2025 03:43:26 +0000 (UTC) X-FDA: 82979260812.22.458808A Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2089.outbound.protection.outlook.com [40.107.220.89]) by imf17.hostedemail.com (Postfix) with ESMTP id B414640013 for <linux-mm@kvack.org>; Tue, 7 Jan 2025 03:43:23 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=PsWLvnAH; spf=pass (imf17.hostedemail.com: domain of apopple@nvidia.com designates 40.107.220.89 as permitted sender) smtp.mailfrom=apopple@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736221403; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fr+IvtDG4tlBRjnd4t0ov6kscjwRm8udTIzF1grJaok=; b=sNaGSgsW/W3r7s9loAJ7opBK9K+50ScFxGkz6MU25RIhaJ1XcUgKiv8W9UQY7+hJ0Jkt5A AlCT8AElffM1G+yEc0EJCBY+8qWYaoY+tA1bRfQhiW/Pvkxe1nHJzq5HMnGXA3hSQwazzf UCApCMUQ2tbZUwcsOpzbbNUPf9rl0Y8= ARC-Authentication-Results: i=2; imf17.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=PsWLvnAH; spf=pass (imf17.hostedemail.com: domain of apopple@nvidia.com designates 40.107.220.89 as permitted sender) smtp.mailfrom=apopple@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736221403; a=rsa-sha256; cv=pass; b=4ddI9sCS6WNAJt8DcBML6A4a3KZZP/hjDDtN6iSHPxyM8V4EA3Uywffktg5un5Dz2Euode tKye7nOlMH7mBR+jUZYx9x8ePypiAr4by1q/lGWDSVFfGB0AVhJc+g6Hj0Flo423maC7sZ QMDvQTBI2w2jydH3VPFk0juVGJOp/r0= ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ITQdX1bPfFKhtMbyHhCmzvd+iRcmQUSNGs5J6XIhyrLVMi0abvTlWERjKRui6z8i+mGn0rPlqpOkyqeJ2l9zDOBuKXWIJ9fS4n8MA3WrHvNkiywy1I0GDfNPLf5tvIMbOaPmxoB4PfH7Lx4OWiPEb23iUkkcH6qUyGoo9hwfTnMyFknrJ1SpTAQ+szR4EWbLRT+euxcnwL4MZwSuTRcWciuNDN+SBWT0kJ6E3i2zh0/Fhyh6R9pEvtS8l5F53GBCqGjwE8io+EUKPy+BncuXlgDw0fEfCpJ8297RKalu82iWDSar6uAXfjnPxM0BZEmOZC+Uw5eh3z5DpVz+HJySKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=fr+IvtDG4tlBRjnd4t0ov6kscjwRm8udTIzF1grJaok=; b=bJEEXueOzYqxbVFuy16xkgdVBtl+ODrHMkhE2/TAbencjmdXMfNlfySx5xvv947CwCC83U0F4xp9vPILRpGa/+rnWPQ323LHQHY8XO+0j8W6/bQ7faHFqveIKPbl1lrbdj27Rl6/3kJFnSraMxqUjhNbujC0jpvkcnt48O3MfU1bo3iVHy2bASF2fOqopOaUab0z9fVsNOHA0xetwAIK/Os1eB6LWo23NKFtW7dxwK1ByWhuoSc4L5LovFv5QmMHibfgbUaWAT0aWKTRMK9Uu581hntmg8dtcRucURVEOit/as6OGDoNBRvX3qhqLgZNSOnhYolsypLNg0VcUJP75Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fr+IvtDG4tlBRjnd4t0ov6kscjwRm8udTIzF1grJaok=; b=PsWLvnAHko998tssYOoVnI07KbNalUq6YdMdFni47TR8wamWcpq2I35fiwA1t2eVxyzUmP9dHFDdTTDZ4sOTQ7KqEXVjmvz41vukdag7tW/aoSQjBGLxI18S4mNEIIjys6xjmjyj2bHOzKieh0JaNYhwzf7hNYQKVKUWo8XUYtHB90v7r/6+ghSFBg4oNWJL+nLFSBzvW4Az09iTDD3/rNjTlqAneYlDq8WFUj4NLky6/1qpb9d0lFM1JMyJDLEjHp7c0n+COUX8g9lPhDTOe6ePENVkTLns4z+0mG3X5TnbhcCAAHYo21cP30zpo8W/Ped8WodIC7bnEeySMzdsoQ== Received: from DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) by CY5PR12MB6129.namprd12.prod.outlook.com (2603:10b6:930:27::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.15; Tue, 7 Jan 2025 03:43:16 +0000 Received: from DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe]) by DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe%6]) with mapi id 15.20.8314.015; Tue, 7 Jan 2025 03:43:16 +0000 From: Alistair Popple <apopple@nvidia.com> To: akpm@linux-foundation.org, dan.j.williams@intel.com, linux-mm@kvack.org Cc: Alistair Popple <apopple@nvidia.com>, lina@asahilina.net, zhang.lyra@gmail.com, gerald.schaefer@linux.ibm.com, vishal.l.verma@intel.com, dave.jiang@intel.com, logang@deltatee.com, bhelgaas@google.com, jack@suse.cz, jgg@ziepe.ca, catalin.marinas@arm.com, will@kernel.org, mpe@ellerman.id.au, npiggin@gmail.com, dave.hansen@linux.intel.com, ira.weiny@intel.com, willy@infradead.org, djwong@kernel.org, tytso@mit.edu, linmiaohe@huawei.com, david@redhat.com, peterx@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, jhubbard@nvidia.com, hch@lst.de, david@fromorbit.com Subject: [PATCH v5 04/25] fs/dax: Refactor wait for dax idle page Date: Tue, 7 Jan 2025 14:42:20 +1100 Message-ID: <62a85767a21fb76b548801a002a85c7831e8e25c.1736221254.git-series.apopple@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <cover.425da7c4e76c2749d0ad1734f972b06114e02d52.1736221254.git-series.apopple@nvidia.com> References: <cover.425da7c4e76c2749d0ad1734f972b06114e02d52.1736221254.git-series.apopple@nvidia.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SY5P282CA0133.AUSP282.PROD.OUTLOOK.COM (2603:10c6:10:209::17) To DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR12MB7726:EE_|CY5PR12MB6129:EE_ X-MS-Office365-Filtering-Correlation-Id: a65120a5-c783-4f1c-5405-08dd2ecd6b6c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: V99kf3geINb1nyQ9r6J+tUlJM44KPNoNRp7ZAj0IpAcOV7wdGqAABDWVrs5N5gXi6Xe8glIfDcJvzNVBvh3LmiYTAVJu/DLlr7U0OUvsKBZZ+Xr3Bn8IfthtuBd49pBfjv1LaRVp4juU1yTu7jPT3qFmeXueXhMxCOLhkROCZfKv2Xv/pEfa4jEoU9n+RZbzib+1O8cmS8zN4nH8KmbgtcyzoyXXt+qNIe3e5psAfX0tDbbrYhV26r/WhFjOERPI76Xu0BmaEmkRzOsIjh8wAEnL/c3SXT8Yjd9zT19hkawJWVywIb+vpIWDkY2G9+yNErDiNd+cFFzVOtp0F8c+OxlMKe4A36OSFRSCMqd3GvgF6T8GoC/qF24/XFNIKGb0Rcto9l8KWMeNTcCszbqtLNZlgofsoZGmar4fZbow+jt8eRbP3ob8d+q4N7ZPubz92bJTHXpj30K4I2IYmnvtPgC6ytf7WwDJ7BU29Bl++pisU/a6oFtEOj31AgnkUbAzSqP9/7Fq/fBriH1gcMNwFpwVkKU/B7dUee0Osk+PRspYoc63DR2FSXL59Rk1JxCfANxVtu1KZkJXlYTN7GhZhDUZMY3tVSkBHM5Tsgu6+04vOpgz3Vmkts3aG2pCqQBj+6eT3UdHslOxQkg+fKQjNnlzGQWvljy0lVO78NKdKxjbqRK4zW8eH+IqdLoc6TsLa/E8BqUtpWODUQ0R9pulf8cQwP/znCz6feEnHDpRBOXKtd9v+fI8RsEqNrg4JQ8LpG5+a6e1RaSoS4etauIzeYJIaBUiPP4H9poTujf3meNb04KuOZz2GPmmYMhsxpGTjY+/GalknX72mCwuvRdskcxpMFwD+Cq46Tywd5xlTnRlmBdkuHbHbzRLPanX/MQBGzaUAQAnaz55T65iXEHCXppZkN80HE9whmdBNakhGlJK3HKNfuEw9n2/5mZt5HK5nxNuA2mQe45h3iBbqmiRt1Tm8BlFZGp8ygn5Yq83rvv2O9oqL9tEzXO+1HjVBtQ1btpAE4RU7bK9Usakm605oSVneQmVVXyAAhAkJBthm+PV1hy5elLSRVvp0jzA7kVZzqIFuxDJnTzU8O5PcquPf8uMlZ3DcxHSDAgq0j26aq49O0/T/ii0iZe4/N7dZxeOvDWfyNgTWpZlzBKgl5Va+dA1iHYKpjecP56jBjJ10RGsKwH6aol1TlRD79bdu8/YLjsuTaQahP06L1FHvHQ09/JhRXNlazduDGN0/k4jHVTgEI0G+6C2mZAy4zaNayRVOLtbiPqcglGFoW8hwNVkm90F9TEcCD/D29zenZHYfzfv8RznpTlKvdR5SdkcmmFu6vMDxUAOE18VPVwCb/UtjpljHM3wEUDBDOjw5icdgftiVasevYwgb7AQRmLVpbVr X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR12MB7726.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E+NFr9Lt4TOXz1sEI07IDhB/vbMHkzvLTDmuWtPQspBy8LUoeeY7n4+MprkOCTPiBcwQARqE7HD7fxLv041PPPLqPnOKklirC5910RgrIxjMofSWL0dkxmjFTqGsA6O7wAxNTTQ3aGv0ys8bA7SMPte5WBckAvfJuHRbiLcLL8Z8LA/CvZI1AwGV7jVXbVeqGGH3Khn8sxpZL95p8678l62Q30Q+oro0TUC14cR4uLSDrxFSU14AXemPujuFf7aW+T3/OSs47BeHlU6cpwPep8gJ8KbGymk+fFy07P+YOF7E9+7p+Np5RGGzcjHNiJw2RKDtWx/MY1bx3w0Mf05+LlAm9YQXOg7kp3z5pZbU0F4O8gacrCQM9gYu5Z46BvmbKsRTeSaoHJvLgK9M2cTJmL6FdLsYz4WnO4VVnre/ERYzcUMF12QUHD1LU2dAhnJrUwd42KMnDXBIHhiZoDKMuXehuWnR32Y4VmzRBfYHqErDhRh2IgUnJEqvIhbuK+aewi/c5GfqFj1GWgvHMI5t3FRtiOjQEw6Guz8jGbhHgjPip+s8nO5vPLxrjBqLVvdShzuoKE0KbWd4v58tGs5ARb4dezA0/QZLAvnoXQUXA1YBk3NYlOW/v/Q47zuMAIBQV9XaQqk5HVrPJ0ygr6AouroJ6YxqcwUkLo/kbKkox822uvRoKSlDMmOL3ikaKMcAqciPlz0xVMpOE9wiaIFJTHpTExCVsYM1j/z6zDGjPQDiaaGS8X4G32MfYreCNEY9mvFOyRebfCVBx3I08oaxaFTGHsZZ82X5dpQhEh/25+e2pJlO3B+1ZyFF5YfdJcA9OWwXs8tkbk1sOk9UYrVrT64KiADedCxn47X+lM6YeWSTLtTVg5zkmPEx4VX1Od9eYLeJF7Dd8NIpTsjjIXafji3VgcHKm9/9iG9BjKavNMtQTlfpc0jqin2j8BEJKPBl06PtNGE1ypvmt8MXvqeXPMpr5J2fEFPrt0LiTCynCggWHATAreQCPb5hUdq5TwrAdCMPyyozc58Wbo57bEdvpWrmwmEf0KDPhKYFAIlPK2LkxYRM3RtjKQ0FKJNddX8OLc65IDGMRwjdF5mjAV6wLCvG0PwjLg4knz2cdv0gH4zafLw0I1uotJpCbBaHXJsM2LL07z+M5SnYlgPsMcgro11+nPsQSlKRY+7swYZoOzGpCsHKl30l2BoPg58CoA1cjvkbHI4JAq1TZwhSFIyVAZ+NEUG+A99nzS59sdkmiOA5InXI7WUpgSf81T+N8p5x+DjnBLpqSf9Nrnc0E/LKa1EtC8r3JHHF3Vt0tCDdVuXLoorafXIWdrmox+ZQ1/n7zda9bCcBFrZXckBjXDXgXZHJdrE0iyW9IO4XVwQPVhcwTE/nouXboQAbpyY/rx7h011A2UvOIHX4/u3vxSzd2blXXvuY86MuKN7W0HDDL1TTbD0Ta/ASHN+onURVO7ba4FEFrcU0tg69eyzEx7zpW38GX5As5EZe7l4f0tfFobJJvCS+7f7zCPFkgCENNST6MEiXtSUqX6nGnAPdENs450xWoGy5PxKswUDG14ioPR+iCcc29T/rNDuH2FJv8qzz X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a65120a5-c783-4f1c-5405-08dd2ecd6b6c X-MS-Exchange-CrossTenant-AuthSource: DS0PR12MB7726.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 03:43:16.5435 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QhIhIPSN85wPD94co4a2mWGDg0VS/dT+gFXI0/W3QfI3rJdq+OeZQsMU+cks39NNeBpDPCq4pHwKViMcBEnboA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6129 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: B414640013 X-Rspam-User: X-Stat-Signature: ryfmdu4rqx5zqoryju7syngxeqbgf8mw X-HE-Tag: 1736221403-942968 X-HE-Meta: U2FsdGVkX19OkyoHLeP6bnHd7DST3ebHLKoD0WiWaL9Ohnwuy6oJXdq1uaHW5FaZtkA9vGKxzp1nYipMtwBvV/mVssyQ/+DkoBSEM73IHLSAhvHjwZc06PLb+Efh8YhVYAWQkbkiCLN1yEHC6ZlIIVtOIILBIRTjB45wCR67lbYM0KtnIdhXyFjVjZaJTxeEEc/p5ow6Dpxj5lfSPN9v2Ow7MR77hcMMgt0F6+fx4F/UHdpOqY9TfqtcnxF9Jz4aWso/hIhWJ9HkCUZWEfkS8CEOTfE3rW8yE4bXBw4h5TU9QYt4wNsK0P27Gn9oFtwBSMj6eZsUE68m7ZkXL3LDLVjfABZpVjuH7qqltm0wliQkPrpNxF9Lsax3Q8J6D+BEObEPHp63+dKJFc/WSw6rkBHV5A2uiNro++GONlg52jOsGMKUWbcYrkuM2Hx4X76U8dlrlAFZTjY80B4R3xGL5tcRnynfzHlqTcoGuWAlHYpJOd3Ny23Fb/DLU21/gewQMUuRMl2s12uWWBwoRgwTWvngLkLIWhKVqhClyb/4SKQvRG3RPMsIb4ZNuRys0iR35JI7mVip6a1IiPJGgzuF9Y+TzM9wTUbCke5LvGyEIHKzpAbB+6sL4A0YZzx0SRMoMF7pmYlGmbX8vWG3P2zoabqkZm7fuS2nnM9bCBEBMYgTs0XmX0btKxm9xr4JKkqsIyXq1saI+SCGUNm5pGnbMyPkw3mS1bCgcV7dEOy1nDyZrn8uE7FutM3MKmEvzku8eGYnNA7/nS8pbpwUb72D5pC1ishdctRKkea6oKj//Hc9SXsBeVKkrrtXbjEqu3cE1xRuDVVjVj0a8ycDfMiX8aiyX/nqPUG3rj/WI2Mavrnqryn7XJZkFNiF5uGocHsIS1/i2ngCVPvDiy/sR8ib3dzmqHdFoc8UH2pRlT6pjFGNriQI1oFM5hLiua60MxgTu2CdcGENhfs8Y8uyCQj h1OVSHZa a5JfXJp469k/piBIolmUe3/nhYEZeeRXxgvYtqRxTEtgIBEoizPhGje0Q/OC6Cieg5BpRKNqMdKraDq8UN8Bf76FwWj0EL9afCclYAcfpuHlaklsp5HrJ0q3SewBsUt4g0xOtNCev8G0l0b1Xx+NEEQkHWiwB0Gh311+LUIj7kToimQFNOodsjO1FkosmTzbiuFpsCnjFIngVL/tmegrhdWW7qLShAzRYtrGOMI0kAW8xLHrx/HQbggTFipAv2yciLIIWIboGl5+/ctIIcaAphWUzzKmHxhXG6vsrmVMSgxIdMyOsXoIVCuI6TiKPvIOzBnS45bD1rFeseNj6+v0Fgcx4imzFUiOh4avQ16sOmpbNSoSZcym00tbvOh4vh5dETLlllsr6aHbPpR92RBLohof59kxljtggKZ1fzysq5XEn6UajdF8KmEyzonhJxd66JmLPhEAeITpPmlYB15srp/tVb6lq6wkWfY+PimSjbW+0wKhCGxZ3c+Uj2FfMiWL8qKwbZMZrAOqSvsQ= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
fs/dax: Fix ZONE_DEVICE page reference counts
|
expand
|
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 7c54ae5..cc1acb1 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3922,10 +3922,7 @@ int ext4_break_layouts(struct inode *inode) if (!page) return 0; - error = ___wait_var_event(&page->_refcount, - atomic_read(&page->_refcount) == 1, - TASK_INTERRUPTIBLE, 0, 0, - ext4_wait_dax_page(inode)); + error = dax_wait_page_idle(page, ext4_wait_dax_page, inode); } while (error == 0); return error; diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c index c5d1fea..d156c55 100644 --- a/fs/fuse/dax.c +++ b/fs/fuse/dax.c @@ -676,9 +676,7 @@ static int __fuse_dax_break_layouts(struct inode *inode, bool *retry, return 0; *retry = true; - return ___wait_var_event(&page->_refcount, - atomic_read(&page->_refcount) == 1, TASK_INTERRUPTIBLE, - 0, 0, fuse_wait_dax_page(inode)); + return dax_wait_page_idle(page, fuse_wait_dax_page, inode); } /* dmap_end == 0 leads to unmapping of whole file */ diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index c8ad260..42ea203 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -3000,9 +3000,7 @@ xfs_break_dax_layouts( return 0; *retry = true; - return ___wait_var_event(&page->_refcount, - atomic_read(&page->_refcount) == 1, TASK_INTERRUPTIBLE, - 0, 0, xfs_wait_dax_page(inode)); + return dax_wait_page_idle(page, xfs_wait_dax_page, inode); } int diff --git a/include/linux/dax.h b/include/linux/dax.h index df41a00..9b1ce98 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -207,6 +207,14 @@ int dax_zero_range(struct inode *inode, loff_t pos, loff_t len, bool *did_zero, int dax_truncate_page(struct inode *inode, loff_t pos, bool *did_zero, const struct iomap_ops *ops); +static inline int dax_wait_page_idle(struct page *page, + void (cb)(struct inode *), + struct inode *inode) +{ + return ___wait_var_event(page, page_ref_count(page) == 1, + TASK_INTERRUPTIBLE, 0, 0, cb(inode)); +} + #if IS_ENABLED(CONFIG_DAX) int dax_read_lock(void); void dax_read_unlock(int id);