aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-03-26 10:28:07 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:01 -0400
commit04160088141a6be06d5cb9e53e34076b51803ffc (patch)
tree8dc407b1fe8fced2588121e8d58450f3a8ed8807 /fs/btrfs/inode.c
parent593060d756e0c2382d59cf00d5f3b9e3a336c408 (diff)
Create a btrfs backing dev info
This allows intelligent versions of unplug and congestion functions Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index db60d85598ce..0fa7cf227f1a 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -494,6 +494,7 @@ void btrfs_read_locked_inode(struct inode *inode)
494 switch (inode->i_mode & S_IFMT) { 494 switch (inode->i_mode & S_IFMT) {
495 case S_IFREG: 495 case S_IFREG:
496 inode->i_mapping->a_ops = &btrfs_aops; 496 inode->i_mapping->a_ops = &btrfs_aops;
497 inode->i_mapping->backing_dev_info = &root->fs_info->bdi;
497 BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; 498 BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops;
498 inode->i_fop = &btrfs_file_operations; 499 inode->i_fop = &btrfs_file_operations;
499 inode->i_op = &btrfs_file_inode_operations; 500 inode->i_op = &btrfs_file_inode_operations;
@@ -508,6 +509,7 @@ void btrfs_read_locked_inode(struct inode *inode)
508 case S_IFLNK: 509 case S_IFLNK:
509 inode->i_op = &btrfs_symlink_inode_operations; 510 inode->i_op = &btrfs_symlink_inode_operations;
510 inode->i_mapping->a_ops = &btrfs_symlink_aops; 511 inode->i_mapping->a_ops = &btrfs_symlink_aops;
512 inode->i_mapping->backing_dev_info = &root->fs_info->bdi;
511 break; 513 break;
512 default: 514 default:
513 init_special_inode(inode, inode->i_mode, rdev); 515 init_special_inode(inode, inode->i_mode, rdev);
@@ -1792,6 +1794,7 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry,
1792 drop_inode = 1; 1794 drop_inode = 1;
1793 else { 1795 else {
1794 inode->i_mapping->a_ops = &btrfs_aops; 1796 inode->i_mapping->a_ops = &btrfs_aops;
1797 inode->i_mapping->backing_dev_info = &root->fs_info->bdi;
1795 inode->i_fop = &btrfs_file_operations; 1798 inode->i_fop = &btrfs_file_operations;
1796 inode->i_op = &btrfs_file_inode_operations; 1799 inode->i_op = &btrfs_file_inode_operations;
1797 extent_map_tree_init(&BTRFS_I(inode)->extent_tree, GFP_NOFS); 1800 extent_map_tree_init(&BTRFS_I(inode)->extent_tree, GFP_NOFS);
@@ -2960,6 +2963,7 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
2960 drop_inode = 1; 2963 drop_inode = 1;
2961 else { 2964 else {
2962 inode->i_mapping->a_ops = &btrfs_aops; 2965 inode->i_mapping->a_ops = &btrfs_aops;
2966 inode->i_mapping->backing_dev_info = &root->fs_info->bdi;
2963 inode->i_fop = &btrfs_file_operations; 2967 inode->i_fop = &btrfs_file_operations;
2964 inode->i_op = &btrfs_file_inode_operations; 2968 inode->i_op = &btrfs_file_inode_operations;
2965 extent_map_tree_init(&BTRFS_I(inode)->extent_tree, GFP_NOFS); 2969 extent_map_tree_init(&BTRFS_I(inode)->extent_tree, GFP_NOFS);
@@ -2999,6 +3003,7 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
2999 3003
3000 inode->i_op = &btrfs_symlink_inode_operations; 3004 inode->i_op = &btrfs_symlink_inode_operations;
3001 inode->i_mapping->a_ops = &btrfs_symlink_aops; 3005 inode->i_mapping->a_ops = &btrfs_symlink_aops;
3006 inode->i_mapping->backing_dev_info = &root->fs_info->bdi;
3002 inode->i_size = name_len - 1; 3007 inode->i_size = name_len - 1;
3003 err = btrfs_update_inode(trans, root, inode); 3008 err = btrfs_update_inode(trans, root, inode);
3004 if (err) 3009 if (err)