Lines Matching refs:re
98 struct reada_extent *re, struct extent_buffer *eb, in __readahead_hook() argument
107 spin_lock(&re->lock); in __readahead_hook()
112 list_replace_init(&re->extctl, &list); in __readahead_hook()
113 re->scheduled = 0; in __readahead_hook()
114 spin_unlock(&re->lock); in __readahead_hook()
146 next_key = re->top; in __readahead_hook()
197 reada_extent_put(fs_info, re); /* one ref for each entry */ in __readahead_hook()
207 struct reada_extent *re; in btree_readahead_hook() local
211 re = radix_tree_lookup(&fs_info->reada_tree, in btree_readahead_hook()
213 if (re) in btree_readahead_hook()
214 re->refcnt++; in btree_readahead_hook()
216 if (!re) { in btree_readahead_hook()
221 __readahead_hook(fs_info, re, eb, err); in btree_readahead_hook()
222 reada_extent_put(fs_info, re); /* our ref */ in btree_readahead_hook()
310 struct reada_extent *re = NULL; in reada_find_extent() local
323 re = radix_tree_lookup(&fs_info->reada_tree, index); in reada_find_extent()
324 if (re) in reada_find_extent()
325 re->refcnt++; in reada_find_extent()
328 if (re) in reada_find_extent()
329 return re; in reada_find_extent()
331 re = kzalloc(sizeof(*re), GFP_KERNEL); in reada_find_extent()
332 if (!re) in reada_find_extent()
335 re->logical = logical; in reada_find_extent()
336 re->top = *top; in reada_find_extent()
337 INIT_LIST_HEAD(&re->extctl); in reada_find_extent()
338 spin_lock_init(&re->lock); in reada_find_extent()
339 re->refcnt = 1; in reada_find_extent()
340 re->owner_root = owner_root; in reada_find_extent()
341 re->level = level; in reada_find_extent()
373 re->zones[re->nzones++] = zone; in reada_find_extent()
383 if (re->nzones == 0) { in reada_find_extent()
397 ret = radix_tree_insert(&fs_info->reada_tree, index, re); in reada_find_extent()
416 for (nzones = 0; nzones < re->nzones; ++nzones) { in reada_find_extent()
417 dev = re->zones[nzones]->device; in reada_find_extent()
444 ret = radix_tree_insert(&dev->reada_extents, index, re); in reada_find_extent()
447 dev = re->zones[nzones]->device; in reada_find_extent()
468 return re; in reada_find_extent()
471 for (nzones = 0; nzones < re->nzones; ++nzones) { in reada_find_extent()
474 zone = re->zones[nzones]; in reada_find_extent()
492 kfree(re); in reada_find_extent()
497 struct reada_extent *re) in reada_extent_put() argument
500 unsigned long index = re->logical >> fs_info->sectorsize_bits; in reada_extent_put()
503 if (--re->refcnt) { in reada_extent_put()
509 for (i = 0; i < re->nzones; ++i) { in reada_extent_put()
510 struct reada_zone *zone = re->zones[i]; in reada_extent_put()
517 for (i = 0; i < re->nzones; ++i) { in reada_extent_put()
518 struct reada_zone *zone = re->zones[i]; in reada_extent_put()
535 kfree(re); in reada_extent_put()
564 struct reada_extent *re; in reada_add_block() local
568 re = reada_find_extent(fs_info, logical, top, owner_root, level); in reada_add_block()
569 if (!re) in reada_add_block()
574 reada_extent_put(fs_info, re); in reada_add_block()
582 spin_lock(&re->lock); in reada_add_block()
583 list_add_tail(&rec->list, &re->extctl); in reada_add_block()
584 spin_unlock(&re->lock); in reada_add_block()
692 struct reada_extent *re = NULL; in reada_start_machine_dev() local
712 ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re, in reada_start_machine_dev()
714 if (ret == 0 || re->logical > dev->reada_curr_zone->end) { in reada_start_machine_dev()
720 re = NULL; in reada_start_machine_dev()
721 ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re, in reada_start_machine_dev()
728 dev->reada_next = re->logical + fs_info->nodesize; in reada_start_machine_dev()
729 re->refcnt++; in reada_start_machine_dev()
733 spin_lock(&re->lock); in reada_start_machine_dev()
734 if (re->scheduled || list_empty(&re->extctl)) { in reada_start_machine_dev()
735 spin_unlock(&re->lock); in reada_start_machine_dev()
736 reada_extent_put(fs_info, re); in reada_start_machine_dev()
739 re->scheduled = 1; in reada_start_machine_dev()
740 spin_unlock(&re->lock); in reada_start_machine_dev()
745 for (i = 0; i < re->nzones; ++i) { in reada_start_machine_dev()
746 if (re->zones[i]->device == dev) { in reada_start_machine_dev()
751 logical = re->logical; in reada_start_machine_dev()
754 ret = reada_tree_block_flagged(fs_info, logical, re->owner_root, in reada_start_machine_dev()
755 re->level, mirror_num, &eb); in reada_start_machine_dev()
757 __readahead_hook(fs_info, re, NULL, ret); in reada_start_machine_dev()
759 __readahead_hook(fs_info, re, eb, ret); in reada_start_machine_dev()
765 reada_extent_put(fs_info, re); in reada_start_machine_dev()
894 struct reada_extent *re = NULL; in dump_devs() local
897 (void **)&re, index, 1); in dump_devs()
901 re->logical, fs_info->nodesize, in dump_devs()
902 list_empty(&re->extctl), re->scheduled); in dump_devs()
904 for (i = 0; i < re->nzones; ++i) { in dump_devs()
906 re->zones[i]->start, in dump_devs()
907 re->zones[i]->end); in dump_devs()
908 for (j = 0; j < re->zones[i]->ndevs; ++j) { in dump_devs()
910 re->zones[i]->devs[j]->devid); in dump_devs()
914 index = (re->logical >> fs_info->sectorsize_bits) + 1; in dump_devs()
923 struct reada_extent *re = NULL; in dump_devs() local
925 ret = radix_tree_gang_lookup(&fs_info->reada_tree, (void **)&re, in dump_devs()
929 if (!re->scheduled) { in dump_devs()
930 index = (re->logical >> fs_info->sectorsize_bits) + 1; in dump_devs()
934 re->logical, fs_info->nodesize, in dump_devs()
935 list_empty(&re->extctl), re->scheduled); in dump_devs()
936 for (i = 0; i < re->nzones; ++i) { in dump_devs()
938 re->zones[i]->start, in dump_devs()
939 re->zones[i]->end); in dump_devs()
940 for (j = 0; j < re->zones[i]->ndevs; ++j) { in dump_devs()
942 re->zones[i]->devs[j]->devid); in dump_devs()
946 index = (re->logical >> fs_info->sectorsize_bits) + 1; in dump_devs()