Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[linux-2.6-microblaze.git] / fs / ext4 / inode.c
index 4356ef6..b54b261 100644 (file)
@@ -391,7 +391,7 @@ void ext4_da_update_reserve_space(struct inode *inode,
         * inode's preallocations.
         */
        if ((ei->i_reserved_data_blocks == 0) &&
-           (atomic_read(&inode->i_writecount) == 0))
+           !inode_is_open_for_write(inode))
                ext4_discard_preallocations(inode);
 }
 
@@ -678,8 +678,6 @@ found:
                if (flags & EXT4_GET_BLOCKS_ZERO &&
                    map->m_flags & EXT4_MAP_MAPPED &&
                    map->m_flags & EXT4_MAP_NEW) {
-                       clean_bdev_aliases(inode->i_sb->s_bdev, map->m_pblk,
-                                          map->m_len);
                        ret = ext4_issue_zeroout(inode, map->m_lblk,
                                                 map->m_pblk, map->m_len);
                        if (ret) {
@@ -1194,7 +1192,6 @@ static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len,
                        if (err)
                                break;
                        if (buffer_new(bh)) {
-                               clean_bdev_bh_alias(bh);
                                if (PageUptodate(page)) {
                                        clear_buffer_new(bh);
                                        set_buffer_uptodate(bh);
@@ -2489,10 +2486,6 @@ static int mpage_map_one_extent(handle_t *handle, struct mpage_da_data *mpd)
        }
 
        BUG_ON(map->m_len == 0);
-       if (map->m_flags & EXT4_MAP_NEW) {
-               clean_bdev_aliases(inode->i_sb->s_bdev, map->m_pblk,
-                                  map->m_len);
-       }
        return 0;
 }
 
@@ -2835,12 +2828,12 @@ retry:
                goto unplug;
        }
        ret = mpage_prepare_extent_to_map(&mpd);
+       /* Unlock pages we didn't use */
+       mpage_release_unused_pages(&mpd, false);
        /* Submit prepared bio */
        ext4_io_submit(&mpd.io_submit);
        ext4_put_io_end_defer(mpd.io_submit.io_end);
        mpd.io_submit.io_end = NULL;
-       /* Unlock pages we didn't use */
-       mpage_release_unused_pages(&mpd, false);
        if (ret < 0)
                goto unplug;
 
@@ -2908,10 +2901,11 @@ retry:
                        handle = NULL;
                        mpd.do_map = 0;
                }
-               /* Submit prepared bio */
-               ext4_io_submit(&mpd.io_submit);
                /* Unlock pages we didn't use */
                mpage_release_unused_pages(&mpd, give_up_on_write);
+               /* Submit prepared bio */
+               ext4_io_submit(&mpd.io_submit);
+
                /*
                 * Drop our io_end reference we got from init. We have
                 * to be careful and use deferred io_end finishing if
@@ -5349,7 +5343,6 @@ static int ext4_do_update_inode(handle_t *handle,
                err = ext4_journal_get_write_access(handle, EXT4_SB(sb)->s_sbh);
                if (err)
                        goto out_brelse;
-               ext4_update_dynamic_rev(sb);
                ext4_set_feature_large_file(sb);
                ext4_handle_sync(handle);
                err = ext4_handle_dirty_super(handle, sb);
@@ -6000,7 +5993,7 @@ int ext4_expand_extra_isize(struct inode *inode,
 
        ext4_write_lock_xattr(inode, &no_expand);
 
-       BUFFER_TRACE(iloc.bh, "get_write_access");
+       BUFFER_TRACE(iloc->bh, "get_write_access");
        error = ext4_journal_get_write_access(handle, iloc->bh);
        if (error) {
                brelse(iloc->bh);