summaryrefslogtreecommitdiffstats
path: root/fs/fat/file.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-23 00:40:54 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-23 00:40:54 +0000
commit529c593ece216e4aaffd36bd940cb94f1fa63129 (patch)
tree78f1c0b805f5656aa7b0417a043c5346f700a2cf /fs/fat/file.c
parent0bd079751d25808d1972baee5c4eaa1db2227257 (diff)
Merge with 2.3.43. I did ignore all modifications to the qlogicisp.c
driver due to the Origin A64 hacks.
Diffstat (limited to 'fs/fat/file.c')
-rw-r--r--fs/fat/file.c53
1 files changed, 8 insertions, 45 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c
index 06da340fb..0c535b8da 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -31,17 +31,10 @@
#define Printk(x) printk x
static struct file_operations fat_file_operations = {
- NULL, /* lseek - default */
- fat_file_read, /* read */
- fat_file_write, /* write */
- NULL, /* readdir - bad */
- NULL, /* select v2.0.x/poll v2.1.x - default */
- NULL, /* ioctl - default */
- generic_file_mmap, /* mmap */
- NULL, /* no special open is needed */
- NULL, /* flush */
- NULL, /* release */
- file_fsync /* fsync */
+ read: fat_file_read,
+ write: fat_file_write,
+ mmap: generic_file_mmap,
+ fsync: file_fsync,
};
struct inode_operations fat_file_inode_operations = {
@@ -57,12 +50,7 @@ struct inode_operations fat_file_inode_operations = {
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
- fat_get_block, /* get_block */
- block_read_full_page, /* readpage */
- NULL, /* writepage */
fat_truncate, /* truncate */
- NULL, /* permission */
- NULL /* revalidate */
};
ssize_t fat_file_read(
@@ -88,7 +76,7 @@ int fat_get_block(struct inode *inode, long iblock, struct buffer_head *bh_resul
}
if (!create)
return 0;
- if (iblock<<9 != MSDOS_I(inode)->i_realsize) {
+ if (iblock<<9 != MSDOS_I(inode)->mmu_private) {
BUG();
return -EIO;
}
@@ -96,7 +84,7 @@ int fat_get_block(struct inode *inode, long iblock, struct buffer_head *bh_resul
if (fat_add_cluster(inode))
return -ENOSPC;
}
- MSDOS_I(inode)->i_realsize+=SECTOR_SIZE;
+ MSDOS_I(inode)->mmu_private += 512;
phys=fat_bmap(inode, iblock);
if (!phys)
BUG();
@@ -107,30 +95,6 @@ int fat_get_block(struct inode *inode, long iblock, struct buffer_head *bh_resul
return 0;
}
-static int fat_write_partial_page(struct file *file, struct page *page, unsigned long offset, unsigned long bytes, const char * buf)
-{
- struct dentry *dentry = file->f_dentry;
- struct inode *inode = dentry->d_inode;
- struct page *new_page;
- unsigned long pgpos;
- long status;
-
- 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;
- }
- status = block_write_cont_page(file, page, offset, bytes, buf);
-out:
- return status;
-}
-
ssize_t fat_file_write(
struct file *filp,
const char *buf,
@@ -152,8 +116,7 @@ ssize_t default_fat_file_write(
struct inode *inode = filp->f_dentry->d_inode;
int retval;
- retval = generic_file_write(filp, buf, count, ppos,
- fat_write_partial_page);
+ retval = generic_file_write(filp, buf, count, ppos);
if (retval > 0) {
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
MSDOS_I(inode)->i_attrs |= ATTR_ARCH;
@@ -173,7 +136,7 @@ void fat_truncate(struct inode *inode)
if (IS_IMMUTABLE(inode))
return /* -EPERM */;
cluster = SECTOR_SIZE*sbi->cluster_size;
- MSDOS_I(inode)->i_realsize = ((inode->i_size-1) | (SECTOR_SIZE-1)) + 1;
+ MSDOS_I(inode)->mmu_private = inode->i_size;
fat_free(inode,(inode->i_size+(cluster-1))>>sbi->cluster_bits);
MSDOS_I(inode)->i_attrs |= ATTR_ARCH;
inode->i_ctime = inode->i_mtime = CURRENT_TIME;