Index: bora-vmsoft/hgfs/linux/page.c =================================================================== --- bora-vmsoft.orig/hgfs/linux/page.c +++ bora-vmsoft/hgfs/linux/page.c @@ -744,10 +744,16 @@ HgfsDoWriteBegin(struct page *page, unsigned pageFrom, // IN: Starting page offset unsigned pageTo) // IN: Ending page offset { +#ifndef HGFS_ENABLE_WRITEBACK + ASSERT(page); +#else + loff_t offset; + loff_t currentFileSize; + ASSERT(page); -#ifdef HGFS_ENABLE_WRITEBACK - loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT; - loff_t currentFileSize = compat_i_size_read(page->mapping->host); + + offset = (loff_t)page->index << PAGE_CACHE_SHIFT; + currentFileSize = compat_i_size_read(page->mapping->host); /* * If we are doing a partial write into a new page (beyond end of @@ -850,7 +856,15 @@ HgfsWriteBegin(struct file *file, unsigned pageTo = pos + len; struct page *page; +/* + * AOP_FLAG_NOFS was defined in the same changeset that + * grab_cache_page_write_begin() was introduced. + */ +#ifdef AOP_FLAG_NOFS + page = grab_cache_page_write_begin(mapping, index, flags); +#else page = __grab_cache_page(mapping, index); +#endif if (page == NULL) { return -ENOMEM; }