linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafał Hibner" <rafal.hibner@secom.com.pl>
To: unlisted-recipients:; (no To-header on input)
Cc: "Rafał Hibner" <rafal.hibner@secom.com.pl>,
	"Alexander Viro" <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org (open list:FILESYSTEMS (VFS and
	infrastructure)), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] fs: Allow splicing from character device
Date: Sun, 26 Apr 2020 15:17:30 +0200	[thread overview]
Message-ID: <20200426131730.8438-1-rafal.hibner@secom.com.pl> (raw)

Splicing from character devices should be enabled. It allows for
efficient (ZEROCOPY) bulk data tranfers from device.
---
 fs/splice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/splice.c b/fs/splice.c
index 4735defc46..306d11c5ea 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -920,7 +920,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
 	 * piped splicing for that!
 	 */
 	i_mode = file_inode(in)->i_mode;
-	if (unlikely(!S_ISREG(i_mode) && !S_ISBLK(i_mode)))
+	if (unlikely(!S_ISREG(i_mode) && !S_ISBLK(i_mode) && !S_ISCHR(i_mode)))
 		return -EINVAL;
 
 	/*
-- 
2.24.1


                 reply	other threads:[~2020-04-26 13:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200426131730.8438-1-rafal.hibner@secom.com.pl \
    --to=rafal.hibner@secom.com.pl \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).