Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218936
b: refs/heads/master
c: 3834b12
h: refs/heads/master
v: v3
  • Loading branch information
Harsh Prateek Bora authored and Eric Van Hensbergen committed Oct 28, 2010
1 parent 4c6f581 commit 93e3bdd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57ee047b4d6bb4bcc74be0329441d1b242e57e61
refs/heads/master: 3834b12a18d51d6c535ea52e16355d75806ffe38
23 changes: 19 additions & 4 deletions trunk/fs/9p/vfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ static ssize_t
v9fs_file_write(struct file *filp, const char __user * data,
size_t count, loff_t * offset)
{
int n, rsize, total = 0;
ssize_t retval;
size_t total = 0;
int n, rsize;
struct p9_fid *fid;
struct p9_client *clnt;
struct inode *inode = filp->f_path.dentry->d_inode;
Expand All @@ -234,6 +236,17 @@ v9fs_file_write(struct file *filp, const char __user * data,

rsize = fid->iounit ? fid->iounit : clnt->msize - P9_IOHDRSZ;

retval = generic_write_checks(filp, &origin, &count, 0);
if (retval)
goto out;

retval = -EINVAL;
if ((ssize_t) count < 0)
goto out;
retval = 0;
if (!count)
goto out;

do {
if (count < rsize)
rsize = count;
Expand All @@ -258,9 +271,11 @@ v9fs_file_write(struct file *filp, const char __user * data,
}

if (n < 0)
return n;

return total;
retval = n;
else
retval = total;
out:
return retval;
}

static int v9fs_file_fsync(struct file *filp, int datasync)
Expand Down

0 comments on commit 93e3bdd

Please sign in to comment.