Commit 9ce50f5e authored by Robin Holt's avatar Robin Holt Committed by Linus Torvalds

[PATCH] Fix write() return values for reiserfs.

This patch fixes the direct I/O return value for reiserfs writes to be
ssize_t instead of int.
Signed-off-by: default avatarRobin Holt <holt@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 643d4316
...@@ -1099,7 +1099,7 @@ ssize_t reiserfs_file_write( struct file *file, /* the file we are going to writ ...@@ -1099,7 +1099,7 @@ ssize_t reiserfs_file_write( struct file *file, /* the file we are going to writ
{ {
size_t already_written = 0; // Number of bytes already written to the file. size_t already_written = 0; // Number of bytes already written to the file.
loff_t pos; // Current position in the file. loff_t pos; // Current position in the file.
size_t res; // return value of various functions that we call. ssize_t res; // return value of various functions that we call.
struct inode *inode = file->f_dentry->d_inode; // Inode of the file that we are writing to. struct inode *inode = file->f_dentry->d_inode; // Inode of the file that we are writing to.
/* To simplify coding at this time, we store /* To simplify coding at this time, we store
locked pages in array for now */ locked pages in array for now */
...@@ -1108,7 +1108,7 @@ ssize_t reiserfs_file_write( struct file *file, /* the file we are going to writ ...@@ -1108,7 +1108,7 @@ ssize_t reiserfs_file_write( struct file *file, /* the file we are going to writ
th.t_trans_id = 0; th.t_trans_id = 0;
if ( file->f_flags & O_DIRECT) { // Direct IO needs treatment if ( file->f_flags & O_DIRECT) { // Direct IO needs treatment
int result, after_file_end = 0; ssize_t result, after_file_end = 0;
if ( (*ppos + count >= inode->i_size) || (file->f_flags & O_APPEND) ) { if ( (*ppos + count >= inode->i_size) || (file->f_flags & O_APPEND) ) {
/* If we are appending a file, we need to put this savelink in here. /* If we are appending a file, we need to put this savelink in here.
If we will crash while doing direct io, finish_unfinished will If we will crash while doing direct io, finish_unfinished will
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment