Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201783
b: refs/heads/master
c: 97e8442
h: refs/heads/master
i:
  201781: 699420a
  201779: 7bf9faf
  201775: 5fea3b1
v: v3
  • Loading branch information
M. Mohan Kumar authored and Eric Van Hensbergen committed Aug 2, 2010
1 parent 2f71f3e commit 2cf1591
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 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: cff6b8a9b81b404e8ce0257b26007c3afe625212
refs/heads/master: 97e8442b0971ea6be9a495b3d03402985cfe5d6a
13 changes: 7 additions & 6 deletions trunk/fs/9p/vfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,15 @@ ssize_t
v9fs_file_readn(struct file *filp, char *data, char __user *udata, u32 count,
u64 offset)
{
int n, total;
int n, total, size;
struct p9_fid *fid = filp->private_data;

P9_DPRINTK(P9_DEBUG_VFS, "fid %d offset %llu count %d\n", fid->fid,
(long long unsigned) offset, count);

n = 0;
total = 0;
size = fid->iounit ? fid->iounit : fid->clnt->msize - P9_IOHDRSZ;
do {
n = p9_client_read(fid, data, udata, offset, count);
if (n <= 0)
Expand All @@ -160,7 +161,7 @@ v9fs_file_readn(struct file *filp, char *data, char __user *udata, u32 count,
offset += n;
count -= n;
total += n;
} while (count > 0 && n == (fid->clnt->msize - P9_IOHDRSZ));
} while (count > 0 && n == size);

if (n < 0)
total = n;
Expand All @@ -183,11 +184,13 @@ v9fs_file_read(struct file *filp, char __user *udata, size_t count,
{
int ret;
struct p9_fid *fid;
size_t size;

P9_DPRINTK(P9_DEBUG_VFS, "count %zu offset %lld\n", count, *offset);
fid = filp->private_data;

if (count > (fid->clnt->msize - P9_IOHDRSZ))
size = fid->iounit ? fid->iounit : fid->clnt->msize - P9_IOHDRSZ;
if (count > size)
ret = v9fs_file_readn(filp, NULL, udata, count, *offset);
else
ret = p9_client_read(fid, NULL, udata, *offset, count);
Expand Down Expand Up @@ -224,9 +227,7 @@ v9fs_file_write(struct file *filp, const char __user * data,
fid = filp->private_data;
clnt = fid->clnt;

rsize = fid->iounit;
if (!rsize || rsize > clnt->msize-P9_IOHDRSZ)
rsize = clnt->msize - P9_IOHDRSZ;
rsize = fid->iounit ? fid->iounit : clnt->msize - P9_IOHDRSZ;

do {
if (count < rsize)
Expand Down

0 comments on commit 2cf1591

Please sign in to comment.