Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6143605iog; Thu, 23 Jun 2022 12:15:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uQ72TWXR8xprLBWh6s9Cdg+LKklS6OwvBe4mpHLj5JAZJAFjbdD5gxXuILi4q7tTTBcqgG X-Received: by 2002:aa7:8890:0:b0:51c:454f:c93f with SMTP id z16-20020aa78890000000b0051c454fc93fmr41517010pfe.35.1656011702904; Thu, 23 Jun 2022 12:15:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011702; cv=none; d=google.com; s=arc-20160816; b=D7GuCvP3IPMI7v6DPblfBX3NihRPmRAZ6wWzwtV6G/XaPoi+kjZoGVnisM6Qk/1mpQ xB4+48Nh5Oz0Yh3kJSSRpg94hYFJegkvppG+gsmmB7BFOxDXpGXJz2o0bgFr7AmhYnF2 KmhwISrDt5ZTDDzvTmgSio6ytbWUmwvknVX/VRVCdcwZNw0NTpo89k9S7sSDJZhkIpsH q2VKLEuWc8vSaSoltKm4Usc9I4kegpruKwgQdJlE8lG+hiayO6CnKrhuMRVTThUCOAky WirnltKdY4c8mUaEUTkW9qCrimqHW34J1zMz+nbQjc9xAkWe6KjOopzsoXx56ipoNSPz +rOw== 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=9JlMiZc3Lq85ayUqUXnF3UlbztZRzyOvf9Ov4ktWVrg=; b=i7ZbbjXH07QHf1Qr2i4EnzjCkse/omTQcjnCn5C69So1o/wVpFo5OR7jsfW0Jb9d/S 5tF6S0Wx67TYzXoBEn0Tyhy8in1rdtJRzWvq7IfzSZDMptRphcuLkUFYVdqRp9AGt8yH PtdtRbxdxQuHsp/fnztAPRHsaa1DT2gaZ7ONpjn46PriVtcOUmTkQuJuOIJLA1X4KISq NIcrHKSkPHJf8haPxDD8NXhZS+ktSqKKydqcWvC85gQpukrDsMf7rQKVcj9jbdCdT4xD T6yYdRhGCMLrzWYxzNVl1vOU562wWPmgpE/1xCBWPsbJlP/FkOVFF6pUQ/dvzVjCBWKc OOmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MS1ajmkL; 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 pi4-20020a17090b1e4400b001ec8c9341basi4314947pjb.134.2022.06.23.12.14.51; Thu, 23 Jun 2022 12:15:02 -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=MS1ajmkL; 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 S236772AbiFWSQ3 (ORCPT + 99 others); Thu, 23 Jun 2022 14:16:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234111AbiFWSPp (ORCPT ); Thu, 23 Jun 2022 14:15:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46D085DF0D; Thu, 23 Jun 2022 10:22:10 -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 E8017B82497; Thu, 23 Jun 2022 17:22:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E64BC341C5; Thu, 23 Jun 2022 17:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004927; bh=VUdUdSClpPx72kdmXclp+/hBcSqoa28HxWnfFrjn8/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MS1ajmkL56pfcf9LP9mB6w+q15Ww5IZ8yKqeA9O4YGRgy0lnekpm9ao83PSIR/W/i fBFd1UwmLDgo1O7QfhCpNTwzrT3JqyMDJB3wXRMSFFSjE2NiMnVnXGQYI5aTk49xG7 uO3KhDMA3+d77JNsfw9wVOvL5bv+dzvXA2uBTkZs= 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.19 168/234] random: wire up fops->splice_{read,write}_iter() Date: Thu, 23 Jun 2022 18:43:55 +0200 Message-Id: <20220623164347.807363101@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@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 @@ -1381,6 +1381,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 = { @@ -1389,6 +1391,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, };