summaryrefslogtreecommitdiffstats
path: root/fs/fat/file.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-04 07:40:19 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-04 07:40:19 +0000
commit33263fc5f9ac8e8cb2b22d06af3ce5ac1dd815e4 (patch)
tree2d1b86a40bef0958a68cf1a2eafbeb0667a70543 /fs/fat/file.c
parent216f5f51aa02f8b113aa620ebc14a9631a217a00 (diff)
Merge with Linux 2.3.32.
Diffstat (limited to 'fs/fat/file.c')
-rw-r--r--fs/fat/file.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c
index 9c2c159cb..06da340fb 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -60,10 +60,8 @@ struct inode_operations fat_file_inode_operations = {
fat_get_block, /* get_block */
block_read_full_page, /* readpage */
NULL, /* writepage */
- block_flushpage, /* flushpage */
fat_truncate, /* truncate */
NULL, /* permission */
- NULL, /* smap */
NULL /* revalidate */
};
@@ -113,39 +111,23 @@ static int fat_write_partial_page(struct file *file, struct page *page, unsigned
{
struct dentry *dentry = file->f_dentry;
struct inode *inode = dentry->d_inode;
- struct page *new_page, **hash;
+ struct page *new_page;
unsigned long pgpos;
- struct page *page_cache = NULL;
long status;
- pgpos = MSDOS_I(inode)->i_realsize >> PAGE_CACHE_SHIFT;
- while (pgpos < page->index) {
- hash = page_hash(&inode->i_data, pgpos);
-repeat_find: new_page = __find_lock_page(&inode->i_data, pgpos, hash);
- if (!new_page) {
- if (!page_cache) {
- page_cache = page_cache_alloc();
- if (page_cache)
- goto repeat_find;
- status = -ENOMEM;
- goto out;
- }
- new_page = page_cache;
- if (add_to_page_cache_unique(new_page,&inode->i_data,pgpos,hash))
- goto repeat_find;
- page_cache = NULL;
- }
+ while((pgpos=MSDOS_I(inode)->i_realsize>>PAGE_CACHE_SHIFT)<page->index){
+ status = -ENOMEM;
+ new_page = grab_cache_page(&inode->i_data, pgpos);
+ if (!new_page)
+ goto out;
status = block_write_cont_page(file, new_page, PAGE_SIZE, 0, NULL);
UnlockPage(new_page);
page_cache_release(new_page);
if (status < 0)
goto out;
- pgpos = MSDOS_I(inode)->i_realsize >> PAGE_CACHE_SHIFT;
}
status = block_write_cont_page(file, page, offset, bytes, buf);
out:
- if (page_cache)
- page_cache_free(page_cache);
return status;
}