From: Christoph Hellwig <hch@lst.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Tejun Heo <tj@kernel.org>
Cc: Siddharth Gupta <sidgup@codeaurora.org>, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] kernfs: wire up ->splice_read and ->splice_write
Date: Wed, 20 Jan 2021 21:46:31 +0100 [thread overview]
Message-ID: <20210120204631.274206-4-hch@lst.de> (raw)
In-Reply-To: <20210120204631.274206-1-hch@lst.de>
Wire up the splice_read and splice_write methods to the default
helpers using ->read_iter and ->write_iter now that those are
implemented for kernfs. This restores support to use splice and
sendfile on kernfs files.
Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops")
Reported-by: Siddharth Gupta <sidgup@codeaurora.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Siddharth Gupta <sidgup@codeaurora.org>
---
fs/kernfs/file.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
index b1a5cccf189ec7..c7571931214751 100644
--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -949,6 +949,8 @@ const struct file_operations kernfs_file_fops = {
.release = kernfs_fop_release,
.poll = kernfs_fop_poll,
.fsync = noop_fsync,
+ .splice_read = generic_file_splice_read,
+ .splice_write = iter_file_splice_write,
};
/**
--
2.29.2
next prev parent reply other threads:[~2021-01-20 21:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-20 20:46 restore splice and sendfile support on kernfs Christoph Hellwig
2021-01-20 20:46 ` [PATCH 1/3] kernfs: implement ->read_iter Christoph Hellwig
2021-01-20 20:46 ` [PATCH 2/3] kernfs: implement ->write_iter Christoph Hellwig
2021-01-20 20:46 ` Christoph Hellwig [this message]
2021-01-21 17:30 ` restore splice and sendfile support on kernfs Greg Kroah-Hartman
2021-01-21 17:41 ` Robert Karszniewicz
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=20210120204631.274206-4-hch@lst.de \
--to=hch@lst.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sidgup@codeaurora.org \
--cc=tj@kernel.org \
/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