aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2012-08-29 12:24:27 -0400
committerChris Mason <chris.mason@fusionio.com>2012-10-01 15:19:06 -0400
commit2671485d395c07fca104c972785898d7c52fc942 (patch)
treed87e1fa2265155c05718a9e8486a66a76df86b76 /fs
parentd2794405113cd04f13a58e32e4d541dc87ec86e4 (diff)
Btrfs: remove unused hint byte argument for btrfs_drop_extents
I audited all users of btrfs_drop_extents and found that nobody actually uses the hint_byte argument. I'm sure it was used for something at some point but it's not used now, and the way the pinning works the disk bytenr would never be immediately useful anyway so lets just remove it. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/ctree.h4
-rw-r--r--fs/btrfs/file.c16
-rw-r--r--fs/btrfs/inode.c12
-rw-r--r--fs/btrfs/ioctl.c5
-rw-r--r--fs/btrfs/tree-log.c7
5 files changed, 14 insertions, 30 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 81c772b5dc8e..71d6ff13d76e 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3323,10 +3323,10 @@ extern const struct file_operations btrfs_file_operations;
3323int __btrfs_drop_extents(struct btrfs_trans_handle *trans, 3323int __btrfs_drop_extents(struct btrfs_trans_handle *trans,
3324 struct btrfs_root *root, struct inode *inode, 3324 struct btrfs_root *root, struct inode *inode,
3325 struct btrfs_path *path, u64 start, u64 end, 3325 struct btrfs_path *path, u64 start, u64 end,
3326 u64 *hint_byte, int drop_cache); 3326 int drop_cache);
3327int btrfs_drop_extents(struct btrfs_trans_handle *trans, 3327int btrfs_drop_extents(struct btrfs_trans_handle *trans,
3328 struct btrfs_root *root, struct inode *inode, u64 start, 3328 struct btrfs_root *root, struct inode *inode, u64 start,
3329 u64 end, u64 *hint_byte, int drop_cache); 3329 u64 end, int drop_cache);
3330int btrfs_mark_extent_written(struct btrfs_trans_handle *trans, 3330int btrfs_mark_extent_written(struct btrfs_trans_handle *trans,
3331 struct inode *inode, u64 start, u64 end); 3331 struct inode *inode, u64 start, u64 end);
3332int btrfs_release_file(struct inode *inode, struct file *file); 3332int btrfs_release_file(struct inode *inode, struct file *file);
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 399f9d71a926..58598c249951 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -584,7 +584,7 @@ int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end,
584int __btrfs_drop_extents(struct btrfs_trans_handle *trans, 584int __btrfs_drop_extents(struct btrfs_trans_handle *trans,
585 struct btrfs_root *root, struct inode *inode, 585 struct btrfs_root *root, struct inode *inode,
586 struct btrfs_path *path, u64 start, u64 end, 586 struct btrfs_path *path, u64 start, u64 end,
587 u64 *hint_byte, int drop_cache) 587 int drop_cache)
588{ 588{
589 struct extent_buffer *leaf; 589 struct extent_buffer *leaf;
590 struct btrfs_file_extent_item *fi; 590 struct btrfs_file_extent_item *fi;
@@ -716,7 +716,6 @@ next_slot:
716 new_key.objectid, 716 new_key.objectid,
717 start - extent_offset, 0); 717 start - extent_offset, 0);
718 BUG_ON(ret); /* -ENOMEM */ 718 BUG_ON(ret); /* -ENOMEM */
719 *hint_byte = disk_bytenr;
720 } 719 }
721 key.offset = start; 720 key.offset = start;
722 } 721 }
@@ -736,10 +735,8 @@ next_slot:
736 btrfs_set_file_extent_num_bytes(leaf, fi, 735 btrfs_set_file_extent_num_bytes(leaf, fi,
737 extent_end - end); 736 extent_end - end);
738 btrfs_mark_buffer_dirty(leaf); 737 btrfs_mark_buffer_dirty(leaf);
739 if (update_refs && disk_bytenr > 0) { 738 if (update_refs && disk_bytenr > 0)
740 inode_sub_bytes(inode, end - key.offset); 739 inode_sub_bytes(inode, end - key.offset);
741 *hint_byte = disk_bytenr;
742 }
743 break; 740 break;
744 } 741 }
745 742
@@ -755,10 +752,8 @@ next_slot:
755 btrfs_set_file_extent_num_bytes(leaf, fi, 752 btrfs_set_file_extent_num_bytes(leaf, fi,
756 start - key.offset); 753 start - key.offset);
757 btrfs_mark_buffer_dirty(leaf); 754 btrfs_mark_buffer_dirty(leaf);
758 if (update_refs && disk_bytenr > 0) { 755 if (update_refs && disk_bytenr > 0)
759 inode_sub_bytes(inode, extent_end - start); 756 inode_sub_bytes(inode, extent_end - start);
760 *hint_byte = disk_bytenr;
761 }
762 if (end == extent_end) 757 if (end == extent_end)
763 break; 758 break;
764 759
@@ -794,7 +789,6 @@ next_slot:
794 BUG_ON(ret); /* -ENOMEM */ 789 BUG_ON(ret); /* -ENOMEM */
795 inode_sub_bytes(inode, 790 inode_sub_bytes(inode,
796 extent_end - key.offset); 791 extent_end - key.offset);
797 *hint_byte = disk_bytenr;
798 } 792 }
799 793
800 if (end == extent_end) 794 if (end == extent_end)
@@ -834,7 +828,7 @@ next_slot:
834 828
835int btrfs_drop_extents(struct btrfs_trans_handle *trans, 829int btrfs_drop_extents(struct btrfs_trans_handle *trans,
836 struct btrfs_root *root, struct inode *inode, u64 start, 830 struct btrfs_root *root, struct inode *inode, u64 start,
837 u64 end, u64 *hint_byte, int drop_cache) 831 u64 end, int drop_cache)
838{ 832{
839 struct btrfs_path *path; 833 struct btrfs_path *path;
840 int ret; 834 int ret;
@@ -843,7 +837,7 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans,
843 if (!path) 837 if (!path)
844 return -ENOMEM; 838 return -ENOMEM;
845 ret = __btrfs_drop_extents(trans, root, inode, path, start, end, 839 ret = __btrfs_drop_extents(trans, root, inode, path, start, end,
846 hint_byte, drop_cache); 840 drop_cache);
847 btrfs_free_path(path); 841 btrfs_free_path(path);
848 return ret; 842 return ret;
849} 843}
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 24745b8f2745..f0a4792492ed 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -230,7 +230,6 @@ static noinline int cow_file_range_inline(struct btrfs_trans_handle *trans,
230 u64 inline_len = actual_end - start; 230 u64 inline_len = actual_end - start;
231 u64 aligned_end = (end + root->sectorsize - 1) & 231 u64 aligned_end = (end + root->sectorsize - 1) &
232 ~((u64)root->sectorsize - 1); 232 ~((u64)root->sectorsize - 1);
233 u64 hint_byte;
234 u64 data_len = inline_len; 233 u64 data_len = inline_len;
235 int ret; 234 int ret;
236 235
@@ -247,8 +246,7 @@ static noinline int cow_file_range_inline(struct btrfs_trans_handle *trans,
247 return 1; 246 return 1;
248 } 247 }
249 248
250 ret = btrfs_drop_extents(trans, root, inode, start, aligned_end, 249 ret = btrfs_drop_extents(trans, root, inode, start, aligned_end, 1);
251 &hint_byte, 1);
252 if (ret) 250 if (ret)
253 return ret; 251 return ret;
254 252
@@ -1786,7 +1784,6 @@ static int insert_reserved_file_extent(struct btrfs_trans_handle *trans,
1786 struct btrfs_path *path; 1784 struct btrfs_path *path;
1787 struct extent_buffer *leaf; 1785 struct extent_buffer *leaf;
1788 struct btrfs_key ins; 1786 struct btrfs_key ins;
1789 u64 hint;
1790 int ret; 1787 int ret;
1791 1788
1792 path = btrfs_alloc_path(); 1789 path = btrfs_alloc_path();
@@ -1805,8 +1802,7 @@ static int insert_reserved_file_extent(struct btrfs_trans_handle *trans,
1805 * with the others. 1802 * with the others.
1806 */ 1803 */
1807 ret = btrfs_drop_extents(trans, root, inode, file_pos, 1804 ret = btrfs_drop_extents(trans, root, inode, file_pos,
1808 file_pos + num_bytes, 1805 file_pos + num_bytes, 0);
1809 &hint, 0);
1810 if (ret) 1806 if (ret)
1811 goto out; 1807 goto out;
1812 1808
@@ -3629,7 +3625,6 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size)
3629 last_byte = (last_byte + mask) & ~mask; 3625 last_byte = (last_byte + mask) & ~mask;
3630 if (!test_bit(EXTENT_FLAG_PREALLOC, &em->flags)) { 3626 if (!test_bit(EXTENT_FLAG_PREALLOC, &em->flags)) {
3631 struct extent_map *hole_em; 3627 struct extent_map *hole_em;
3632 u64 hint_byte = 0;
3633 hole_size = last_byte - cur_offset; 3628 hole_size = last_byte - cur_offset;
3634 3629
3635 trans = btrfs_start_transaction(root, 3); 3630 trans = btrfs_start_transaction(root, 3);
@@ -3640,8 +3635,7 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size)
3640 3635
3641 err = btrfs_drop_extents(trans, root, inode, 3636 err = btrfs_drop_extents(trans, root, inode,
3642 cur_offset, 3637 cur_offset,
3643 cur_offset + hole_size, 3638 cur_offset + hole_size, 1);
3644 &hint_byte, 1);
3645 if (err) { 3639 if (err) {
3646 btrfs_abort_transaction(trans, root, err); 3640 btrfs_abort_transaction(trans, root, err);
3647 btrfs_end_transaction(trans, root); 3641 btrfs_end_transaction(trans, root);
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 95223222d5ad..5543fd562b55 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2353,7 +2353,6 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
2353 int ret; 2353 int ret;
2354 u64 len = olen; 2354 u64 len = olen;
2355 u64 bs = root->fs_info->sb->s_blocksize; 2355 u64 bs = root->fs_info->sb->s_blocksize;
2356 u64 hint_byte;
2357 2356
2358 /* 2357 /*
2359 * TODO: 2358 * TODO:
@@ -2579,7 +2578,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
2579 ret = btrfs_drop_extents(trans, root, inode, 2578 ret = btrfs_drop_extents(trans, root, inode,
2580 new_key.offset, 2579 new_key.offset,
2581 new_key.offset + datal, 2580 new_key.offset + datal,
2582 &hint_byte, 1); 2581 1);
2583 if (ret) { 2582 if (ret) {
2584 btrfs_abort_transaction(trans, root, 2583 btrfs_abort_transaction(trans, root,
2585 ret); 2584 ret);
@@ -2653,7 +2652,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
2653 ret = btrfs_drop_extents(trans, root, inode, 2652 ret = btrfs_drop_extents(trans, root, inode,
2654 new_key.offset, 2653 new_key.offset,
2655 new_key.offset + datal, 2654 new_key.offset + datal,
2656 &hint_byte, 1); 2655 1);
2657 if (ret) { 2656 if (ret) {
2658 btrfs_abort_transaction(trans, root, 2657 btrfs_abort_transaction(trans, root,
2659 ret); 2658 ret);
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 5e2ffb95cc64..0c39f58973db 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -485,7 +485,6 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
485 int found_type; 485 int found_type;
486 u64 mask = root->sectorsize - 1; 486 u64 mask = root->sectorsize - 1;
487 u64 extent_end; 487 u64 extent_end;
488 u64 alloc_hint;
489 u64 start = key->offset; 488 u64 start = key->offset;
490 u64 saved_nbytes; 489 u64 saved_nbytes;
491 struct btrfs_file_extent_item *item; 490 struct btrfs_file_extent_item *item;
@@ -551,8 +550,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
551 550
552 saved_nbytes = inode_get_bytes(inode); 551 saved_nbytes = inode_get_bytes(inode);
553 /* drop any overlapping extents */ 552 /* drop any overlapping extents */
554 ret = btrfs_drop_extents(trans, root, inode, start, extent_end, 553 ret = btrfs_drop_extents(trans, root, inode, start, extent_end, 1);
555 &alloc_hint, 1);
556 BUG_ON(ret); 554 BUG_ON(ret);
557 555
558 if (found_type == BTRFS_FILE_EXTENT_REG || 556 if (found_type == BTRFS_FILE_EXTENT_REG ||
@@ -2843,9 +2841,8 @@ static int log_one_extent(struct btrfs_trans_handle *trans,
2843 int ret; 2841 int ret;
2844 2842
2845 if (BTRFS_I(inode)->logged_trans == trans->transid) { 2843 if (BTRFS_I(inode)->logged_trans == trans->transid) {
2846 u64 tmp;
2847 ret = __btrfs_drop_extents(trans, log, inode, dst_path, start, 2844 ret = __btrfs_drop_extents(trans, log, inode, dst_path, start,
2848 start + len, &tmp, 0); 2845 start + len, 0);
2849 if (ret) 2846 if (ret)
2850 return ret; 2847 return ret;
2851 } 2848 }