Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e9f6a99cb844a61b04cab5b82e333d6efef1f735
Commit:     e9f6a99cb844a61b04cab5b82e333d6efef1f735
Parent:     cd9d67dfd2b4db5fdbf9dfa69e202b8571f1db20
Author:     Michael Halcrow <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 01:28:04 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 09:43:12 2007 -0700

    eCryptfs: Use generic_file_splice_read()
    
    eCryptfs is currently just passing through splice reads to the lower
    filesystem.  This is obviously incorrect behavior; the decrypted data is
    what needs to be read, not the lower encrypted data.  I cannot think of any
    good reason for eCryptfs to implement splice_read, so this patch points the
    eCryptfs fops splice_read to use generic_file_splice_read.
    
    Signed-off-by: Michael Halcrow <[EMAIL PROTECTED]>
    Reviewed-by: Jens Axboe <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/ecryptfs/file.c |   19 ++-----------------
 1 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index 94f456f..12ba7e3 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -338,21 +338,6 @@ static int ecryptfs_fasync(int fd, struct file *file, int 
flag)
        return rc;
 }
 
-static ssize_t ecryptfs_splice_read(struct file *file, loff_t * ppos,
-                                   struct pipe_inode_info *pipe, size_t count,
-                                   unsigned int flags)
-{
-       struct file *lower_file = NULL;
-       int rc = -EINVAL;
-
-       lower_file = ecryptfs_file_to_lower(file);
-       if (lower_file->f_op && lower_file->f_op->splice_read)
-               rc = lower_file->f_op->splice_read(lower_file, ppos, pipe,
-                                               count, flags);
-
-       return rc;
-}
-
 static int ecryptfs_ioctl(struct inode *inode, struct file *file,
                          unsigned int cmd, unsigned long arg);
 
@@ -365,7 +350,7 @@ const struct file_operations ecryptfs_dir_fops = {
        .release = ecryptfs_release,
        .fsync = ecryptfs_fsync,
        .fasync = ecryptfs_fasync,
-       .splice_read = ecryptfs_splice_read,
+       .splice_read = generic_file_splice_read,
 };
 
 const struct file_operations ecryptfs_main_fops = {
@@ -382,7 +367,7 @@ const struct file_operations ecryptfs_main_fops = {
        .release = ecryptfs_release,
        .fsync = ecryptfs_fsync,
        .fasync = ecryptfs_fasync,
-       .splice_read = ecryptfs_splice_read,
+       .splice_read = generic_file_splice_read,
 };
 
 static int
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to