From patchwork Sun Nov 10 15:28:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 13869958 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 745DED12D43 for ; Sun, 10 Nov 2024 15:29:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B73A36B00C2; Sun, 10 Nov 2024 10:29:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AD62C6B00C3; Sun, 10 Nov 2024 10:29:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 958F46B00C4; Sun, 10 Nov 2024 10:29:39 -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 6C1D36B00C2 for ; Sun, 10 Nov 2024 10:29:39 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 2FE351A0CF9 for ; Sun, 10 Nov 2024 15:29:39 +0000 (UTC) X-FDA: 82770568062.03.8F6CB08 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by imf17.hostedemail.com (Postfix) with ESMTP id 1352A4000D for ; Sun, 10 Nov 2024 15:29:06 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=E65yYVCn; spf=pass (imf17.hostedemail.com: domain of axboe@kernel.dk designates 209.85.216.51 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=1731252406; 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=UOFPioBMfFwiULfX2CgCROzzq0T9+46LQQmjqPU1X3SA0jqRFnUtmT1NG+j12V0xvwNQ9W UFmvyJDcIlnaEXWp8q6OwFeOke5dZ/EmWTx3GFb+GXt6n2nsYSA2L6hCOECKlWUzZJny3G Rv00TY0U+uzmduxfqxNckcvbzJe/9f0= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=E65yYVCn; spf=pass (imf17.hostedemail.com: domain of axboe@kernel.dk designates 209.85.216.51 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731252406; a=rsa-sha256; cv=none; b=mpN4AoOERER7kkD5rGbs8ahMZBaxKz+vDaLVVupqw1HI5bgrR8InPbkMFJMMtS6TN24Y36 BtIoYTDZc4QtI5wLk14ElnZjXRw01q4YMpAPwgiz52/o15e6qEFx1D972qW/+xJOMbkoP7 VtJb2qZF/pDGZHjeDeAUXELXnRoQGSk= Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2e2eb9dde40so3037535a91.0 for ; Sun, 10 Nov 2024 07:29:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1731252576; x=1731857376; 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=E65yYVCnPHaYjYncZnOvxSZUd1iJBf4fE/JmpdjLnHQJ42JwM5/Ojxnv0yCV2TsqLy NE7g8QV7VBKvbFYSGBdgILHgh/u/+mX6hjRtr9RiEJy8gaxtbEq76OD3GpnmerdMGocS 9OmapmmGXH1D/Vaz18UkbtdlQcDcCjScCkJlD7YjN1SV6L6neun2puU5Gy3hvYf+uBrf B6fxTXYCMCpI59tnoM+RDgf7n57IEfDYx58QVMczeECNFdjp/xwLlOMVH77pXomBYziM owDfbB9hQg5yaN32wLuWOJ+PIcA0grRAwxzz+KQQFYnxSM2PiLVHPIKP9NBsYQIDGL6n g4sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731252576; x=1731857376; 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=bjh/GeNp9VL5fPICkKHSpvVl4p0maDR4rx4l7UtkAGGtw2yywu85QyIwEpTrVCCNnq tlvksqZpVlB/kmBetAerinnx0utVD3Q43ny+rBba5AzUdB3rsMcWDIu47DyWY5qIJ5Gs ri+KypwxkwZY3+usrON7FAVx8LOsGeWHoElJciOAvwou6E2Mcu/CNI/f6B2ZS00os5II AhSIbln6NbkOuUYbiqNwck8yusjvWHXts5yuwDoyXjCVZ2lGSkfNXVfdbjAm4QslK9ig 9MqhWEXK0srkXM2WN5/iZQ7zRMlGPoMGWprYUnOA5oiSCd6AXG5ONs/OFYJZqOXrV+5t Hyfg== X-Gm-Message-State: AOJu0Yx/mohtholbrUmm1n8fiufyVnOvIJssEqYRNQL92xswKmqKz9oP 2uo6LRfwjwdvIRjQqvaHSFvELIfYBFkXld1GORUSl0wHeYQ5xu7hdgXmpaBeYS0JKbhPUCMKLtr Cm7M= X-Google-Smtp-Source: AGHT+IHHwm5ckcwW6tzDCyvD/cFUv8RX7EzbVytEaqdSin9tImlfNCqPLYYgjj9DyXwqjBBAmsxOog== X-Received: by 2002:a17:90b:180a:b0:2e2:d434:854c with SMTP id 98e67ed59e1d1-2e9b1655951mr13339967a91.2.1731252575687; Sun, 10 Nov 2024 07:29:35 -0800 (PST) Received: from localhost.localdomain ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e99a5f935dsm9940973a91.35.2024.11.10.07.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Nov 2024 07:29:35 -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, Jens Axboe Subject: [PATCH 15/15] xfs: flag as supporting FOP_UNCACHED Date: Sun, 10 Nov 2024 08:28:07 -0700 Message-ID: <20241110152906.1747545-16-axboe@kernel.dk> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241110152906.1747545-1-axboe@kernel.dk> References: <20241110152906.1747545-1-axboe@kernel.dk> MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 1352A4000D X-Stat-Signature: f1d5ywujbbe76fqi5uenkokmq8b9wfuu X-Rspam-User: X-HE-Tag: 1731252546-218481 X-HE-Meta: U2FsdGVkX1/9DXeqluoovzSj8NdOkNQtC1YCnq3soktzgo65FCQ3Jlfln2nnGkfBP1J2vwkPlEEWcA8aud8tgypiczzIzwWOdcxUE3tI0i+5MAylBku3f1VVDmCEKjGATRG8KSxGPYiaVBMq9sos3nHsKjNO1+3tPUHbE5VTXUC9DXDJIrFU3SivSUAemg8WxvVqiPw2rvD+sG+tRwWlxo3SUhx+D1DkbAm5mkOtLNpn9/0aWib4FknqT1Jg9dPWgnvrZ3ynzP/LkYrgtB4nI7wItnJ+PCb28mVw7hz4CdXMdBsE6LuRbR9SyzIw4BH9rvhrWih16NsR7dgnou1RhWhzzeJZdj05pJYHCsSF2/ISYMlHkR1JjCqq73bFvdeV/KZdi5SzFY96OHR26kXt4pBx9CuMsBrZm3O1RPDXLlB2PORFXwiPSrJoWAW5gK/BrmePIFuAoJBxGaPMBaLeDFZEj3D2y/0rTBqsZIFga0S2J+7kw1z31StOmPjRFWiBrbN1jpaYiubXY0Mo/n+s+LpMkMpUYY9oG/6kQOyzoGvreUVNf5btLxjzwD80ucCzVznBonHsJkeAZlD9mrOHl5rRPWyKODFLLVIRb1rkVQYu4b1JU1EEif59wF6/+p0odKwTc+nvUZrWqrRONlxd9Z742R3xmuZPpF7tmIbgIH6hMcsoCHAfoQOLoc9rSpZsmQ6HwN9ywxf7sFPRlLR2wMKEeZXkGwcvtcGVbd5lqKLuFlr0sgzVG6BevCNF2EmRneDYYegXs39ewK5Y+bHM9wxxQIlhRPxOzao5v7npRJ7ZU94/yYeXL+avLcg4TyxIh+XW0sjq2m8p40HI4clcV/xJjwbogdZXIfkNyyutX0PIgbVhgwGr665SgHkZ4IymvJ1XSUOnIaTPPCLZBIQh6iHRQClweyZqeYV3ApeZgCmcfQX9J+lYZG6AVt8rgF13DVxOD5SvioxrqkDridn zHl6u5ZX vucysdrAEJUrRQ/M55v2iN0JOgsPhrIOpaEUtQjzbCwzSgeeoXdRfO2YH4MjUqE00WJ0mEdKGmMz26C3s49w+NOu8MUYYANNC3MyBTLMaaVQMQB8aQpm1JWnIk6kLg8Vdj88eLVsEAx0bcCsIEGRIYXqRKBl/BliyT3laNL4dbD1KZg5/e3lrTYazlO2H2gyvNHVoXRRIQCc80Pn3AjNpPvd1/0y10OKyhgL4+ncK//EIgkbB//4LjXOt7Vnwvf38pWAEwgI/JBayh/HuMOsM7Pofto2+2GoPtsJRhHhtqSBEWrYrPtKGsi6rhir+vVGY77mHyRFoGcIz2sXQFLIZIbiVbargnX9k65lu 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 = {