]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ext2/inode.c
exec: remove unnecessary check for MNT_NOEXEC
[linux-2.6-omap-h63xx.git] / fs / ext2 / inode.c
index 0079b2cd5314bdebca35c89ab67dc90a637e5697..84818176fd9d58341a2613339f2123404237ff99 100644 (file)
@@ -642,18 +642,35 @@ ext2_readpages(struct file *file, struct address_space *mapping,
        return mpage_readpages(mapping, pages, nr_pages, ext2_get_block);
 }
 
+int __ext2_write_begin(struct file *file, struct address_space *mapping,
+               loff_t pos, unsigned len, unsigned flags,
+               struct page **pagep, void **fsdata)
+{
+       return block_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
+                                                       ext2_get_block);
+}
+
 static int
-ext2_prepare_write(struct file *file, struct page *page,
-                       unsigned from, unsigned to)
+ext2_write_begin(struct file *file, struct address_space *mapping,
+               loff_t pos, unsigned len, unsigned flags,
+               struct page **pagep, void **fsdata)
 {
-       return block_prepare_write(page,from,to,ext2_get_block);
+       *pagep = NULL;
+       return __ext2_write_begin(file, mapping, pos, len, flags, pagep,fsdata);
 }
 
 static int
-ext2_nobh_prepare_write(struct file *file, struct page *page,
-                       unsigned from, unsigned to)
+ext2_nobh_write_begin(struct file *file, struct address_space *mapping,
+               loff_t pos, unsigned len, unsigned flags,
+               struct page **pagep, void **fsdata)
 {
-       return nobh_prepare_write(page,from,to,ext2_get_block);
+       /*
+        * Dir-in-pagecache still uses ext2_write_begin. Would have to rework
+        * directory handling code to pass around offsets rather than struct
+        * pages in order to make this work easily.
+        */
+       return nobh_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
+                                                       ext2_get_block);
 }
 
 static int ext2_nobh_writepage(struct page *page,
@@ -689,8 +706,8 @@ const struct address_space_operations ext2_aops = {
        .readpages              = ext2_readpages,
        .writepage              = ext2_writepage,
        .sync_page              = block_sync_page,
-       .prepare_write          = ext2_prepare_write,
-       .commit_write           = generic_commit_write,
+       .write_begin            = ext2_write_begin,
+       .write_end              = generic_write_end,
        .bmap                   = ext2_bmap,
        .direct_IO              = ext2_direct_IO,
        .writepages             = ext2_writepages,
@@ -707,8 +724,8 @@ const struct address_space_operations ext2_nobh_aops = {
        .readpages              = ext2_readpages,
        .writepage              = ext2_nobh_writepage,
        .sync_page              = block_sync_page,
-       .prepare_write          = ext2_nobh_prepare_write,
-       .commit_write           = nobh_commit_write,
+       .write_begin            = ext2_nobh_write_begin,
+       .write_end              = nobh_write_end,
        .bmap                   = ext2_bmap,
        .direct_IO              = ext2_direct_IO,
        .writepages             = ext2_writepages,
@@ -925,7 +942,8 @@ void ext2_truncate (struct inode * inode)
        if (mapping_is_xip(inode->i_mapping))
                xip_truncate_page(inode->i_mapping, inode->i_size);
        else if (test_opt(inode->i_sb, NOBH))
-               nobh_truncate_page(inode->i_mapping, inode->i_size);
+               nobh_truncate_page(inode->i_mapping,
+                               inode->i_size, ext2_get_block);
        else
                block_truncate_page(inode->i_mapping,
                                inode->i_size, ext2_get_block);
@@ -1010,7 +1028,7 @@ static struct ext2_inode *ext2_get_inode(struct super_block *sb, ino_t ino,
                goto Einval;
 
        block_group = (ino - 1) / EXT2_INODES_PER_GROUP(sb);
-       gdp = ext2_get_group_desc(sb, block_group, &bh);
+       gdp = ext2_get_group_desc(sb, block_group, NULL);
        if (!gdp)
                goto Egdp;
        /*