Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165544
b: refs/heads/master
c: 637d020
h: refs/heads/master
v: v3
  • Loading branch information
Abhishek Kulkarni authored and Eric Van Hensbergen committed Sep 23, 2009
1 parent c525b67 commit 319a1f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 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: 7549ae3e81cc45908cbeee54a52b24f247fb0a2d
refs/heads/master: 637d020a02cd734bf27acfc56c6d942cddd9eb80
15 changes: 8 additions & 7 deletions trunk/fs/9p/vfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <linux/string.h>
#include <linux/inet.h>
#include <linux/list.h>
#include <linux/pagemap.h>
#include <asm/uaccess.h>
#include <linux/idr.h>
#include <net/9p/9p.h>
Expand Down Expand Up @@ -210,6 +211,7 @@ v9fs_file_write(struct file *filp, const char __user * data,
struct p9_client *clnt;
struct inode *inode = filp->f_path.dentry->d_inode;
int origin = *offset;
unsigned long pg_start, pg_end;

P9_DPRINTK(P9_DEBUG_VFS, "data %p count %d offset %x\n", data,
(int)count, (int)*offset);
Expand All @@ -225,7 +227,7 @@ v9fs_file_write(struct file *filp, const char __user * data,
if (count < rsize)
rsize = count;

n = p9_client_write(fid, NULL, data+total, *offset+total,
n = p9_client_write(fid, NULL, data+total, origin+total,
rsize);
if (n <= 0)
break;
Expand All @@ -234,13 +236,12 @@ v9fs_file_write(struct file *filp, const char __user * data,
} while (count > 0);

if (total > 0) {
invalidate_inode_pages2_range(inode->i_mapping, origin,
origin+total);
pg_start = origin >> PAGE_CACHE_SHIFT;
pg_end = (origin + total - 1) >> PAGE_CACHE_SHIFT;
invalidate_inode_pages2_range(inode->i_mapping, pg_start,
pg_end);
*offset += total;
}

if (*offset > i_size_read(inode)) {
i_size_write(inode, *offset);
i_size_write(inode, i_size_read(inode) + total);
inode->i_blocks = (i_size_read(inode) + 512 - 1) >> 9;
}

Expand Down

0 comments on commit 319a1f3

Please sign in to comment.