Message ID | 55b287f58e47f27e171308494295a169a9a9001b.1736488799.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 69B39E7719C for <linux-mm@archiver.kernel.org>; Fri, 10 Jan 2025 06:01:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F3CCF6B0092; Fri, 10 Jan 2025 01:01:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F14AB6B0095; Fri, 10 Jan 2025 01:01:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D18446B0096; Fri, 10 Jan 2025 01:01:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id EC0E16B0092 for <linux-mm@kvack.org>; Fri, 10 Jan 2025 01:01:49 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 761EA1C745C for <linux-mm@kvack.org>; Fri, 10 Jan 2025 06:01:49 +0000 (UTC) X-FDA: 82990495938.04.073BC4B Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2062.outbound.protection.outlook.com [40.107.100.62]) by imf27.hostedemail.com (Postfix) with ESMTP id A5A0B40014 for <linux-mm@kvack.org>; Fri, 10 Jan 2025 06:01:46 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=Yk+eJDRX; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf27.hostedemail.com: domain of apopple@nvidia.com designates 40.107.100.62 as permitted sender) smtp.mailfrom=apopple@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736488906; 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=zvasEvPAGqJVTP+K8N7EJhMBB0n176CNkNnXIKkArIk=; b=aKaND9C3U1OcPeFuCz01vcn98lYKTEBTg/U7OHLtMnMfhD25JWsGT7ocJEQJvx4bg3ivDU v+N7aDapXOyZdnk17I6oa9jcIywLrnxTiqmGMa7D7gqCKvumTuNrBhieBNp6idVsmawvI8 r9MpRIMbvUHzmCnC7ctU89mHyCELiu4= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736488906; a=rsa-sha256; cv=pass; b=l3f5lobeLz/AeEL2GxVP5TKlfs7W71u7TUnKZFKkWi/awb2xbGHEqmKY11hI9ESIf6RINp OCXpPyMvj8+QgeYUFkl+n4PcCNeP1GfpT76pAbQb2EQz6ofA0F4UIQ82ZQ882A/KQcRCPT Acinwu5r+fw644gszzTStTxOxzJjYdE= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=Yk+eJDRX; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf27.hostedemail.com: domain of apopple@nvidia.com designates 40.107.100.62 as permitted sender) smtp.mailfrom=apopple@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qh9tp4/0YbZn2nWeTLXHyrTNOaLsGZMofCYl6ceaUO8Nua+qvE+5+IfYzPJ/9JryvQifl2Y4Gt53cgx+HxdFpVctWnMalfcCy8rs+1djtw+cLsHX0JE1op55Pf43SrWc1E97AsDwb5QEAkLs1Go8OB2NF1dDKqmsIqSHjpsyLqUzg40DKSucmqSDwzB6hLNy80F/1RI1IHDMERmxo9WurJxahGBOj25g8/PACYga8Alw6tOwuFJZygqUG3yuCbqIcuC0Cig3I8n1ByvExyyVor/xjiQrAJGvkq/WJgDrt6tyg4G5+881A+JwUZLzrpu41CaGsZJf6K3gJNkzZS90oQ== 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=zvasEvPAGqJVTP+K8N7EJhMBB0n176CNkNnXIKkArIk=; b=P6xhkPFHUfVq0IkXfjFojZw9jo/q+XLv/ONYNxFzXcd4Mh93NV27oHVvR5TxvLJc56ypW6+wmMuttFLTWiAmW49FnIIqp+0A6Z1Sh0YeX/YPVqf+uzQnKDOuyAsJHqbzmijH6BLJE+m0kRFT5nPO+0Hpj2q2fVgN34/zj8GjWWOd8RXBoF00jjZRlErb06JbQ0eQlC1DDH2I/N9YdtGPs+RhfE6P4VPKMLKDrDhXiaPrjJ7B2tBerC5cft7e7O4p5Y6WFrC4l+gD13C0As+rG+99PkpWFa4CMRxo0LC00Q0vh6FmE9qU7DGDGgl4AUosaKKQGuDtwbuDH4yl+7hukQ== 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=zvasEvPAGqJVTP+K8N7EJhMBB0n176CNkNnXIKkArIk=; b=Yk+eJDRXZgSscbRqcEqbPoZlFRsC4DaIWgZURApVdJzENdpBOYemD5oTtk7Bv3M7miQcoVWKhxQ+0zOGLa6notZnQqS4lAN825up14i0mQJhFKWj0pzFjDGYPsPJUxHlm6hEOjxjY8lAKNZpfi3i7qC4cehHD49JCQeKYGRH31wm7ae27IYlfdcmOKDa/LUim6lUIC1fBB76ejuDly0FedNv2bRd5PeHvT6Rsgc9KnSsvlwkTduupFYdIKdZUOjdD1JRbH0VdhrXgeXCk4aGRepBpT6eiKL3TVSNgkhQuD70xVX1KkBgTMTsc7q1UlLiI06q1A6cDKrl+5u429mKkQ== Received: from DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) by BY5PR12MB4132.namprd12.prod.outlook.com (2603:10b6:a03:209::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.10; Fri, 10 Jan 2025 06:01:44 +0000 Received: from DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe]) by DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe%7]) with mapi id 15.20.8335.011; Fri, 10 Jan 2025 06:01:44 +0000 From: Alistair Popple <apopple@nvidia.com> To: akpm@linux-foundation.org, dan.j.williams@intel.com, linux-mm@kvack.org Cc: alison.schofield@intel.com, 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, chenhuacai@kernel.org, kernel@xen0n.name, loongarch@lists.linux.dev Subject: [PATCH v6 04/26] fs/dax: Refactor wait for dax idle page Date: Fri, 10 Jan 2025 17:00:32 +1100 Message-ID: <55b287f58e47f27e171308494295a169a9a9001b.1736488799.git-series.apopple@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <cover.11189864684e31260d1408779fac9db80122047b.1736488799.git-series.apopple@nvidia.com> References: <cover.11189864684e31260d1408779fac9db80122047b.1736488799.git-series.apopple@nvidia.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SY6PR01CA0094.ausprd01.prod.outlook.com (2603:10c6:10:111::9) To DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR12MB7726:EE_|BY5PR12MB4132:EE_ X-MS-Office365-Filtering-Correlation-Id: 471635bf-7752-46a4-8f55-08dd313c4252 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: SJBiFmmmwOAXH7sUQb1zVj4/9eXHOdFPUQg6GYVtU5LeRYLdMmON9/wOvLyedtVwzjVuaHqTNTy+e8VGp1VuFrYVTsn1PR0yw2K/7crhvGFnenov3I6TwGw4ptLmK8y4FpC84L0aZmee42E9bl909tQAxLb+lzBxTh9F5tLu7e9QPOpwPmKM2iNy3t4qsC0cjvNl0Mm19H/BbaF9x2Jacap4rQiXyqulryaagcqmDu3NlX2/77DTWJdDNz2Xztprsu1OeAcnb6fuOAPkajWogGUBcwhcA6Iv1TEpRnnjx0WCQnf1c+MFdPX9AXsMLHEqhVVvwd2uiWhxynaek5OAk8bGzcYR9HouM8dNe0EtkkqeHfFJQxcefwI/FoBiHpDp01qT2H/P8lZWYBWPE2QIBFwnJdu4gLWQxRaOU8pOIR6c90a+3Bfah0vz6lu4dvIza1mqjEOvqtID7CpiP3TLXfr5Oc3bt5DQ6utmFlWiOLfaAN7fmu08V6l1JX7KYtLGd1JRm6MhRbUHNfujlpMoff0FGtui7EI2cEgFzeYSpDZcszj2xyexrn/HNRAsryn/P2EpSQP3X6y/dDS/adCMaQ4W7G3aS9K8OlHARbCN4+ORb4to2FXRzuy3+vuHNJQtkhq1d/pRuDJdXIocNRN7ZNJB87CTr96JmIuKGCNzxxr4g0UTSqBDZ17IVHrJPMXwfidXPTLcRSYudvLDafqmRqnMGJJbS+gg+SpYSSFfxjylPlDyUBvrCUfMhUILzqNnmfsSyahiY7JvpTRl4C0AE0LvDPTHNy+kkFUztkfWitF5IFgQEa2nly5Hcu3oh7p616xQWrcifJ4dVHH+t5OqtLx+axN1FptzLGezRckRVFWi5EG4WXV8iCYeP+OZyqIFpi+bb829XQoUPmdotsmbgJEoUvg7s5C3M6Fe0ExxB6SMCWObq6q1KlVCrOq2Kc1rWM98muSO9P/SrLwFPlmQFaVMUc1imGl41rY7CUsK/PNbOhdsUFfjh28FiuNxwjCHCCSGlpsmeGvr6e2Nef+pyguXp8yCWUnXLU8nMfBEa+uKJJ/ZUZxpfZV+jpcD2Ut6NMbFZ8oJiuq/l7/roYF5CLNO+iGWVhHCRucZS0L7hFEeMwhV0VxjmedW8e9c5OXXzJdGXG6IZI2k+gPlssY8crBNIoBdBsq+xIL6mO7cBoAK9qyJaBMckCc/hwRAGMOkprLqaIAzHtGfFFD2tc0/gchGEJWM+dBfVqNBcaVVtsj8wakE7+nJH5Tb9IQ6TIA5jelPJJm4yz4xPA1mwUiDsmxaTcPrbZ4RjcUjQ4A3XEREm29LsodfbPd/TmR9s3FuCxN8cn36qLYZjO2CC5TjPRwnp+TfXxjgs0D11eISN2C7OQGrnk7zrtf0tSYVN44o 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)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 11e2SI5VM20SEn+FQ7HnP/QRQ2wpQ6iEJiET4C0ab/4UdpvxxO+VJmxJPwO8iHF1Xts0O/clnRez8lrYwfVOOIBxbDGOofkZWwvSK6zFqsH2TR+IY/xQd3ogUBcxZaLUEVqrWeMBRXowimNVA8K12SCs/3XryxVORdwOl2kiZBbZ4Ph/WymwVAKX8otHpNqcV8p57JZah8f5oN1YbrZv/s7eyWySa8bbTR2T+NLErxMHlwM5IW57OPe0mTuW89+Vv+yE7/ZMBcQpKX6oBiJi8nEG3GCnJv8nSufEhlgX8glr+YEZx48EUJceSiR+tfCe3T/N8PPtRlKOcBXP+4wltTiEjNIpDwgdwJatu8TrdqJNFn509Z05mgKs2QcoBRSi48d74/GBdQYLVqFrlsYd76WHVJ/HPAAnwDrKS1gksLRCr3ae/t8juhyO6ILMniq1xf/vrwx7akoqEZi/uc1sjcTDniwCMjRXjxhNmREPOj8zPVilLaZIMDlt81KVuNkRQXcOFtDi3JYLlJ6QDskD2+sklfrm9HBLuTQZgXHq7l5ybHUGgFSzIBDvjfLHCnEyl+478kXWCzrdv61oUWzl42qGywV3uQ3CGFRVIUp1msLjSet7o1lXUftljJwhuj4lUXDgxHGz2fCr98VWEXIADVv6VLS5NnD2V4X8cHk8oca7vm7pDSwG3wgquLgRpuYMW+67Wynx4GdpFVo80K2K0HO0puR8y72saY5DFOm8YhW2G5U4RD9zTn3S/6xRENsUsiL6nmC3scffqASyP7IUkcvGibdKL3ik0h0t//wkisZkqCtTf/fpwyycVD9jOs5txd4NXRuG5AekI3d9KcsRwEN9P/Sx/360ca1RQvzVqsxmKdvAPyFQKRE81rOE3YrkDBiMRSbCePApLo+3zNTrMjK17935uKae3yv6T3i1eMLxmBN32eIB9QhecubksAhcOmKsW0qGZ3UsmDMASGDgu59DSm4PgX7S/5BxrJRWSJyrZPW2iYPXvxWWX7wQ7kVOoFfIU93JAOXs5KtnRxK8XtwMmWobEW5rNV3ylRDC2/6WC74IK6VAAUd5yXvWNphdPSXa58DqpG9GPYOrYbdJFj9tv7qQb2P8ufHz9XM8KzyZDL9uRZOtFXdrmygLsgBA0zXiyZ6tL/+pfTMN34NNDkC0Y8LM51kKYYavT4pTJYiHT9j9UGU+EYMba76iXy05XsKlE0PPdeFwZlfe8g/EVqxM0K4MM3EL8SuS32CxqdKhG1Af3zJoy5hIE9TVVDPg+x/AeFNHQHIQCYU27qH7jgo6mKV7pXxYdlC0fUY7ioJvKJChghMdyHnoYmbTXcJgNXJb6XWMeV1XKnUCw6D3QgD5pYI/ySzE5fFFLvQBJgR8B2jZjeeI8zHt8NHnIwAEnfyO9o1SCm0N2yXOWuVnYte5WOou+NkUSu+R+r6MejwCUGrglsvy295rE+hs+Lg9l7yExwdqEjYCOBJWeHHoUJV/MBBkAsdLiTcYyhIVoQygW5wjXChkxiwv1VbO+y71e+wYlEbBVxaAhNPr/qxN4MmMB4PWhkMPB1lzf0GG95nN1rMzQ6nPCm8CfzSUu9O8 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 471635bf-7752-46a4-8f55-08dd313c4252 X-MS-Exchange-CrossTenant-AuthSource: DS0PR12MB7726.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2025 06:01:44.0019 (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: j+s3S6WFCfVxFIKPT1mPpHjB/ajx8zj/Y9j3Ln04d0fSMYiQlcbIAwDkqwe9r1N3CA/tXLzsC8H5+ejWgjevUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4132 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A5A0B40014 X-Stat-Signature: 51hhis3kwhda4ahyu6m35qjifn4s9fe8 X-Rspam-User: X-HE-Tag: 1736488906-644691 X-HE-Meta: U2FsdGVkX19fzTfNkE8RCZ1nX8/YbTpzdFTwKBkshbqV7KEsiLyMtCg1gtXC0ufK+2B7uxV79s+5Y++Sz9O+VX/z5JbTDS0AFw2C3+GeGTwaq6uHUDg6Ztvkqn2ubs1zXHg7KpwrA+KpLk8y0Vh8iwPh94pIISf2wtnFLtopzJUQMotOc5EhnX6Qs0bWsh+6+Uvj3rOKA+aC2nsQV2e8HFinVRHwvlRP+3PsRXbBPu7WF+Km01yp4vf4/7BVx/+4pt98kzd7TJdyjP0bCoPB1nH1q40dGFfp+Yy4HudkV8MU3/QndfRKm3ey8Ms7pJAsSKZ6hgqJ7Cqb1NXjm532kFjYbVl4OWKWWW/EkVjVbRNi0fSsjdCVekZLSCh0MYUJBi4YJnhxTEDZGQZwkS8i7kbvoWLZ83uJmxkSeONDm2742KVdiYlcFO/ep/d167A2VZKRC/4+38SsHBTMumYdyM1KVQQbcFOZnREjFjjuxvHyd5wehft5tf5Vk0oJvsvdzNf6FFgBUfcgt/OOd7d302TeQ4lvU57EL5m9qlmEsfaEzwF4YoKyDtT7vJt1f+6bqtqe6NcKuZe3pSONh1dlvO9gf2ziPwYAYYtDrpAmPw5v5ty2Y8oJumjjSYI4wXUAnXOSIRhWYYmIlvn5X3wspU00LlL8MGJKYJVgQNrUdDHWxSDXKEEu1FtvbntYfm58PGSPHQyFQLZGrcpI1//MDDkldW9jIF1mWEk9JsazaDnhk6Taj8sS1mUSWl0gDBGLz4TxcMhpYDZUDGko7khda9IVoY2wZWW9pJW4pFcgOrOY5/gL2wYXudAIocUhmbVNsA/JEWhXCi3QPKxgdS7jxI84f+CF6q0TAK3qEFSbR7uJHJ3p4bv69DZAbgJTnYMGynul6CJtc7rofuyGbONtyA9EGhDlETY4SwLAgIudp+uIu3yazzGlqAI5JYRluHJwSH/WUEDdXwWQwlzoC1H ok2gRlhS BIQ6ca2CoVGXN/TywZFafdEbX4WGhwTy7gl0CgM66NMqTf+vNRL1hbu+9lNzdexCMzGqxz8vLGAhsHluZGVLJYZYFdW6rbvIa2I/vcvkb6ih5fh3yNf/JrIogkc/LXVIPr/mQtPpkUifMKSfZmcSrGw3V41uqNKmteP6liBA1+wev6e3WITM3UnPtXlIsb+mO0pr0ZjlIL/s9rKG2XO8OjtpdIyZG13GmxMxN19TPjJDTPhW6XSDUcHX6/RmnVts2xDdyKYhl9PztA21TfQWTC8r37PXQjOZEsoiaFbRsW2P/Oj+VHei54YFrnDkATzSDuNgmZ+UzSdsSTjf/As/i0VwJ4g0oCDoWh6tPN51VcnlF/91Di78RJdLnU0WNH5y/AFiAxuBbbT3two8lI3PwDshZogkArsnA0Pgnk8MH7up1RQkaqCtpEf0K2A== 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 455c4a1..d2ff482 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); } int fuse_dax_break_layouts(struct inode *inode, u64 dmap_start, 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);