From: Hans Reiser <reiser@namesys.com>
To: Andrew Morton <akpm@osdl.org>
Cc: LKML <linux-kernel@vger.kernel.org>, vs <vs@thebsh.namesys.com>
Subject: [Fwd: [PATCH 1/8] reiser4-add-crc-sendfile.patch]
Date: Tue, 15 Nov 2005 23:57:47 -0800 [thread overview]
Message-ID: <437AE67B.6040405@namesys.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: [PATCH 1/8] reiser4-add-crc-sendfile.patch --]
[-- Type: message/rfc822, Size: 4929 bytes --]
[-- Attachment #2.1.1: Type: text/plain, Size: 2 bytes --]
.
[-- Attachment #2.1.2: reiser4-add-crc-sendfile.patch --]
[-- Type: text/plain, Size: 3653 bytes --]
From: Edward Shishkin <edward@namesys.com>
This patch adds sendfile method for cryptcompress files.
Signed-off-by: Vladimir V. Saveliev <vs@namesys.com>
fs/reiser4/plugin/file/cryptcompress.c | 35 +++++++++++++++++++++++++++++++--
fs/reiser4/plugin/file/file.h | 2 +
fs/reiser4/plugin/object.c | 3 +-
3 files changed, 37 insertions(+), 3 deletions(-)
diff -puN fs/reiser4/plugin/file/cryptcompress.c~reiser4-add-crc-sendfile fs/reiser4/plugin/file/cryptcompress.c
--- linux-2.6.14-mm2/fs/reiser4/plugin/file/cryptcompress.c~reiser4-add-crc-sendfile 2005-11-15 16:58:35.000000000 +0300
+++ linux-2.6.14-mm2-vs/fs/reiser4/plugin/file/cryptcompress.c 2005-11-15 17:08:26.000000000 +0300
@@ -3670,8 +3670,8 @@ int capturepage_cryptcompress(struct pag
/* plugin->u.file.mmap */
int mmap_cryptcompress(struct file *file, struct vm_area_struct *vma)
{
- return -ENOSYS;
- //return generic_file_mmap(file, vma);
+ //return -ENOSYS;
+ return generic_file_mmap(file, vma);
}
/* plugin->u.file.release */
@@ -3834,6 +3834,37 @@ int setattr_cryptcompress(struct dentry
return result;
}
+/* sendfile_cryptcompress - sendfile of struct file_operations */
+ssize_t
+sendfile_cryptcompress(struct file *file, loff_t *ppos, size_t count,
+ read_actor_t actor, void *target)
+{
+ reiser4_context *ctx;
+ ssize_t result;
+ struct inode *inode;
+ cryptcompress_info_t *info;
+
+ inode = file->f_dentry->d_inode;
+ ctx = init_context(inode->i_sb);
+ if (IS_ERR(ctx))
+ return PTR_ERR(ctx);
+ /*
+ * generic_file_sndfile may want to call update_atime. Grab space for
+ * stat data update
+ */
+ result = reiser4_grab_space(estimate_update_common(inode),
+ BA_CAN_COMMIT);
+ if (result)
+ goto exit;
+ info = cryptcompress_inode_data(inode);
+ down_read(&info->lock);
+ result = generic_file_sendfile(file, ppos, count, actor, target);
+ up_read(&info->lock);
+ exit:
+ reiser4_exit_context(ctx);
+ return result;
+}
+
static int
save_len_cryptcompress_plugin(struct inode *inode, reiser4_plugin * plugin)
{
diff -puN fs/reiser4/plugin/file/file.h~reiser4-add-crc-sendfile fs/reiser4/plugin/file/file.h
--- linux-2.6.14-mm2/fs/reiser4/plugin/file/file.h~reiser4-add-crc-sendfile 2005-11-15 16:58:35.000000000 +0300
+++ linux-2.6.14-mm2-vs/fs/reiser4/plugin/file/file.h 2005-11-15 16:58:35.000000000 +0300
@@ -169,6 +169,8 @@ ssize_t read_cryptcompress(struct file *
ssize_t write_cryptcompress(struct file *, const char __user *buf, size_t write_amount,
loff_t * off);
int mmap_cryptcompress(struct file *, struct vm_area_struct *);
+ssize_t sendfile_cryptcompress(struct file *file, loff_t *ppos, size_t count,
+ read_actor_t actor, void *target);
/* address space operations */
extern int readpage_cryptcompress(struct file *, struct page *);
diff -puN fs/reiser4/plugin/object.c~reiser4-add-crc-sendfile fs/reiser4/plugin/object.c
--- linux-2.6.14-mm2/fs/reiser4/plugin/object.c~reiser4-add-crc-sendfile 2005-11-15 16:58:35.000000000 +0300
+++ linux-2.6.14-mm2-vs/fs/reiser4/plugin/object.c 2005-11-15 16:58:35.000000000 +0300
@@ -306,7 +306,7 @@ file_plugin file_plugins[LAST_FILE_PLUGI
.write = write_cryptcompress,
.mmap = mmap_cryptcompress,
.fsync = sync_common,
- .sendfile = sendfile_common
+ .sendfile = sendfile_cryptcompress
},
.as_ops = {
.writepage = reiser4_writepage,
@@ -331,6 +331,7 @@ file_plugin file_plugins[LAST_FILE_PLUGI
.owns_item = owns_item_common,
.can_add_link = can_add_link_common,
.detach = dummyop,
+ .bind = dummyop,
.safelink = safelink_common,
.estimate = {
.create = estimate_create_common,
_
reply other threads:[~2005-11-16 7:57 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=437AE67B.6040405@namesys.com \
--to=reiser@namesys.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vs@thebsh.namesys.com \
/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