~ubuntu-branches/ubuntu/precise/linux-lowlatency/precise-proposed

« back to all changes in this revision

Viewing changes to fs/ext4/inode.c

  • Committer: Package Import Robot
  • Author(s): Luke Yelavich, Luke Yelavich, Upstream Kernel Changes
  • Date: 2012-04-04 18:49:36 UTC
  • Revision ID: package-import@ubuntu.com-20120404184936-tqu735914muv4wpg
Tags: 3.2.0-22.30
[ Luke Yelavich ]

* [Config] Update configs after rebase against Ubuntu-3.2.0-22.35

[ Upstream Kernel Changes ]

* Low-latency: Rebase against Ubuntu-3.2.0-22.35

Show diffs side-by-side

added added

removed removed

Lines of Context:
2480
2480
        int write_mode = (int)(unsigned long)fsdata;
2481
2481
 
2482
2482
        if (write_mode == FALL_BACK_TO_NONDELALLOC) {
2483
 
                if (ext4_should_order_data(inode)) {
 
2483
                switch (ext4_inode_journal_mode(inode)) {
 
2484
                case EXT4_INODE_ORDERED_DATA_MODE:
2484
2485
                        return ext4_ordered_write_end(file, mapping, pos,
2485
2486
                                        len, copied, page, fsdata);
2486
 
                } else if (ext4_should_writeback_data(inode)) {
 
2487
                case EXT4_INODE_WRITEBACK_DATA_MODE:
2487
2488
                        return ext4_writeback_write_end(file, mapping, pos,
2488
2489
                                        len, copied, page, fsdata);
2489
 
                } else {
 
2490
                default:
2490
2491
                        BUG();
2491
2492
                }
2492
2493
        }
2793
2794
 
2794
2795
        /* queue the work to convert unwritten extents to written */
2795
2796
        queue_work(wq, &io_end->work);
2796
 
 
2797
 
        /* XXX: probably should move into the real I/O completion handler */
2798
 
        inode_dio_done(inode);
2799
2797
}
2800
2798
 
2801
2799
static void ext4_end_io_buffer_write(struct buffer_head *bh, int uptodate)
2919
2917
                iocb->private = NULL;
2920
2918
                EXT4_I(inode)->cur_aio_dio = NULL;
2921
2919
                if (!is_sync_kiocb(iocb)) {
2922
 
                        iocb->private = ext4_init_io_end(inode, GFP_NOFS);
2923
 
                        if (!iocb->private)
 
2920
                        ext4_io_end_t *io_end =
 
2921
                                ext4_init_io_end(inode, GFP_NOFS);
 
2922
                        if (!io_end)
2924
2923
                                return -ENOMEM;
 
2924
                        io_end->flag |= EXT4_IO_END_DIRECT;
 
2925
                        iocb->private = io_end;
2925
2926
                        /*
2926
2927
                         * we save the io structure for current async
2927
2928
                         * direct IO, so that later ext4_map_blocks()
3084
3085
 
3085
3086
void ext4_set_aops(struct inode *inode)
3086
3087
{
3087
 
        if (ext4_should_order_data(inode) &&
3088
 
                test_opt(inode->i_sb, DELALLOC))
3089
 
                inode->i_mapping->a_ops = &ext4_da_aops;
3090
 
        else if (ext4_should_order_data(inode))
3091
 
                inode->i_mapping->a_ops = &ext4_ordered_aops;
3092
 
        else if (ext4_should_writeback_data(inode) &&
3093
 
                 test_opt(inode->i_sb, DELALLOC))
3094
 
                inode->i_mapping->a_ops = &ext4_da_aops;
3095
 
        else if (ext4_should_writeback_data(inode))
3096
 
                inode->i_mapping->a_ops = &ext4_writeback_aops;
3097
 
        else
 
3088
        switch (ext4_inode_journal_mode(inode)) {
 
3089
        case EXT4_INODE_ORDERED_DATA_MODE:
 
3090
                if (test_opt(inode->i_sb, DELALLOC))
 
3091
                        inode->i_mapping->a_ops = &ext4_da_aops;
 
3092
                else
 
3093
                        inode->i_mapping->a_ops = &ext4_ordered_aops;
 
3094
                break;
 
3095
        case EXT4_INODE_WRITEBACK_DATA_MODE:
 
3096
                if (test_opt(inode->i_sb, DELALLOC))
 
3097
                        inode->i_mapping->a_ops = &ext4_da_aops;
 
3098
                else
 
3099
                        inode->i_mapping->a_ops = &ext4_writeback_aops;
 
3100
                break;
 
3101
        case EXT4_INODE_JOURNAL_DATA_MODE:
3098
3102
                inode->i_mapping->a_ops = &ext4_journalled_aops;
 
3103
                break;
 
3104
        default:
 
3105
                BUG();
 
3106
        }
3099
3107
}
3100
3108
 
3101
3109