Lines Matching refs:re
94 struct reada_extent *re, struct extent_buffer *eb, in __readahead_hook() argument
103 spin_lock(&re->lock); in __readahead_hook()
108 list_replace_init(&re->extctl, &list); in __readahead_hook()
109 re->scheduled = 0; in __readahead_hook()
110 spin_unlock(&re->lock); in __readahead_hook()
142 next_key = re->top; in __readahead_hook()
191 reada_extent_put(fs_info, re); /* one ref for each entry */ in __readahead_hook()
201 struct reada_extent *re; in btree_readahead_hook() local
205 re = radix_tree_lookup(&fs_info->reada_tree, in btree_readahead_hook()
207 if (re) in btree_readahead_hook()
208 re->refcnt++; in btree_readahead_hook()
210 if (!re) { in btree_readahead_hook()
215 __readahead_hook(fs_info, re, eb, err); in btree_readahead_hook()
216 reada_extent_put(fs_info, re); /* our ref */ in btree_readahead_hook()
303 struct reada_extent *re = NULL; in reada_find_extent() local
316 re = radix_tree_lookup(&fs_info->reada_tree, index); in reada_find_extent()
317 if (re) in reada_find_extent()
318 re->refcnt++; in reada_find_extent()
321 if (re) in reada_find_extent()
322 return re; in reada_find_extent()
324 re = kzalloc(sizeof(*re), GFP_KERNEL); in reada_find_extent()
325 if (!re) in reada_find_extent()
328 re->logical = logical; in reada_find_extent()
329 re->top = *top; in reada_find_extent()
330 INIT_LIST_HEAD(&re->extctl); in reada_find_extent()
331 spin_lock_init(&re->lock); in reada_find_extent()
332 re->refcnt = 1; in reada_find_extent()
364 re->zones[re->nzones++] = zone; in reada_find_extent()
374 if (re->nzones == 0) { in reada_find_extent()
386 ret = radix_tree_insert(&fs_info->reada_tree, index, re); in reada_find_extent()
405 for (nzones = 0; nzones < re->nzones; ++nzones) { in reada_find_extent()
406 dev = re->zones[nzones]->device; in reada_find_extent()
430 ret = radix_tree_insert(&dev->reada_extents, index, re); in reada_find_extent()
433 dev = re->zones[nzones]->device; in reada_find_extent()
454 return re; in reada_find_extent()
457 for (nzones = 0; nzones < re->nzones; ++nzones) { in reada_find_extent()
460 zone = re->zones[nzones]; in reada_find_extent()
478 kfree(re); in reada_find_extent()
483 struct reada_extent *re) in reada_extent_put() argument
486 unsigned long index = re->logical >> PAGE_SHIFT; in reada_extent_put()
489 if (--re->refcnt) { in reada_extent_put()
495 for (i = 0; i < re->nzones; ++i) { in reada_extent_put()
496 struct reada_zone *zone = re->zones[i]; in reada_extent_put()
503 for (i = 0; i < re->nzones; ++i) { in reada_extent_put()
504 struct reada_zone *zone = re->zones[i]; in reada_extent_put()
521 kfree(re); in reada_extent_put()
546 struct reada_extent *re; in reada_add_block() local
550 re = reada_find_extent(fs_info, logical, top); in reada_add_block()
551 if (!re) in reada_add_block()
556 reada_extent_put(fs_info, re); in reada_add_block()
564 spin_lock(&re->lock); in reada_add_block()
565 list_add_tail(&rec->list, &re->extctl); in reada_add_block()
566 spin_unlock(&re->lock); in reada_add_block()
644 struct reada_extent *re = NULL; in reada_start_machine_dev() local
664 ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re, in reada_start_machine_dev()
666 if (ret == 0 || re->logical > dev->reada_curr_zone->end) { in reada_start_machine_dev()
672 re = NULL; in reada_start_machine_dev()
673 ret = radix_tree_gang_lookup(&dev->reada_extents, (void **)&re, in reada_start_machine_dev()
680 dev->reada_next = re->logical + fs_info->nodesize; in reada_start_machine_dev()
681 re->refcnt++; in reada_start_machine_dev()
685 spin_lock(&re->lock); in reada_start_machine_dev()
686 if (re->scheduled || list_empty(&re->extctl)) { in reada_start_machine_dev()
687 spin_unlock(&re->lock); in reada_start_machine_dev()
688 reada_extent_put(fs_info, re); in reada_start_machine_dev()
691 re->scheduled = 1; in reada_start_machine_dev()
692 spin_unlock(&re->lock); in reada_start_machine_dev()
697 for (i = 0; i < re->nzones; ++i) { in reada_start_machine_dev()
698 if (re->zones[i]->device == dev) { in reada_start_machine_dev()
703 logical = re->logical; in reada_start_machine_dev()
708 __readahead_hook(fs_info, re, NULL, ret); in reada_start_machine_dev()
710 __readahead_hook(fs_info, re, eb, ret); in reada_start_machine_dev()
716 reada_extent_put(fs_info, re); in reada_start_machine_dev()
838 struct reada_extent *re = NULL; in dump_devs() local
841 (void **)&re, index, 1); in dump_devs()
845 re->logical, fs_info->nodesize, in dump_devs()
846 list_empty(&re->extctl), re->scheduled); in dump_devs()
848 for (i = 0; i < re->nzones; ++i) { in dump_devs()
850 re->zones[i]->start, in dump_devs()
851 re->zones[i]->end); in dump_devs()
852 for (j = 0; j < re->zones[i]->ndevs; ++j) { in dump_devs()
854 re->zones[i]->devs[j]->devid); in dump_devs()
858 index = (re->logical >> PAGE_SHIFT) + 1; in dump_devs()
867 struct reada_extent *re = NULL; in dump_devs() local
869 ret = radix_tree_gang_lookup(&fs_info->reada_tree, (void **)&re, in dump_devs()
873 if (!re->scheduled) { in dump_devs()
874 index = (re->logical >> PAGE_SHIFT) + 1; in dump_devs()
878 re->logical, fs_info->nodesize, in dump_devs()
879 list_empty(&re->extctl), re->scheduled); in dump_devs()
880 for (i = 0; i < re->nzones; ++i) { in dump_devs()
882 re->zones[i]->start, in dump_devs()
883 re->zones[i]->end); in dump_devs()
884 for (j = 0; j < re->zones[i]->ndevs; ++j) { in dump_devs()
886 re->zones[i]->devs[j]->devid); in dump_devs()
890 index = (re->logical >> PAGE_SHIFT) + 1; in dump_devs()