Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp68495lqj; Thu, 11 Apr 2024 10:01:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUqD88HqPwrK+Zg5wh58NozUitrX6vCw+S/D4DDK3mv7DCCdI6nkXrZBVjchX0LKR6vHY6GsK8I6BjPCLRiraYcfeYczrcABdZOw7pjLA== X-Google-Smtp-Source: AGHT+IHxEs5xXs7yQBJJQfY3uam287bPrGyPQJ//WZ9T2UzkXO2Usg0/MOKR6ldaH3/pAchu4sFH X-Received: by 2002:a50:d75d:0:b0:56d:c722:93a3 with SMTP id i29-20020a50d75d000000b0056dc72293a3mr236813edj.21.1712854918301; Thu, 11 Apr 2024 10:01:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712854918; cv=pass; d=google.com; s=arc-20160816; b=rDcX34iohbuT68MTf7jFTuKkNgrKQ0rdeEE4kUZFEGiHz1Qc/utF2zlhFQh20BrUel awgB3A1LBvunwmiWqRaH73omL0m1kcBlQ4P/fXRKkwYNgh4dK+zKLTVYhHlWOYv9XKbS O+N1E4lTzdmb2JdRwlw6/mFiUqWoVsxcGOzxZCNq3Meq/YcUFuckwMBs5SunZ712ULbi DiDieSLtz1za5KvJRwrHI51oLWro+2pjDtL3vkdp1nELF+rrTiwH2XxqRr/mnoIzSJcB Y3W0vjHJsHJf4LAPud/LDT65ZoymENF+PG8pH0khOktB0bEyNN1MqxrfinKoF4b2x9CQ Oasw== 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=Llyi1IogZE1nUb7GHT6MuAncAwq5FXJrNFNMt9VY/9U=; fh=2FInBIgEh7xt9W7JS1z2wQ7fUhvLHtwfAfkXluU3JoI=; b=o9uUeb9Xl93yBjkrnG6se031iotheLNmrK4R5KcqxI2yETSeG66U1PH9EzCbZHVPNC nDO4TCZ5U/k1Y4wiGYqWctwyZYoIL38HO7gvBSb9lZmFdBFSrYHfyNTcrKLPVX53LNYZ /3spWlROARB3W4mj8lx2ZHWAXRLHgPl+1ELdTDawjCAIthLUE8RbJanwGCMDu8mVJtcl gzRAw3lZnxbXMStPgypq9obHB5ucKSHVhp3mFAVC2pxU7FYGaqXE0on5f1LaGwSWcp0P qF4lfp0VI6zSSwiJjOjZ/75RYTEfNPakzbTE2lUQ9qIg5+oaWizPf0vk3CjbvIFvB6xa li4Q==; 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=cCH3HmXs; 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-141135-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141135-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 y10-20020a056402440a00b0056e5be8922csi923412eda.165.2024.04.11.10.01.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 10:01:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141135-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=cCH3HmXs; 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-141135-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141135-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 D70F31F229D0 for ; Thu, 11 Apr 2024 17:01:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B215167A5F; Thu, 11 Apr 2024 15:41:40 +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="cCH3HmXs" Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (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 64EB6167A55 for ; Thu, 11 Apr 2024 15:41:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712850099; cv=none; b=Ho9S2FSr2Mr1Tz+KStc2Gl4GBQBkwjrzBkalLVTkLK/d2LChAT740A1MGHkWeYY75VXez7viyJrdgO+ElcHdvbVEr33LG4Upv6/MNNm12nh4fTyFovYgw/SXavmtt72zGz3CafBd9BFiYwWvDi5zF5AUfbvAQytW36U59Mveuy4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712850099; c=relaxed/simple; bh=g+zwEFWI8VvsoSwOW1FTDAA15YfoeDjQvAm+jbBBB50=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mhAJKaKhn94jMu3K78sh1jHOFfYGtsi93Y42bFFvGNhHhqU6mQYMUrGl3BSPiVOlRPLLYzNS9uVVYNEv4NXGLuXB2p8TYageSfu9tQg6w8HtdYMCtTrZp1tG5+axwqonJ1jwYvPZsLL8vH1q4MgOsPIcODp6YHJNMXtrZHAaBAA= 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=cCH3HmXs; arc=none smtp.client-ip=209.85.166.50 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-f50.google.com with SMTP id ca18e2360f4ac-7d5ed700c2dso16252439f.0 for ; Thu, 11 Apr 2024 08:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1712850097; x=1713454897; 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=Llyi1IogZE1nUb7GHT6MuAncAwq5FXJrNFNMt9VY/9U=; b=cCH3HmXss12X+5z90iWJQZCqbQJIF0G8fiEML4+34ZgdXkT5eoUHMt8xr2CBleRWxz xvZm6qcP6CqChN1CiSEuPFLDEYKAet//jiyVJguCFtofdeWY81CRm3BZhMiHK5zDhvwo sVAWneC2sX5Tx4QFOKLTjR9MpDVaX6nAkXpx5bPzyCcC8AnBb12/Pc2oRkbUPRO3FKcI nNW0sWyUt06PMaLUXOvpSvgysrVwi1f/n9Ui8YtE7EqwKEIHOiPc20n4lRN7SPbDk5kL m2SUES841EDNk/0zPchlIkbaYqFGtgS9eCreKsDUpTb5BpPji7EkFvlDP/zfoIxaEC5T VdSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712850097; x=1713454897; 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=Llyi1IogZE1nUb7GHT6MuAncAwq5FXJrNFNMt9VY/9U=; b=m57farIKWul6cqQizEozG2W9WM03SLcyBYiB+AG1FcUOwCc1Bx+tqQNRFKn1u2AcWw zlkt9LDIK6TCj3YBtXE8pGxtQWgHWQGOL6b5G7JUoVNgisiE6YiIPiMX6ByJby1xrpPd 5FhfaXn4MqA6yI2E+CXZ8DIt9nQkCSZLYwPMvS7eKARhMMIFhwImezlXq4z9G5+ECSQW QrkFEIj9TbCkHI2ySWQTY/Qd+d3RktBIXuKo+Ra898nEMb1jK5yhtqiklhoJzh2J7GkK 1PFCa6d6KfxLHpyQxQ1IoiyP2iMDVkceE6+iwCV45j1CGU7a96zAm6MfT+fSyvM8fQUR elJA== X-Gm-Message-State: AOJu0YweB0FDv0Jhy0syQS+yy0ITMS6UocAtPO63SH2GVkFRBoYxH1U5 1usAcfwzmVxUQ1XnFr8KMvDV2wNyfsXkzi6m0ngfieDJ8yh6OjYcUMCatY5GQ8MsQ7IiL+LGpj6 4 X-Received: by 2002:a05:6602:38d:b0:7d6:513b:254 with SMTP id f13-20020a056602038d00b007d6513b0254mr201911iov.2.1712850097234; Thu, 11 Apr 2024 08:41: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.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 08:41:35 -0700 (PDT) From: Jens Axboe To: linux-kernel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 356/437] arch/sparc: convert to read/write iterators Date: Thu, 11 Apr 2024 09:18:16 -0600 Message-ID: <20240411153126.16201-357-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 --- arch/sparc/kernel/mdesc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c index 30f171b7b00c..bcc3afbc8760 100644 --- a/arch/sparc/kernel/mdesc.c +++ b/arch/sparc/kernel/mdesc.c @@ -1261,24 +1261,24 @@ static int mdesc_open(struct inode *inode, struct file *file) return 0; } -static ssize_t mdesc_read(struct file *file, char __user *buf, - size_t len, loff_t *offp) +static ssize_t mdesc_read(struct kiocb *iocb, struct iov_iter *to) { - struct mdesc_handle *hp = file->private_data; + struct mdesc_handle *hp = iocb->ki_filp->private_data; + size_t len = iov_iter_count(to); unsigned char *mdesc; int bytes_left, count = len; - if (*offp >= hp->handle_size) + if (iocb->ki_pos >= hp->handle_size) return 0; - bytes_left = hp->handle_size - *offp; + bytes_left = hp->handle_size - iocb->ki_pos; if (count > bytes_left) count = bytes_left; mdesc = (unsigned char *)&hp->mdesc; - mdesc += *offp; - if (!copy_to_user(buf, mdesc, count)) { - *offp += count; + mdesc += iocb->ki_pos; + if (!copy_to_iter_full(mdesc, count, to)) { + iocb->ki_pos += count; return count; } else { return -EFAULT; @@ -1303,7 +1303,7 @@ static int mdesc_close(struct inode *inode, struct file *file) static const struct file_operations mdesc_fops = { .open = mdesc_open, - .read = mdesc_read, + .read_iter = mdesc_read, .llseek = mdesc_llseek, .release = mdesc_close, .owner = THIS_MODULE, -- 2.43.0