diff options
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index cfc0ab915d03..c9005f216975 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -103,7 +103,7 @@ static void __btrfs_add_inode_defrag(struct inode *inode, | |||
103 | goto exists; | 103 | goto exists; |
104 | } | 104 | } |
105 | } | 105 | } |
106 | BTRFS_I(inode)->in_defrag = 1; | 106 | set_bit(BTRFS_INODE_IN_DEFRAG, &BTRFS_I(inode)->runtime_flags); |
107 | rb_link_node(&defrag->rb_node, parent, p); | 107 | rb_link_node(&defrag->rb_node, parent, p); |
108 | rb_insert_color(&defrag->rb_node, &root->fs_info->defrag_inodes); | 108 | rb_insert_color(&defrag->rb_node, &root->fs_info->defrag_inodes); |
109 | return; | 109 | return; |
@@ -131,7 +131,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, | |||
131 | if (btrfs_fs_closing(root->fs_info)) | 131 | if (btrfs_fs_closing(root->fs_info)) |
132 | return 0; | 132 | return 0; |
133 | 133 | ||
134 | if (BTRFS_I(inode)->in_defrag) | 134 | if (test_bit(BTRFS_INODE_IN_DEFRAG, &BTRFS_I(inode)->runtime_flags)) |
135 | return 0; | 135 | return 0; |
136 | 136 | ||
137 | if (trans) | 137 | if (trans) |
@@ -148,7 +148,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, | |||
148 | defrag->root = root->root_key.objectid; | 148 | defrag->root = root->root_key.objectid; |
149 | 149 | ||
150 | spin_lock(&root->fs_info->defrag_inodes_lock); | 150 | spin_lock(&root->fs_info->defrag_inodes_lock); |
151 | if (!BTRFS_I(inode)->in_defrag) | 151 | if (!test_bit(BTRFS_INODE_IN_DEFRAG, &BTRFS_I(inode)->runtime_flags)) |
152 | __btrfs_add_inode_defrag(inode, defrag); | 152 | __btrfs_add_inode_defrag(inode, defrag); |
153 | else | 153 | else |
154 | kfree(defrag); | 154 | kfree(defrag); |
@@ -252,7 +252,7 @@ int btrfs_run_defrag_inodes(struct btrfs_fs_info *fs_info) | |||
252 | goto next; | 252 | goto next; |
253 | 253 | ||
254 | /* do a chunk of defrag */ | 254 | /* do a chunk of defrag */ |
255 | BTRFS_I(inode)->in_defrag = 0; | 255 | clear_bit(BTRFS_INODE_IN_DEFRAG, &BTRFS_I(inode)->runtime_flags); |
256 | range.start = defrag->last_offset; | 256 | range.start = defrag->last_offset; |
257 | num_defrag = btrfs_defrag_file(inode, NULL, &range, defrag->transid, | 257 | num_defrag = btrfs_defrag_file(inode, NULL, &range, defrag->transid, |
258 | defrag_batch); | 258 | defrag_batch); |
@@ -1465,8 +1465,8 @@ int btrfs_release_file(struct inode *inode, struct file *filp) | |||
1465 | * flush down new bytes that may have been written if the | 1465 | * flush down new bytes that may have been written if the |
1466 | * application were using truncate to replace a file in place. | 1466 | * application were using truncate to replace a file in place. |
1467 | */ | 1467 | */ |
1468 | if (BTRFS_I(inode)->ordered_data_close) { | 1468 | if (test_and_clear_bit(BTRFS_INODE_ORDERED_DATA_CLOSE, |
1469 | BTRFS_I(inode)->ordered_data_close = 0; | 1469 | &BTRFS_I(inode)->runtime_flags)) { |
1470 | btrfs_add_ordered_operation(NULL, BTRFS_I(inode)->root, inode); | 1470 | btrfs_add_ordered_operation(NULL, BTRFS_I(inode)->root, inode); |
1471 | if (inode->i_size > BTRFS_ORDERED_OPERATIONS_FLUSH_LIMIT) | 1471 | if (inode->i_size > BTRFS_ORDERED_OPERATIONS_FLUSH_LIMIT) |
1472 | filemap_flush(inode->i_mapping); | 1472 | filemap_flush(inode->i_mapping); |