+ streamline-generic_file_-interfaces-and-filemap-ecryptfs.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     Streamline generic_file_* interfaces and filemap cleanups (ecryptfs)

has been added to the -mm tree.  Its filename is

     streamline-generic_file_-interfaces-and-filemap-ecryptfs.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: Streamline generic_file_* interfaces and filemap cleanups (ecryptfs)
From: Badari Pulavarty <pbadari@xxxxxxxxxx>

This patch cleans up generic_file_*_read/write() interfaces.  Christoph
Hellwig gave me the idea for this clean ups.

In a nutshell, all filesystems should set .aio_read/.aio_write methods and use
do_sync_read/ do_sync_write() as their .read/.write methods.  This allows us
to cleanup all variants of generic_file_* routines.

Final available interfaces:

generic_file_aio_read() - read handler
generic_file_aio_write() - write handler
generic_file_aio_write_nolock() - no lock write handler

__generic_file_aio_write_nolock() - internal worker routine

Signed-off-by: Badari Pulavarty <pbadari@xxxxxxxxxx>
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/ecryptfs/file.c |   20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff -puN fs/ecryptfs/file.c~streamline-generic_file_-interfaces-and-filemap-ecryptfs fs/ecryptfs/file.c
--- a/fs/ecryptfs/file.c~streamline-generic_file_-interfaces-and-filemap-ecryptfs
+++ a/fs/ecryptfs/file.c
@@ -99,14 +99,22 @@ out:
  * returns without any errors. This is to be used only for file reads.
  * The function to be used for directory reads is ecryptfs_read.
  */
-static ssize_t ecryptfs_read_update_atime(struct file *file, char __user * buf,
-					  size_t count, loff_t * ppos)
+static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
+				const struct iovec *iov,
+				unsigned long nr_segs, loff_t pos)
 {
 	int rc;
 	struct dentry *lower_dentry;
 	struct vfsmount *lower_vfsmount;
+	struct file *file = iocb->ki_filp;
 
-	rc = generic_file_read(file, buf, count, ppos);
+	rc = generic_file_aio_read(iocb, iov, nr_segs, pos);
+	/*
+	 * Even though this is a async interface, we need to wait
+	 * for IO to finish to update atime
+	 */
+	if (-EIOCBQUEUED == rc)
+		rc = wait_on_sync_kiocb(iocb);
 	if (rc >= 0) {
 		lower_dentry = ecryptfs_dentry_to_lower(file->f_dentry);
 		lower_vfsmount = ecryptfs_superblock_to_private(
@@ -473,8 +481,10 @@ const struct file_operations ecryptfs_di
 
 const struct file_operations ecryptfs_main_fops = {
 	.llseek = ecryptfs_llseek,
-	.read = ecryptfs_read_update_atime,
-	.write = generic_file_write,
+	.read = do_sync_read,
+	.aio_read = ecryptfs_read_update_atime,
+	.write = do_sync_write,
+	.aio_write = generic_file_aio_write,
 	.readdir = ecryptfs_readdir,
 	.ioctl = ecryptfs_ioctl,
 	.mmap = generic_file_mmap,
_

Patches currently in -mm which might be from pbadari@xxxxxxxxxx are

vectorize-aio_read-aio_write-fileop-methods.patch
remove-readv-writev-methods-and-use-aio_read-aio_write.patch
streamline-generic_file_-interfaces-and-filemap.patch
streamline-generic_file_-interfaces-and-filemap-ecryptfs.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux