Re: [PATCH 1/4] Vectorize aio_read/aio_write methods

From: Badari Pulavarty
Date: Thu May 11 2006 - 18:48:26 EST


On Thu, 2006-05-11 at 18:16 -0400, Chuck Lever wrote:
> Badari Pulavarty wrote:
> >
> >
> > Chuck Lever wrote:
> >
> >>
> >> Noticed these four file systems still appear to invoke
> >> generic_file_read/write:
> >>
> >> 0 fs/sysv/file.c <global> 25 .write = generic_file_write,
> >> 1 fs/ufs/file.c <global> 37 .write = generic_file_write,
> >> 2 fs/smbfs/file.c smb_file_write 341 result = generic_file_write(file,
> >> buf, count, ppos);
> >> 3 fs/udf/file.c udf_file_write 139 retval = generic_file_write(file,
> >> buf, count, ppos);
> >
> >
> > Hmm ? My 4th patch would get rid of generic_file_read() and
> > generic_file_write()
> > and all its users. (basically converted to do_sync_read/write).
> >
> > Where do you see these, after applying all 4 patches ? I can't see them
> > in my tree.
>
> Yes, I applied all 4 of the patches you mailed out today to the latest
> 2.6.17-rc3 git tree. Could be my mistake... but when I try to build the
> kernel with UDF enabled, the build fails because it can't find
> generic_file_read.
>

Hi Andrew,

Some how I missed updates to few filesystems. Here is the patch to fix
them.

Thanks,
Badari

Missed to convert few filesystems not to use generic_file_read
and generic_file_write interfaces.

Signed-off-by: Badari Pulavarty <pbadari@xxxxxxxxxx>

diff -Naurp -X /usr/src/dontdiff linux-2.6.17-rc3/fs/smbfs/file.c linux-2.6.17-rc3.save/fs/smbfs/file.c
--- linux-2.6.17-rc3/fs/smbfs/file.c 2006-04-26 19:19:25.000000000 -0700
+++ linux-2.6.17-rc3.save/fs/smbfs/file.c 2006-05-09 15:30:32.000000000 -0700
@@ -233,7 +233,7 @@ smb_file_read(struct file * file, char _
(long)dentry->d_inode->i_size,
dentry->d_inode->i_flags, dentry->d_inode->i_atime);

- status = generic_file_read(file, buf, count, ppos);
+ status = do_sync_read(file, buf, count, ppos);
out:
return status;
}
@@ -338,7 +338,7 @@ smb_file_write(struct file *file, const
goto out;

if (count > 0) {
- result = generic_file_write(file, buf, count, ppos);
+ result = do_sync_write(file, buf, count, ppos);
VERBOSE("pos=%ld, size=%ld, mtime=%ld, atime=%ld\n",
(long) file->f_pos, (long) dentry->d_inode->i_size,
dentry->d_inode->i_mtime, dentry->d_inode->i_atime);
diff -Naurp -X /usr/src/dontdiff linux-2.6.17-rc3/fs/sysv/file.c linux-2.6.17-rc3.save/fs/sysv/file.c
--- linux-2.6.17-rc3/fs/sysv/file.c 2006-04-26 19:19:25.000000000 -0700
+++ linux-2.6.17-rc3.save/fs/sysv/file.c 2006-05-09 15:25:00.000000000 -0700
@@ -21,8 +21,10 @@
*/
const struct file_operations sysv_file_operations = {
.llseek = generic_file_llseek,
- .read = generic_file_read,
- .write = generic_file_write,
+ .read = do_sync_read,
+ .aio_read = generic_file_aio_read,
+ .write = do_sync_write,
+ .aio_write = generic_file_aio_write,
.mmap = generic_file_mmap,
.fsync = sysv_sync_file,
.sendfile = generic_file_sendfile,
diff -Naurp -X /usr/src/dontdiff linux-2.6.17-rc3/fs/udf/file.c linux-2.6.17-rc3.save/fs/udf/file.c
--- linux-2.6.17-rc3/fs/udf/file.c 2006-04-26 19:19:25.000000000 -0700
+++ linux-2.6.17-rc3.save/fs/udf/file.c 2006-05-09 15:27:28.000000000 -0700
@@ -136,7 +136,7 @@ static ssize_t udf_file_write(struct fil
}
}

- retval = generic_file_write(file, buf, count, ppos);
+ retval = do_sync_write(file, buf, count, ppos);

if (retval > 0)
mark_inode_dirty(inode);
@@ -249,11 +249,13 @@ static int udf_release_file(struct inode
}

const struct file_operations udf_file_operations = {
- .read = generic_file_read,
+ .read = do_sync_read,
+ .aio_read = generic_file_aio_read,
.ioctl = udf_ioctl,
.open = generic_file_open,
.mmap = generic_file_mmap,
.write = udf_file_write,
+ .aio_write = generic_file_aio_write,
.release = udf_release_file,
.fsync = udf_fsync_file,
.sendfile = generic_file_sendfile,
diff -Naurp -X /usr/src/dontdiff linux-2.6.17-rc3/fs/ufs/file.c linux-2.6.17-rc3.save/fs/ufs/file.c
--- linux-2.6.17-rc3/fs/ufs/file.c 2006-04-26 19:19:25.000000000 -0700
+++ linux-2.6.17-rc3.save/fs/ufs/file.c 2006-05-09 15:28:16.000000000 -0700
@@ -33,8 +33,10 @@

const struct file_operations ufs_file_operations = {
.llseek = generic_file_llseek,
- .read = generic_file_read,
- .write = generic_file_write,
+ .read = do_sync_read,
+ .aio_read = generic_file_aio_read,
+ .write = do_sync_write,
+ .aio_write = generic_file_aio_write,
.mmap = generic_file_mmap,
.open = generic_file_open,
.sendfile = generic_file_sendfile,



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/