patch-2.3.9 linux/fs/minix/file.c

Next file: linux/fs/minix/fsync.c
Previous file: linux/fs/minix/dir.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.8/linux/fs/minix/file.c linux/fs/minix/file.c
@@ -27,50 +27,14 @@
 #include <linux/fs.h>
 #include <linux/minix_fs.h>
 
-static int minix_writepage(struct file *file, struct page *page)
-{
-	struct dentry *dentry = file->f_dentry;
-	struct inode *inode = dentry->d_inode;
-	unsigned long block;
-	int *p, nr[PAGE_SIZE/BLOCK_SIZE];
-	int i, err, created;
-	struct buffer_head *bh;
-
-	i = PAGE_SIZE / BLOCK_SIZE;
-	block = page->offset / BLOCK_SIZE;
-	p = nr;
-	bh = page->buffers;
-	do {
-		if (bh && bh->b_blocknr)
-			*p = bh->b_blocknr;
-		else
-			*p = minix_getblk_block(inode, block, 1, &err, &created);
-		if (!*p)
-			return -EIO;
-		i--;
-		block++;
-		p++;
-		if (bh)
-			bh = bh->b_this_page;
-	} while(i > 0);
-
-	/* IO start */
-	brw_page(WRITE, page, inode->i_dev, nr, BLOCK_SIZE, 1);
-	return 0;
-}
-
-static long minix_write_one_page(struct file *file, struct page *page, unsigned long offset, unsigned long bytes, const char *buf)
-{
-	return block_write_one_page(file, page, offset, bytes, buf, minix_getblk_block);
-}
-
 /*
  * Write to a file (through the page cache).
  */
 static ssize_t
 minix_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
 {
-	return generic_file_write(file, buf, count, ppos, minix_write_one_page);
+	return generic_file_write(file, buf, count,
+				  ppos, block_write_partial_page);
 }
 
 /*
@@ -88,7 +52,10 @@
 	NULL,			/* no special open is needed */
 	NULL,			/* flush */
 	NULL,			/* release */
-	minix_sync_file		/* fsync */
+	minix_sync_file,	/* fsync */
+	NULL,			/* fasync */
+	NULL,			/* check_media_change */
+	NULL			/* revalidate */
 };
 
 struct inode_operations minix_file_inode_operations = {
@@ -104,12 +71,12 @@
 	NULL,			/* rename */
 	NULL,			/* readlink */
 	NULL,			/* follow_link */
-	generic_readpage,	/* readpage */
-	minix_writepage,	/* writepage */
-	minix_bmap,		/* bmap */
+	minix_get_block,	/* get_block */
+	block_read_full_page,	/* readpage */
+	block_write_full_page,	/* writepage */
+	block_flushpage,	/* flushpage */
 	minix_truncate,		/* truncate */
 	NULL,			/* permission */
 	NULL,			/* smap */
 	NULL,			/* revalidate */
-	block_flushpage,	/* flushpage */
 };

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)