Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp34988lqj; Thu, 11 Apr 2024 09:10:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXuxROV4LvKpYr24qqojux8qA7CG+57PmqhPOTZNKxdQjjE//AInX2Gx0nVOYT4tkGjTis/CasBzobs0bFjoQLBMSBax1RZ/Yu2a2EbsQ== X-Google-Smtp-Source: AGHT+IE6Xc2eV7Q19qew/7JER0TeD1R2UN3WZ3yBB5Knj1NHkW6vIUryDoccoSk5cmk7EN1jjkCO X-Received: by 2002:a17:907:3e10:b0:a47:4bd6:9857 with SMTP id hp16-20020a1709073e1000b00a474bd69857mr123197ejc.64.1712851815066; Thu, 11 Apr 2024 09:10:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712851815; cv=pass; d=google.com; s=arc-20160816; b=WCc4VkRC9gL1MxAjFGLwkMHeikxXniTaD61+DgAMUV/qHPzKd4TM8oxqEO1mUDuQHq 7rWxdnRjSL8lxpr6h7pkm67PnvAiBr4/Lzv5oVJePzNZ5KFdo2cxm2W3XneHGa1PydpD 6AuNcu1smVh/PGL3bIHHNJY1OadI05W3uE8NVk8aCVMsTM7FyNkSje8FumYg9GtYgWSo D6acei2ABzPKAawnaPYdxyd/QP6iJZbcNtiCLruHbnJinPM2qFi/x7qYf7ir0HYX1e/B gtbzuqYNMxFG8C019gB4+vsEe9jnJuPjPimKY2H12t3PQqlqSDnfMB8m4DsK71IhaIkg Bo5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=mUkAf1+OBf+yGe/VzApEZjfPh2gbVfNKY1ge8fZZPGY=; fh=2FInBIgEh7xt9W7JS1z2wQ7fUhvLHtwfAfkXluU3JoI=; b=Zd8BTJwEW27s2lTKoxFlBH4X7UqWUmqyfJFB2d4CUsMlGy7qobUKRBgXpmlUylqx3G 8jDlu32WUzcodmzzGu5M4HkNSOfvqEby5drVMq7vQAxau+BFj/a22osYey8Xh72LTllv zfhQHGC1hUNCVSoMzVta/MWP6et9XE0DJzOYjP59xkEEGswP0tN65kTH4zoaHVXgUQ/e J8DxpmNPAG+f7ZMdGW9mHdrOLO/CW+KuGpfWjyF74p/e51LuX0PCgizj1kYqcILEelRw JkhoVbgeAJ61bTrQiwc0p2LNPtlRQ36NmsfNLX4LmQYscT5w1v6fb9qbDsQNrleTqKOs 2WfA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=PyFaYsFw; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-140899-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140899-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f17-20020a170906495100b00a51ddc6c9cdsi842272ejt.494.2024.04.11.09.10.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 09:10:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140899-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=PyFaYsFw; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-140899-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140899-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 860B41F214A5 for ; Thu, 11 Apr 2024 16:10:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCDEB15E1E0; Thu, 11 Apr 2024 15:35:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="PyFaYsFw" Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAC5E15CD7E for ; Thu, 11 Apr 2024 15:35:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849730; cv=none; b=kcd5l8F7WQ9pI6ekPRmcLIo0gZW0W46PlLxNh0jM4mIm/6FrG/Ddkf54opWdtaU+gm4UDn5uwA1qhCfVldUoMFBBP7CI1WBdcG/6eo5zdB5v6FgrHwFjIkSyR++HTjYsg5EBW2qlEG2YltQuqdFXnKrLpzOyVJp3sfYTM7dP8gc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849730; c=relaxed/simple; bh=hLULojXi2IM52qf7CXXJXO6GRH4vl6JLQfzNiql+XCo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iKdKSvj2IRw1fnXfykfBpjOM9R8yUWSn9x/LnYFkJnAyC8trF6lSRK6i+b7RzYeKc2GxuTmVrrkLrT9P+MzSJOBpsZxLj9U184EHoDIn6Q8UtZj8+xfqJowYp8vANan8/3pvfGSF4MlCKYFgeMWu/upeWYf2rya9A+R4uSaZ6XA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=PyFaYsFw; arc=none smtp.client-ip=209.85.166.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7d6112ba6baso58049739f.1 for ; Thu, 11 Apr 2024 08:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1712849727; x=1713454527; darn=vger.kernel.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=mUkAf1+OBf+yGe/VzApEZjfPh2gbVfNKY1ge8fZZPGY=; b=PyFaYsFwC/gMX/g9Ku3LRgPB4S1suRZ+8LmTElb/Ngne0DCY0XiIrlbt1QZd/qWMNU LYA2/z+RSPOkwVMmFfoE4f+UDltgx8V8AZyjabNxbfuJn8RMWmqsuCFne6hRhMcOF3nc oAIVQ/9LpnV18XkXk/dckAXeAJ4wEXd3pyi5eiKEYkxqgFyufTT2qdm2j7XHQVTCEElP aZTBbN21rzrwJTg/twc4agvtBZajtJqubfzu1f8350xPA2wb1hKiTzT9BZMAgk6kYuGF dsl+WB27/kQouuLxbUwL08GPgtRxUdTOFhnuLoqdjAp1FDwLin7n2AQ+BCl2jZjr3nrY o4Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712849727; x=1713454527; 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=mUkAf1+OBf+yGe/VzApEZjfPh2gbVfNKY1ge8fZZPGY=; b=NfzhoTbBZ0xyk16Y2S3Rv4aNwGrmbOAACLRW7jrmEUmGe4oQKmHfgHITlDO7yRKKwA I0vIXMRQsQ6a6eqD3hPUqDpHIC96sMReZ45L/dF2Kb+h8NvPgoGn6FPDQMjY9SV+JObQ HxLJglzxUWJky/qlS2kjn0yH9tzcdwIMIYP1Hk74LkNJZLxFgcJMTqZOAwH3OVUjm0xZ Ir44dbWoxJOJ36DL6Xp1UytY5QfScFrbiey7ep4cowvYjU96iLK9VmHGIHdX5WdcK+2h DcwkU8BAT3b4o5hjApb58JOmjGR+xBHnB/ewigW7q9bv89GjeD8bxoMpFr0xvaAFvf1N dhNw== X-Gm-Message-State: AOJu0YzE8G2eo1FZSQEK31YmVHZ2ZUW/sMAXImmcYGK3orbB1n0gu0GR ib3+upNjlyo4bLxROZq5lt0uzfH5jWrQEUbEd/t4iV4oerbEV0GlCtMU3DnVuAM/kJ7Tik6umRJ p X-Received: by 2002:a05:6602:38d:b0:7d6:513b:254 with SMTP id f13-20020a056602038d00b007d6513b0254mr181666iov.2.1712849727634; Thu, 11 Apr 2024 08:35:27 -0700 (PDT) Received: from localhost.localdomain ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id jc25-20020a056638891900b0047f14b7f6c0sm457056jab.5.2024.04.11.08.35.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 08:35:26 -0700 (PDT) From: Jens Axboe To: linux-kernel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 135/437] fs/notify: convert to read/write iterators Date: Thu, 11 Apr 2024 09:14:35 -0600 Message-ID: <20240411153126.16201-136-axboe@kernel.dk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240411153126.16201-1-axboe@kernel.dk> References: <20240411153126.16201-1-axboe@kernel.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Signed-off-by: Jens Axboe --- fs/notify/fanotify/fanotify_user.c | 6 ++++-- fs/notify/inotify/inotify_user.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index fbdc63cc10d9..52b97f6c2285 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -868,6 +868,7 @@ static ssize_t fanotify_read(struct file *file, char __user *buf, ret = buf - start; return ret; } +FOPS_READ_ITER_HELPER(fanotify_read); static ssize_t fanotify_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) { @@ -900,6 +901,7 @@ static ssize_t fanotify_write(struct file *file, const char __user *buf, size_t return count; } +FOPS_WRITE_ITER_HELPER(fanotify_write); static int fanotify_release(struct inode *ignored, struct file *file) { @@ -984,8 +986,8 @@ static long fanotify_ioctl(struct file *file, unsigned int cmd, unsigned long ar static const struct file_operations fanotify_fops = { .show_fdinfo = fanotify_show_fdinfo, .poll = fanotify_poll, - .read = fanotify_read, - .write = fanotify_write, + .read_iter = fanotify_read_iter, + .write_iter = fanotify_write_iter, .fasync = NULL, .release = fanotify_release, .unlocked_ioctl = fanotify_ioctl, diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index 85d8fdd55329..bdc424a79e3c 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c @@ -297,6 +297,7 @@ static ssize_t inotify_read(struct file *file, char __user *buf, ret = buf - start; return ret; } +FOPS_READ_ITER_HELPER(inotify_read); static int inotify_release(struct inode *ignored, struct file *file) { @@ -357,7 +358,7 @@ static long inotify_ioctl(struct file *file, unsigned int cmd, static const struct file_operations inotify_fops = { .show_fdinfo = inotify_show_fdinfo, .poll = inotify_poll, - .read = inotify_read, + .read_iter = inotify_read_iter, .fasync = fsnotify_fasync, .release = inotify_release, .unlocked_ioctl = inotify_ioctl, -- 2.43.0