From patchwork Mon Nov 11 23:37:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 13871498 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB6FFD3ABFD for ; Mon, 11 Nov 2024 23:49:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 97EE96B00E6; Mon, 11 Nov 2024 18:49:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E03C6B00E7; Mon, 11 Nov 2024 18:49:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A9256B00E8; Mon, 11 Nov 2024 18:49:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 582B06B00E6 for ; Mon, 11 Nov 2024 18:49:15 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 111B01A1C72 for ; Mon, 11 Nov 2024 23:49:15 +0000 (UTC) X-FDA: 82775456904.05.896195B Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by imf27.hostedemail.com (Postfix) with ESMTP id 5AB3E4000A for ; Mon, 11 Nov 2024 23:48:31 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=yXH8CiHi; spf=pass (imf27.hostedemail.com: domain of axboe@kernel.dk designates 209.85.210.176 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731368899; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ieWCO7ZvnQOESu0rOvKqnHS1oC/GZ0fSczrbrfzlBys=; b=Y7DTia7Q/kNIwaBZccHH8n+mSZRa/sIiay5mduhpO+zSGZXfDXgvRbvTcf83VyldlrKgIv rVusYAcn6r0Q8FmtkWJ2PyKE6B+Wk1RmIUdxW3Xl2w7Rip9S0fU45Wi2DDNqO5b1yxUc5D Aro4XavDFMhf9f3D2ZHJR55UQ2cD+Y4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731368899; a=rsa-sha256; cv=none; b=52qr0ZL4Z4vujCx9wyM+wUdLxvH9Z12YYIRRA7RmWchni8ks5Y5Joppw0INYyaMRacVJhK JGepQUOknvCVDC9VxmLxtVbQSNbe8iNDbPNgaHziAUWDO+Z4nQ19HjB+ouw3q/qp52h0Kg XkVT8mGlqLmxcKdfw629OvG6rutXkLA= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=yXH8CiHi; spf=pass (imf27.hostedemail.com: domain of axboe@kernel.dk designates 209.85.210.176 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-720d01caa66so4744625b3a.2 for ; Mon, 11 Nov 2024 15:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1731368952; x=1731973752; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ieWCO7ZvnQOESu0rOvKqnHS1oC/GZ0fSczrbrfzlBys=; b=yXH8CiHioyODYDz/FYO2otWNugOEw0Hq+XZ//K1tWdjsJaViJU4KH0J6+BHur7xmcT 4nJPS11bf/cCJC8BpsufWXp2Xzhl1POIuUSsqZ78h8nhnhC7xi4SdpPcNcaOPAHGychN xmfraCFByyfo5nzim3Qamb0sDl7MSHYeJykyQtcH8aR9LrFepa7y9oUlZjw/X3hX/fmI P+P1I45MvrXXe8wbELfDRuPOLeUVqpDp+JyupQWDPLC48wqWaUJcJQLzQwJPOzKA3PGE e/f1aIgCd4u6T81VojX+ZRbltwhmcgxINHfRAYX3QqC0St5+qGPVMLLTazb0oLmzBRE0 inoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731368952; x=1731973752; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ieWCO7ZvnQOESu0rOvKqnHS1oC/GZ0fSczrbrfzlBys=; b=U4WKTBkQTTM+W/gSqENhh71hCBHQoKcsQFZ0nlA9k12UIVimm+JXcLp77UIn+XeiVA NUl5XuArzCTVr9AKqrhZqk/3fsKIY7pCbeEeupgoNH4VdNmQgViEN4+PBY5vnFROJGkO oDem3PdonrF0jePHvavrMEg+P1h4KPeIihuVKHnI1wIZEllwyi49rCrhimcxoQp7c9E7 brKFNM8euVMHSkAgvqe1/VH0fVCGb3P2XfEguZWi1RlGK5euZLp7wgkPFwwQTq39mQXv N3pBNtEb76hRdfM+19obqjVqrjUKAfLVYY9KomqStf8h+jAMruzzrVtVGogyYDkkZZ21 ft6w== X-Gm-Message-State: AOJu0YxDm0ruRlQXSVQLr/LmRJ0J0UJDiEmhpWrNUmrOUrBH7OQ78pwl RLIfwm12ESbsNu/dkvrcrzb650P4ZA2QodZvEI59uHXQ1VYxGe9dw3UtAHMy9oH/7CP+1EDbojM oHQg= X-Google-Smtp-Source: AGHT+IEuKUU8LmiDGdVSE8HEQD2DSqpmQWqCoCseRpXFHWRMzDS4n8tdQLpPQA0yFxWxU+7dmSvSgA== X-Received: by 2002:a05:6a00:a1d:b0:71e:693c:107c with SMTP id d2e1a72fcca58-724132c15a3mr18685493b3a.11.1731368951711; Mon, 11 Nov 2024 15:49:11 -0800 (PST) Received: from localhost.localdomain ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724078a7ee9sm10046057b3a.64.2024.11.11.15.49.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 15:49:10 -0800 (PST) From: Jens Axboe To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: hannes@cmpxchg.org, clm@meta.com, linux-kernel@vger.kernel.org, willy@infradead.org, kirill@shutemov.name, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, Jens Axboe Subject: [PATCH 15/16] xfs: flag as supporting FOP_UNCACHED Date: Mon, 11 Nov 2024 16:37:42 -0700 Message-ID: <20241111234842.2024180-16-axboe@kernel.dk> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241111234842.2024180-1-axboe@kernel.dk> References: <20241111234842.2024180-1-axboe@kernel.dk> MIME-Version: 1.0 X-Stat-Signature: 6huu5oe76u5fnbcx3p5ige9dybao5ou5 X-Rspam-User: X-Rspamd-Queue-Id: 5AB3E4000A X-Rspamd-Server: rspam02 X-HE-Tag: 1731368911-302506 X-HE-Meta: U2FsdGVkX19VfCmxcRnzVsp/arxqgqrwT6R4Sk99v8PsoU18gZCj6UrJBkqLzL2aXRY54j+ZKYYF9QQAHKPrfYyL2918VVDBDlda+YzF3SqiMnNU51QqucDw3CUjMpzlxmdAPFqghRdI62B4TJh6Bxc+NMap1yt34nTSKOO6RcGaqzGMmrlUHoDKuFZb6jT495X9lWn0XTv9TO8h8s/0s+WBvoW7FoVQagrrahFbxw6y0NNKCRsX9OyNnDswqbvrrNLVuJ/qoH2BpUY6Z60PX6rMSTarPS30BVi046lnotKWkSCShWdoz+vWYpVQzUEPIAPTCNjHM9YbYZiUgXFZthOP5zRBrcx0ku0Lc1GIQyKFDK0R0nIMXdrbsk8YlY4tN+9arBH7rofk8KkkG5ofeLTfGiKgQKVxVkDxl9Qb09POP70dytGfEILpsJRuzjb9R+1elSSAzAkXbsjgCqE+7135Y3JFbsxvk/Sg/OPhu824B8v7cqTsBJsuYCmBz4OrfftgrxIut8lEnmiUgEcRjJkSe996TZM5eED51n0QAnDIVzXiBTzl+egzDNOQ0Lpw1YBykgUt/kSG1a3ojYDe7pzuePhLGJYnPIQLVV6IOQtaWtGCVOngf12l54xPIypOi8c5GincJeMUCBReTGeNBpB0K0yPPAyvhEXFBcEC716QMYyroBJmXNuZ0gAXwFzXeSW8VrUjKMMDzkU+ReZmI34BN7K72UzOq/eCqUjwqgHNSF86PR08qYSVwGjwQWR4MAqNOJJxPg5FrnpMgB6/z+g1QdKUgBTu4xhgUKSXgbU3eL6n26dX0Q48pa0YmAz9XOjPNdbHwosu48guPe7xQmZ9gk0L2WNGnKkjCYgd654oECyKicAafaMntAtVNNp2bbxyRDWX8JwjLEsOQg6jxCmOeF/LJ9+MpJrIIXf3/AhLNdxk+kNs9PpbLoDhifKySOXAFOaas1bVAzlVnmE jaZhBLHu L3y9ib5DiM954aFrKRqIPARPNLkm6SmodN2IjNGeQ3/X4PKQwUZ1jgbACptCvZHpy67vjnoqhtG8oVj5TXt7Vp0EGp4HE6XYuFhlMMGwm2wJrxcuNHNWvAc9HmAHtQ45ovBtxvEWsLPo1G8HBWIRBrVd2oBeQq347JilpjOC9l855Zs/OL3aX7u+yeARUVSawS+WEOZ7RfCoD5tWWrUANQQ6DsOxGg4Bqiy5P8+9sSbbadtCeWmthrb6KuFTshMRDfZmnld+A1+V9ACE5bIyfn2+3X/vsSmXoR+/tI2aBtRBTN7KPNp75QmGy1wt/TNUERJeLimT4kVjh9cT5YtoRO0clAY4nXqlKmiiM 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: List-Subscribe: List-Unsubscribe: Read side was already fully supported, for the write side all that's needed now is calling generic_uncached_write() when uncached writes have been submitted. With that, enable the use of RWF_UNCACHED with XFS by flagging support with FOP_UNCACHED. Signed-off-by: Jens Axboe --- fs/xfs/xfs_file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index b19916b11fd5..1a7f46e13464 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -825,6 +825,7 @@ xfs_file_buffered_write( if (ret > 0) { XFS_STATS_ADD(ip->i_mount, xs_write_bytes, ret); + generic_uncached_write(iocb, ret); /* Handle various SYNC-type writes */ ret = generic_write_sync(iocb, ret); } @@ -1595,7 +1596,8 @@ const struct file_operations xfs_file_operations = { .fadvise = xfs_file_fadvise, .remap_file_range = xfs_file_remap_range, .fop_flags = FOP_MMAP_SYNC | FOP_BUFFER_RASYNC | - FOP_BUFFER_WASYNC | FOP_DIO_PARALLEL_WRITE, + FOP_BUFFER_WASYNC | FOP_DIO_PARALLEL_WRITE | + FOP_UNCACHED, }; const struct file_operations xfs_dir_file_operations = {