disk-io.c (6da6abae027e2dbc59bca5f4168b0760f25068c7) disk-io.c (1832a6d5ee3b1af61001cadba9e10da9e91af4a4)
1/*
2 * Copyright (C) 2007 Oracle. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 209 unchanged lines hidden (view full) ---

218 if (wbc->for_kupdate)
219 return 0;
220
221 if (current_is_pdflush()) {
222 thresh = 96 * 1024 * 1024;
223 } else {
224 thresh = 8 * 1024 * 1024;
225 }
1/*
2 * Copyright (C) 2007 Oracle. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 209 unchanged lines hidden (view full) ---

218 if (wbc->for_kupdate)
219 return 0;
220
221 if (current_is_pdflush()) {
222 thresh = 96 * 1024 * 1024;
223 } else {
224 thresh = 8 * 1024 * 1024;
225 }
226 num_dirty = count_range_bits(tree, &start, thresh, EXTENT_DIRTY);
226 num_dirty = count_range_bits(tree, &start, (u64)-1,
227 thresh, EXTENT_DIRTY);
227 if (num_dirty < thresh) {
228 return 0;
229 }
230 }
231 return extent_writepages(tree, mapping, btree_get_extent, wbc);
232}
233
234int btree_readpage(struct file *file, struct page *page)

--- 319 unchanged lines hidden (view full) ---

554 err = -ENOMEM;
555 goto fail;
556 }
557 INIT_RADIX_TREE(&fs_info->fs_roots_radix, GFP_NOFS);
558 INIT_LIST_HEAD(&fs_info->trans_list);
559 INIT_LIST_HEAD(&fs_info->dead_roots);
560 INIT_LIST_HEAD(&fs_info->hashers);
561 spin_lock_init(&fs_info->hash_lock);
228 if (num_dirty < thresh) {
229 return 0;
230 }
231 }
232 return extent_writepages(tree, mapping, btree_get_extent, wbc);
233}
234
235int btree_readpage(struct file *file, struct page *page)

--- 319 unchanged lines hidden (view full) ---

555 err = -ENOMEM;
556 goto fail;
557 }
558 INIT_RADIX_TREE(&fs_info->fs_roots_radix, GFP_NOFS);
559 INIT_LIST_HEAD(&fs_info->trans_list);
560 INIT_LIST_HEAD(&fs_info->dead_roots);
561 INIT_LIST_HEAD(&fs_info->hashers);
562 spin_lock_init(&fs_info->hash_lock);
563 spin_lock_init(&fs_info->delalloc_lock);
562
563 memset(&fs_info->super_kobj, 0, sizeof(fs_info->super_kobj));
564 init_completion(&fs_info->kobj_unregister);
565 sb_set_blocksize(sb, 4096);
566 fs_info->running_transaction = NULL;
567 fs_info->last_trans_committed = 0;
568 fs_info->tree_root = tree_root;
569 fs_info->extent_root = extent_root;
570 fs_info->sb = sb;
571 fs_info->mount_opt = 0;
572 fs_info->max_extent = (u64)-1;
564
565 memset(&fs_info->super_kobj, 0, sizeof(fs_info->super_kobj));
566 init_completion(&fs_info->kobj_unregister);
567 sb_set_blocksize(sb, 4096);
568 fs_info->running_transaction = NULL;
569 fs_info->last_trans_committed = 0;
570 fs_info->tree_root = tree_root;
571 fs_info->extent_root = extent_root;
572 fs_info->sb = sb;
573 fs_info->mount_opt = 0;
574 fs_info->max_extent = (u64)-1;
575 fs_info->delalloc_bytes = 0;
573 fs_info->btree_inode = new_inode(sb);
574 fs_info->btree_inode->i_ino = 1;
575 fs_info->btree_inode->i_nlink = 1;
576 fs_info->btree_inode->i_size = sb->s_bdev->bd_inode->i_size;
577 fs_info->btree_inode->i_mapping->a_ops = &btree_aops;
578 extent_map_tree_init(&BTRFS_I(fs_info->btree_inode)->extent_tree,
579 fs_info->btree_inode->i_mapping,
580 GFP_NOFS);

--- 316 unchanged lines hidden ---
576 fs_info->btree_inode = new_inode(sb);
577 fs_info->btree_inode->i_ino = 1;
578 fs_info->btree_inode->i_nlink = 1;
579 fs_info->btree_inode->i_size = sb->s_bdev->bd_inode->i_size;
580 fs_info->btree_inode->i_mapping->a_ops = &btree_aops;
581 extent_map_tree_init(&BTRFS_I(fs_info->btree_inode)->extent_tree,
582 fs_info->btree_inode->i_mapping,
583 GFP_NOFS);

--- 316 unchanged lines hidden ---