From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AA0FC433F5 for ; Fri, 20 May 2022 00:41:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344078AbiETAlT (ORCPT ); Thu, 19 May 2022 20:41:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343938AbiETAlP (ORCPT ); Thu, 19 May 2022 20:41:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 413BB35265 for ; Thu, 19 May 2022 17:41:12 -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 dfw.source.kernel.org (Postfix) with ESMTPS id E568761AC8 for ; Fri, 20 May 2022 00:41:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07DE8C385B8; Fri, 20 May 2022 00:41:10 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="fwWP7O5j" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1653007270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vkxnEo4pirJjax+GcZ9VlzCPXywbCo9wzJe/TT1cyeM=; b=fwWP7O5j6wOB2ya+VD3CPI4mjd/9uFa4CBgbzIVHaQ8o3Nxw4MZBReUJ8UcWaIUkndsr59 AMMjoXW0qKsp2Oe8qusThwiDhQ7FRkrdJuUeuhnUYfUfO1Y/5VIvkYpsrb9OeFFwVJy5mb i8zNvQRFgKghurRm0onRg7SsRunFza8= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 166ebe75 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Fri, 20 May 2022 00:41:09 +0000 (UTC) From: "Jason A. Donenfeld" To: Jens Axboe , LKML Cc: "Jason A . Donenfeld" Subject: [PATCH v3 3/3] random: wire up fops->splice_{read,write}_iter() Date: Fri, 20 May 2022 02:40:58 +0200 Message-Id: <20220520004058.96691-4-Jason@zx2c4.com> In-Reply-To: <20220520004058.96691-1-Jason@zx2c4.com> References: <20220520004058.96691-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jens Axboe 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.] Signed-off-by: Jason A. Donenfeld --- drivers/char/random.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/char/random.c b/drivers/char/random.c index a664e2b89ae0..90d779c5d1a1 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1417,6 +1417,8 @@ const struct file_operations random_fops = { .compat_ioctl = compat_ptr_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 = { @@ -1426,6 +1428,8 @@ const struct file_operations urandom_fops = { .compat_ioctl = compat_ptr_ioctl, .fasync = random_fasync, .llseek = noop_llseek, + .splice_read = generic_file_splice_read, + .splice_write = iter_file_splice_write, }; -- 2.35.1