]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/fat/inode.c
[PATCH] fat: add the read/writepages()
[karo-tx-linux.git] / fs / fat / inode.c
index a0f9b9fe1307addd7ba1bef750ab1fac49abfea7..f502c6b8cb4985d245a313882683641a1be28a5d 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/seq_file.h>
 #include <linux/msdos_fs.h>
 #include <linux/pagemap.h>
+#include <linux/mpage.h>
 #include <linux/buffer_head.h>
 #include <linux/mount.h>
 #include <linux/vfs.h>
@@ -90,9 +91,21 @@ static int fat_writepage(struct page *page, struct writeback_control *wbc)
        return block_write_full_page(page, fat_get_block, wbc);
 }
 
+static int fat_writepages(struct address_space *mapping,
+                         struct writeback_control *wbc)
+{
+       return mpage_writepages(mapping, wbc, fat_get_block);
+}
+
 static int fat_readpage(struct file *file, struct page *page)
 {
-       return block_read_full_page(page, fat_get_block);
+       return mpage_readpage(page, fat_get_block);
+}
+
+static int fat_readpages(struct file *file, struct address_space *mapping,
+                        struct list_head *pages, unsigned nr_pages)
+{
+       return mpage_readpages(mapping, pages, nr_pages, fat_get_block);
 }
 
 static int fat_prepare_write(struct file *file, struct page *page,
@@ -122,7 +135,9 @@ static sector_t _fat_bmap(struct address_space *mapping, sector_t block)
 
 static struct address_space_operations fat_aops = {
        .readpage       = fat_readpage,
+       .readpages      = fat_readpages,
        .writepage      = fat_writepage,
+       .writepages     = fat_writepages,
        .sync_page      = block_sync_page,
        .prepare_write  = fat_prepare_write,
        .commit_write   = fat_commit_write,
@@ -374,12 +389,17 @@ static void fat_clear_inode(struct inode *inode)
        unlock_kernel();
 }
 
-static void fat_put_super(struct super_block *sb)
+static void fat_write_super(struct super_block *sb)
 {
-       struct msdos_sb_info *sbi = MSDOS_SB(sb);
+       sb->s_dirt = 0;
 
        if (!(sb->s_flags & MS_RDONLY))
                fat_clusters_flush(sb);
+}
+
+static void fat_put_super(struct super_block *sb)
+{
+       struct msdos_sb_info *sbi = MSDOS_SB(sb);
 
        if (sbi->nls_disk) {
                unload_nls(sbi->nls_disk);
@@ -546,6 +566,7 @@ static struct super_operations fat_sops = {
        .write_inode    = fat_write_inode,
        .delete_inode   = fat_delete_inode,
        .put_super      = fat_put_super,
+       .write_super    = fat_write_super,
        .statfs         = fat_statfs,
        .clear_inode    = fat_clear_inode,
        .remount_fs     = fat_remount,