aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hostfs/hostfs_kern.c
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2006-01-03 07:51:07 -0500
committerAnton Altaparmakov <aia21@cantab.net>2006-01-03 07:51:07 -0500
commitd087e4bdd24ebe3ae3d0b265b6573ec901af4b4b (patch)
treec2db1b4958bbf617a25398b7ef93d82006b26a17 /fs/hostfs/hostfs_kern.c
parent292d4ed32e35df4755052b5002e533348d1648fd (diff)
parent88026842b0a760145aa71d69e74fbc9ec118ca44 (diff)
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'fs/hostfs/hostfs_kern.c')
-rw-r--r--fs/hostfs/hostfs_kern.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 4684eb7d48c6..b3ad0bd0312f 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -501,11 +501,16 @@ int hostfs_commit_write(struct file *file, struct page *page, unsigned from,
501 long long start; 501 long long start;
502 int err = 0; 502 int err = 0;
503 503
504 start = (long long) (page->index << PAGE_CACHE_SHIFT) + from; 504 start = (((long long) page->index) << PAGE_CACHE_SHIFT) + from;
505 buffer = kmap(page); 505 buffer = kmap(page);
506 err = write_file(FILE_HOSTFS_I(file)->fd, &start, buffer + from, 506 err = write_file(FILE_HOSTFS_I(file)->fd, &start, buffer + from,
507 to - from); 507 to - from);
508 if(err > 0) err = 0; 508 if(err > 0) err = 0;
509
510 /* Actually, if !err, write_file has added to-from to start, so, despite
511 * the appearance, we are comparing i_size against the _last_ written
512 * location, as we should. */
513
509 if(!err && (start > inode->i_size)) 514 if(!err && (start > inode->i_size))
510 inode->i_size = start; 515 inode->i_size = start;
511 516
@@ -910,10 +915,8 @@ static struct inode_operations hostfs_dir_iops = {
910int hostfs_link_readpage(struct file *file, struct page *page) 915int hostfs_link_readpage(struct file *file, struct page *page)
911{ 916{
912 char *buffer, *name; 917 char *buffer, *name;
913 long long start;
914 int err; 918 int err;
915 919
916 start = page->index << PAGE_CACHE_SHIFT;
917 buffer = kmap(page); 920 buffer = kmap(page);
918 name = inode_name(page->mapping->host, 0); 921 name = inode_name(page->mapping->host, 0);
919 if(name == NULL) return(-ENOMEM); 922 if(name == NULL) return(-ENOMEM);