diff options
Diffstat (limited to 'fs/btrfs/reada.c')
-rw-r--r-- | fs/btrfs/reada.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c index b892914968c1..298631eaee78 100644 --- a/fs/btrfs/reada.c +++ b/fs/btrfs/reada.c | |||
@@ -226,7 +226,7 @@ int btree_readahead_hook(struct btrfs_fs_info *fs_info, | |||
226 | /* find extent */ | 226 | /* find extent */ |
227 | spin_lock(&fs_info->reada_lock); | 227 | spin_lock(&fs_info->reada_lock); |
228 | re = radix_tree_lookup(&fs_info->reada_tree, | 228 | re = radix_tree_lookup(&fs_info->reada_tree, |
229 | start >> PAGE_CACHE_SHIFT); | 229 | start >> PAGE_SHIFT); |
230 | if (re) | 230 | if (re) |
231 | re->refcnt++; | 231 | re->refcnt++; |
232 | spin_unlock(&fs_info->reada_lock); | 232 | spin_unlock(&fs_info->reada_lock); |
@@ -257,7 +257,7 @@ static struct reada_zone *reada_find_zone(struct btrfs_fs_info *fs_info, | |||
257 | zone = NULL; | 257 | zone = NULL; |
258 | spin_lock(&fs_info->reada_lock); | 258 | spin_lock(&fs_info->reada_lock); |
259 | ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone, | 259 | ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone, |
260 | logical >> PAGE_CACHE_SHIFT, 1); | 260 | logical >> PAGE_SHIFT, 1); |
261 | if (ret == 1 && logical >= zone->start && logical <= zone->end) { | 261 | if (ret == 1 && logical >= zone->start && logical <= zone->end) { |
262 | kref_get(&zone->refcnt); | 262 | kref_get(&zone->refcnt); |
263 | spin_unlock(&fs_info->reada_lock); | 263 | spin_unlock(&fs_info->reada_lock); |
@@ -294,13 +294,13 @@ static struct reada_zone *reada_find_zone(struct btrfs_fs_info *fs_info, | |||
294 | 294 | ||
295 | spin_lock(&fs_info->reada_lock); | 295 | spin_lock(&fs_info->reada_lock); |
296 | ret = radix_tree_insert(&dev->reada_zones, | 296 | ret = radix_tree_insert(&dev->reada_zones, |
297 | (unsigned long)(zone->end >> PAGE_CACHE_SHIFT), | 297 | (unsigned long)(zone->end >> PAGE_SHIFT), |
298 | zone); | 298 | zone); |
299 | 299 | ||
300 | if (ret == -EEXIST) { | 300 | if (ret == -EEXIST) { |
301 | kfree(zone); | 301 | kfree(zone); |
302 | ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone, | 302 | ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone, |
303 | logical >> PAGE_CACHE_SHIFT, 1); | 303 | logical >> PAGE_SHIFT, 1); |
304 | if (ret == 1 && logical >= zone->start && logical <= zone->end) | 304 | if (ret == 1 && logical >= zone->start && logical <= zone->end) |
305 | kref_get(&zone->refcnt); | 305 | kref_get(&zone->refcnt); |
306 | else | 306 | else |
@@ -326,7 +326,7 @@ static struct reada_extent *reada_find_extent(struct btrfs_root *root, | |||
326 | u64 length; | 326 | u64 length; |
327 | int real_stripes; | 327 | int real_stripes; |
328 | int nzones = 0; | 328 | int nzones = 0; |
329 | unsigned long index = logical >> PAGE_CACHE_SHIFT; | 329 | unsigned long index = logical >> PAGE_SHIFT; |
330 | int dev_replace_is_ongoing; | 330 | int dev_replace_is_ongoing; |
331 | int have_zone = 0; | 331 | int have_zone = 0; |
332 | 332 | ||
@@ -495,7 +495,7 @@ static void reada_extent_put(struct btrfs_fs_info *fs_info, | |||
495 | struct reada_extent *re) | 495 | struct reada_extent *re) |
496 | { | 496 | { |
497 | int i; | 497 | int i; |
498 | unsigned long index = re->logical >> PAGE_CACHE_SHIFT; | 498 | unsigned long index = re->logical >> PAGE_SHIFT; |
499 | 499 | ||
500 | spin_lock(&fs_info->reada_lock); | 500 | spin_lock(&fs_info->reada_lock); |
501 | if (--re->refcnt) { | 501 | if (--re->refcnt) { |
@@ -538,7 +538,7 @@ static void reada_zone_release(struct kref *kref) | |||
538 | struct reada_zone *zone = container_of(kref, struct reada_zone, refcnt); | 538 | struct reada_zone *zone = container_of(kref, struct reada_zone, refcnt); |
539 | 539 | ||
540 | radix_tree_delete(&zone->device->reada_zones, | 540 | radix_tree_delete(&zone->device->reada_zones, |
541 | zone->end >> PAGE_CACHE_SHIFT); | 541 | zone->end >> PAGE_SHIFT); |
542 | 542 | ||
543 | kfree(zone); | 543 | kfree(zone); |
544 | } | 544 | } |
@@ -587,7 +587,7 @@ static int reada_add_block(struct reada_control *rc, u64 logical, | |||
587 | static void reada_peer_zones_set_lock(struct reada_zone *zone, int lock) | 587 | static void reada_peer_zones_set_lock(struct reada_zone *zone, int lock) |
588 | { | 588 | { |
589 | int i; | 589 | int i; |
590 | unsigned long index = zone->end >> PAGE_CACHE_SHIFT; | 590 | unsigned long index = zone->end >> PAGE_SHIFT; |
591 | 591 | ||
592 | for (i = 0; i < zone->ndevs; ++i) { | 592 | for (i = 0; i < zone->ndevs; ++i) { |
593 | struct reada_zone *peer; | 593 | struct reada_zone *peer; |
@@ -622,7 +622,7 @@ static int reada_pick_zone(struct btrfs_device *dev) | |||
622 | (void **)&zone, index, 1); | 622 | (void **)&zone, index, 1); |
623 | if (ret == 0) | 623 | if (ret == 0) |
624 | break; | 624 | break; |
625 | index = (zone->end >> PAGE_CACHE_SHIFT) + 1; | 625 | index = (zone->end >> PAGE_SHIFT) + 1; |
626 | if (zone->locked) { | 626 | if (zone->locked) { |
627 | if (zone->elems > top_locked_elems) { | 627 | if (zone->elems > top_locked_elems) { |
628 | top_locked_elems = zone->elems; | 628 | top_locked_elems = zone->elems; |
@@ -673,7 +673,7 @@ static int reada_start_machine_dev(struct btrfs_fs_info *fs_info, | |||
673 | * plugging to speed things up | 673 | * plugging to speed things up |
674 | */ | 674 | */ |
675 | ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re, | 675 | ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re, |
676 | dev->reada_next >> PAGE_CACHE_SHIFT, 1); | 676 | dev->reada_next >> PAGE_SHIFT, 1); |
677 | if (ret == 0 || re->logical > dev->reada_curr_zone->end) { | 677 | if (ret == 0 || re->logical > dev->reada_curr_zone->end) { |
678 | ret = reada_pick_zone(dev); | 678 | ret = reada_pick_zone(dev); |
679 | if (!ret) { | 679 | if (!ret) { |
@@ -682,7 +682,7 @@ static int reada_start_machine_dev(struct btrfs_fs_info *fs_info, | |||
682 | } | 682 | } |
683 | re = NULL; | 683 | re = NULL; |
684 | ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re, | 684 | ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re, |
685 | dev->reada_next >> PAGE_CACHE_SHIFT, 1); | 685 | dev->reada_next >> PAGE_SHIFT, 1); |
686 | } | 686 | } |
687 | if (ret == 0) { | 687 | if (ret == 0) { |
688 | spin_unlock(&fs_info->reada_lock); | 688 | spin_unlock(&fs_info->reada_lock); |
@@ -838,7 +838,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) | |||
838 | printk(KERN_CONT " curr off %llu", | 838 | printk(KERN_CONT " curr off %llu", |
839 | device->reada_next - zone->start); | 839 | device->reada_next - zone->start); |
840 | printk(KERN_CONT "\n"); | 840 | printk(KERN_CONT "\n"); |
841 | index = (zone->end >> PAGE_CACHE_SHIFT) + 1; | 841 | index = (zone->end >> PAGE_SHIFT) + 1; |
842 | } | 842 | } |
843 | cnt = 0; | 843 | cnt = 0; |
844 | index = 0; | 844 | index = 0; |
@@ -864,7 +864,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) | |||
864 | } | 864 | } |
865 | } | 865 | } |
866 | printk(KERN_CONT "\n"); | 866 | printk(KERN_CONT "\n"); |
867 | index = (re->logical >> PAGE_CACHE_SHIFT) + 1; | 867 | index = (re->logical >> PAGE_SHIFT) + 1; |
868 | if (++cnt > 15) | 868 | if (++cnt > 15) |
869 | break; | 869 | break; |
870 | } | 870 | } |
@@ -880,7 +880,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) | |||
880 | if (ret == 0) | 880 | if (ret == 0) |
881 | break; | 881 | break; |
882 | if (!re->scheduled) { | 882 | if (!re->scheduled) { |
883 | index = (re->logical >> PAGE_CACHE_SHIFT) + 1; | 883 | index = (re->logical >> PAGE_SHIFT) + 1; |
884 | continue; | 884 | continue; |
885 | } | 885 | } |
886 | printk(KERN_DEBUG | 886 | printk(KERN_DEBUG |
@@ -897,7 +897,7 @@ static void dump_devs(struct btrfs_fs_info *fs_info, int all) | |||
897 | } | 897 | } |
898 | } | 898 | } |
899 | printk(KERN_CONT "\n"); | 899 | printk(KERN_CONT "\n"); |
900 | index = (re->logical >> PAGE_CACHE_SHIFT) + 1; | 900 | index = (re->logical >> PAGE_SHIFT) + 1; |
901 | } | 901 | } |
902 | spin_unlock(&fs_info->reada_lock); | 902 | spin_unlock(&fs_info->reada_lock); |
903 | } | 903 | } |