Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6134324iog; Thu, 23 Jun 2022 12:04:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1stZJ+Fhz4nU2Kf+hv7O2rLWFs15MONrVHtkGbgW+fI5IAMAel0gxU/OV7y2njgG6sTeeJV X-Received: by 2002:a17:907:2d2a:b0:710:7ea6:2b9e with SMTP id gs42-20020a1709072d2a00b007107ea62b9emr9347057ejc.371.1656011057380; Thu, 23 Jun 2022 12:04:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011057; cv=none; d=google.com; s=arc-20160816; b=pdgbVpob6uE34GGr98ojoMR6UYMw4t2rL4H/Qf0Ji9B9va/yE/iHyl3sILM75krcOP eHD0gUJvUpq8FqLQS5kkO5z431HgtM0FbcIDxluBibSXZhIskmj3NBJi3BMFVHJKmdp7 5iA06YcJG9G+MysMt6kkpOlddQYv2o09XbdcUe/ABmz7tbBQvT66q+PkZXIGuiPXcnWF qDL0ztc32sXR+JHtuDEfg7HyS5j2yup6FhXQO1HgCq3knP0wleC8VV5Uf8RK7QwuKBSH 6r2Zp+Dr/h+0U0K40Hz19Y3NRAfPc+gaiMcfmZW6R+od37b10o5wkixln6fZ0PMsGI1k RKjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UuvbfGdI0a4oKutDWdRM8IRpugC0fqsQeIblNj6Iuu4=; b=FRfvR7S8wKKBD7TNtY2v93r+oZKHhBp6PL+cPUbgdk4+JAdPnksBLWj0Zj1Fzs4fuj 6AR1lXjH1bsAE/qXfYVjlS9sX0/Wbj26FePgH/zR9mC9uv3eh+7NpGpnyqRTn6fqDC89 KMSV+JSHJkLnpQ0K5VoWgAh1Gs0JdDHRqBPO29G5LAYnscLlqNXdRrUjiQ/USkFl1SQv vyymTDo2WrQBJM3eNj96K2ZDp2EQ5igR93hDohooTnjllqKtjg/3yxO6O4FB21gkvHzi GiHb9ChvAS5dmYoByQQaskerghKmKhRwL9lpBILuKY6hTTwGdNzMHnMbpjuJzwSseyOO m2IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VnwHxOKj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i12-20020a1709064fcc00b007175ffc8bcfsi1883530ejw.922.2022.06.23.12.03.50; Thu, 23 Jun 2022 12:04:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VnwHxOKj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230190AbiFWRJ0 (ORCPT + 99 others); Thu, 23 Jun 2022 13:09:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233035AbiFWRH3 (ORCPT ); Thu, 23 Jun 2022 13:07:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A974522DD; Thu, 23 Jun 2022 09:56:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 861BBB8248C; Thu, 23 Jun 2022 16:56:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01EE8C3411B; Thu, 23 Jun 2022 16:56:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656003363; bh=bRpfpTLbjOWFCMFLl0M5dzFYUWbGwOag7/SYxuGRWz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VnwHxOKjKNXa1VC376oKYuS/mFjXpaqom+EIvLsEJCLDxsm6xDxwfHr3P0XXAx1H8 jlBB7NvEkpsfghaubGX3kJbIW7T/758qhA9C9HVwIFNoUOgnsSkw8UA/VmMyYj7Mfw g2tb9pg1nbMY9/5BGRgVnlqm6T7piHO324QrjaKI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jens Axboe , Al Viro , "Jason A. Donenfeld" Subject: [PATCH 4.9 212/264] random: wire up fops->splice_{read,write}_iter() Date: Thu, 23 Jun 2022 18:43:25 +0200 Message-Id: <20220623164350.071845525@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164344.053938039@linuxfoundation.org> References: <20220623164344.053938039@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jens Axboe commit 79025e727a846be6fd215ae9cdb654368ac3f9a6 upstream. Now that random/urandom is using {read,write}_iter, we can wire it up to using the generic splice handlers. Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops") Signed-off-by: Jens Axboe [Jason: added the splice_write path. Note that sendfile() and such still does not work for read, though it does for write, because of a file type restriction in splice_direct_to_actor(), which I'll address separately.] Cc: Al Viro Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- drivers/char/random.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1382,6 +1382,8 @@ const struct file_operations random_fops .unlocked_ioctl = random_ioctl, .fasync = random_fasync, .llseek = noop_llseek, + .splice_read = generic_file_splice_read, + .splice_write = iter_file_splice_write, }; const struct file_operations urandom_fops = { @@ -1390,6 +1392,8 @@ const struct file_operations urandom_fop .unlocked_ioctl = random_ioctl, .fasync = random_fasync, .llseek = noop_llseek, + .splice_read = generic_file_splice_read, + .splice_write = iter_file_splice_write, };