Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp62160lqj; Thu, 11 Apr 2024 09:51:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtMl5WNYcXnENffSFaKcz1xY2kp3G83aq6wpW7zAkguKPnZlxa2W1nlXmIydSRCcySCxaDBFNTCeRFRupR3CeD9YrmuBh/JHpYyE+Cfg== X-Google-Smtp-Source: AGHT+IEHJLnWi5x+hiE7i6Azo58AiVqh6rCftIle6ID1ZSdH2tqM+i/lkgobTKHLoayLZUVuBw5H X-Received: by 2002:a17:906:34d2:b0:a51:d531:ee33 with SMTP id h18-20020a17090634d200b00a51d531ee33mr162766ejb.43.1712854296528; Thu, 11 Apr 2024 09:51:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712854296; cv=pass; d=google.com; s=arc-20160816; b=sgFaOWGKda7qD1XoC26RzvtyuecKWd+Iz8ESxqyI20HJ30mI9HuU2JAzztd8cOZ+lV CEOR4MHg+K3adYoqBoWtihAIrn+SYPz+i/VPXuKF/c+u4njV2lIuwiYxKoj2bdmUTTfR PRS6yMRzN2bxTu1ZezxiYUHJqy+cginc5xdckapZYh6NKB5/VwvJQ8H9sO/tBUwgpxve imr85h3yij8EVcLqiequlRpfvdev4o4b9qJ3qmPr0NWWFXxjJyJBNULnaYTk96jkxP3e /qDU0Vo6wx33zQb0TftnAldCpClMoxwXLlMpWb5/ROCVzmXj+xJ7BZ2vfg3ni6W5RshA L+NQ== 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=xcj7frfmKf3TG9j28sfetheUjR7sb7AoMM45ttfCxdo=; fh=2FInBIgEh7xt9W7JS1z2wQ7fUhvLHtwfAfkXluU3JoI=; b=pqgcNzU859dMsE2SLers+91GmntEuE94eaFbQSbOBRVOrjRyFtFP7Vtmh8U+6wKCee wPVSgJGRimbH1F7z4l9/QUVv22lNRRRcQ+HtuEoCSj3ltCFOsvDrtfYGVeODTjp+qdOL 7kBcD9GI4vOM9ptzRjmZmoXR7PljSa/P+shcQUTgEvyJZ9qHdnuKgZ/jfidjBj8EazUI jV62I85EqIjDpV84Tjf3/i7+78pCTtkYhJQBb/W6hJvn6jp2rIbPpkj+YhYU8PHBa3gD V/+AljX30+HKxedXs3rGMoiGuRrg6StNug4PMI0p3z4jTk86E71drd+C/sHBlz7wNz3j UvAg==; 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=fLgqN+Ju; 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-141062-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141062-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i7-20020a1709061cc700b00a4a347e0896si825159ejh.1024.2024.04.11.09.51.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 09:51:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141062-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=fLgqN+Ju; 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-141062-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141062-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 587C21F25334 for ; Thu, 11 Apr 2024 16:45:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 605E01D2A1A; Thu, 11 Apr 2024 15:39:41 +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="fLgqN+Ju" Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (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 2BC9F14F64 for ; Thu, 11 Apr 2024 15:39:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849980; cv=none; b=TX/s0GaxYFHjCEVTsSRwIgU/hIVTfk/7ElA7j9u3mh2RbdKPfS99ON+oVNugBMpT2h3tb1i+J+aOZxGKcSeFNDzE7qa8yq7NvaHDv1fptBwugCqphUd2rdn9OtMcj0DgqYv02gV0DUndWsPJyg9Rnkj0aS9h7EqYDuTUftuDEcE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849980; c=relaxed/simple; bh=XiXOfTTNOd1sJPDc63QHE7E6r8vBnGvBV/iAtaV5FJs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PE+0bTCAEVB590QND+9cWl4SIUK9vgtyKW4DMpWdRNsVOa/4dPY88yzWQ5c4hxBtXESDPRALhdNM1K+PJpoogNdGv91gaVDL9ZI+y+mGgMTmLAzSM2e0IKjv4u/QLmTwqkB/uMae6ZX5KGE9lhZPiHMh3p58AqurHxzRGkV5tNw= 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=fLgqN+Ju; arc=none smtp.client-ip=209.85.166.174 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-il1-f174.google.com with SMTP id e9e14a558f8ab-36a34b68277so115975ab.0 for ; Thu, 11 Apr 2024 08:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1712849978; x=1713454778; 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=xcj7frfmKf3TG9j28sfetheUjR7sb7AoMM45ttfCxdo=; b=fLgqN+JuClkupZsDsa1SPi5ZusoElc/QpWhs+3ivK2q/Xmo5L+ZiajF3vJ4x2qydqn IEX0psf2aSieYxDdFBs1Rxl3wTwwzcYDVQRihAVAZi/Vl5ACYfG8WI//B3WZUAl1xLgP Rb9RCyIt0tJq5w7AI3/SkkP3O8IK0j7nmFFrqjr4/aaVT3GixJB0TYVaIbPT1SLbYaaH LjTiioZ94G9p1wuJ4PTHPPoTj9TpOphbI3IAar/bftMIsGwmQLIbfNuxNrK3GNYeSAxb Ccp++LJRUSzQAlBGezfDtbAz+3I6869rr0AmanQUA4a8nQOxIzqctfOn4VajJGFaSF85 RFCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712849978; x=1713454778; 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=xcj7frfmKf3TG9j28sfetheUjR7sb7AoMM45ttfCxdo=; b=Zq1cX7QXx8xb/LaAQok6pEGQjKnIrHI1a8B0lvOMioysfVYmfO0UAioN+/qd+ZljNr 0hkJpcHh5kU+tEJtw+mAiXz8g6ONfwF7GW+fC5dKRW9sk8eMR6ZIFuGcXD/NH71DtPeb om0RWRKLxmd7JhxaLmfpGv3iZEnOkGBTGiCc+8bHAKnMu7ejcLFBJpSHrniFlZlPO13j eCm6K+UG+wZEm3PEM/+oxESqrJBWKaKkuSIbKywEON6+BWd3HZ+T1kfRmUkB2b+J8aJy aBkC1LSnohC1Flih0aznhLVpr6tSjcQJgcKrkaS9ebv8qlE6zabCC5c86t76mwY7fsSM YOEA== X-Gm-Message-State: AOJu0Yylx2QwhdaLsgk65W2y/wkVevcPSrdKsCY9Fq/OO8t/Y7ot/fld bb1dQ0kqWBNcQySOo/L40rCVWIbemR9EcRxoid5Pf6KV+4t+AYg4XRLMb8NhZuNq4mTAXbCt2em b X-Received: by 2002:a92:c56f:0:b0:369:e37d:541f with SMTP id b15-20020a92c56f000000b00369e37d541fmr6997412ilj.1.1712849977921; Thu, 11 Apr 2024 08:39:37 -0700 (PDT) Received: from localhost.localdomain ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id jc25-20020a056638891900b0047f14b7f6c0sm457056jab.5.2024.04.11.08.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 08:39:36 -0700 (PDT) From: Jens Axboe To: linux-kernel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 288/437] fs/xfs: convert to read/write iterators Date: Thu, 11 Apr 2024 09:17:08 -0600 Message-ID: <20240411153126.16201-289-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/xfs/scrub/stats.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/fs/xfs/scrub/stats.c b/fs/xfs/scrub/stats.c index 42cafbed94ac..bd546b61334d 100644 --- a/fs/xfs/scrub/stats.c +++ b/fs/xfs/scrub/stats.c @@ -235,12 +235,10 @@ xchk_stats_merge( static ssize_t xchk_scrub_stats_read( - struct file *file, - char __user *ubuf, - size_t count, - loff_t *ppos) + struct kiocb *iocb, + struct iov_iter *to) { - struct xchk_stats *cs = file->private_data; + struct xchk_stats *cs = iocb->ki_filp->private_data; char *buf; size_t bufsize; ssize_t avail, ret; @@ -250,7 +248,7 @@ xchk_scrub_stats_read( * do not want userspace to receive garbled text from multiple calls. * If the file position is greater than 0, return a short read. */ - if (*ppos > 0) + if (iocb->ki_pos > 0) return 0; bufsize = xchk_stats_estimate_bufsize(cs); @@ -265,7 +263,7 @@ xchk_scrub_stats_read( goto out; } - ret = simple_read_from_buffer(ubuf, count, ppos, buf, avail); + ret = simple_copy_to_iter(buf, &iocb->ki_pos, avail, to); out: kvfree(buf); return ret; @@ -273,21 +271,20 @@ xchk_scrub_stats_read( static const struct file_operations scrub_stats_fops = { .open = simple_open, - .read = xchk_scrub_stats_read, + .read_iter = xchk_scrub_stats_read, }; static ssize_t xchk_clear_scrub_stats_write( - struct file *file, - const char __user *ubuf, - size_t count, - loff_t *ppos) + struct kiocb *iocb, + struct iov_iter *from) { - struct xchk_stats *cs = file->private_data; + struct xchk_stats *cs = iocb->ki_filp->private_data; + size_t count = iov_iter_count(from); unsigned int val; int ret; - ret = kstrtouint_from_user(ubuf, count, 0, &val); + ret = kstrtouint_from_iter(from, count, 0, &val); if (ret) return ret; @@ -300,7 +297,7 @@ xchk_clear_scrub_stats_write( static const struct file_operations clear_scrub_stats_fops = { .open = simple_open, - .write = xchk_clear_scrub_stats_write, + .write_iter = xchk_clear_scrub_stats_write, }; /* Initialize the stats object. */ -- 2.43.0