• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6/fs/ocfs2/

Lines Matching defs:resmap

52 static unsigned int ocfs2_resv_window_bits(struct ocfs2_reservation_map *resmap,
55 struct ocfs2_super *osb = resmap->m_osb;
79 static inline int ocfs2_resmap_disabled(struct ocfs2_reservation_map *resmap)
81 if (resmap->m_osb->osb_resv_level == 0)
86 static void ocfs2_dump_resv(struct ocfs2_reservation_map *resmap)
88 struct ocfs2_super *osb = resmap->m_osb;
93 mlog(ML_NOTICE, "Dumping resmap for device %s. Bitmap length: %u\n",
94 osb->dev_str, resmap->m_bitmap_len);
96 node = rb_first(&resmap->m_reservations);
112 list_for_each_entry(resv, &resmap->m_lru, r_lru) {
123 static int ocfs2_validate_resmap_bits(struct ocfs2_reservation_map *resmap,
127 char *disk_bitmap = resmap->m_disk_bitmap;
144 static void ocfs2_check_resmap(struct ocfs2_reservation_map *resmap)
151 node = rb_first(&resmap->m_reservations);
173 if (ocfs2_resv_end(resv) >= resmap->m_bitmap_len) {
179 if (ocfs2_validate_resmap_bits(resmap, i, resv))
190 ocfs2_dump_resv(resmap);
194 static inline void ocfs2_check_resmap(struct ocfs2_reservation_map *resmap)
215 struct ocfs2_reservation_map *resmap)
217 memset(resmap, 0, sizeof(*resmap));
219 resmap->m_osb = osb;
220 resmap->m_reservations = RB_ROOT;
222 INIT_LIST_HEAD(&resmap->m_lru);
227 static void ocfs2_resv_mark_lru(struct ocfs2_reservation_map *resmap,
235 list_add_tail(&resv->r_lru, &resmap->m_lru);
244 static void ocfs2_resv_remove(struct ocfs2_reservation_map *resmap,
249 rb_erase(&resv->r_node, &resmap->m_reservations);
254 static void __ocfs2_resv_discard(struct ocfs2_reservation_map *resmap,
266 ocfs2_resv_remove(resmap, resv);
270 void ocfs2_resv_discard(struct ocfs2_reservation_map *resmap,
275 __ocfs2_resv_discard(resmap, resv);
280 static void ocfs2_resmap_clear_all_resv(struct ocfs2_reservation_map *resmap)
287 while ((node = rb_last(&resmap->m_reservations)) != NULL) {
290 __ocfs2_resv_discard(resmap, resv);
294 void ocfs2_resmap_restart(struct ocfs2_reservation_map *resmap,
297 if (ocfs2_resmap_disabled(resmap))
302 ocfs2_resmap_clear_all_resv(resmap);
303 resmap->m_bitmap_len = clen;
304 resmap->m_disk_bitmap = disk_bitmap;
309 void ocfs2_resmap_uninit(struct ocfs2_reservation_map *resmap)
314 static void ocfs2_resv_insert(struct ocfs2_reservation_map *resmap,
317 struct rb_root *root = &resmap->m_reservations;
353 ocfs2_resv_mark_lru(resmap, new);
355 ocfs2_check_resmap(resmap);
360 * @resmap: reservation map to search
368 ocfs2_find_resv_lhs(struct ocfs2_reservation_map *resmap, unsigned int goal)
372 struct rb_node *node = resmap->m_reservations.rb_node;
379 node = rb_first(&resmap->m_reservations);
415 static int ocfs2_resmap_find_free_bits(struct ocfs2_reservation_map *resmap,
422 void *bitmap = resmap->m_disk_bitmap;
426 mlog(0, "Find %u bits within range (%u, len %u) resmap len: %u\n",
427 wanted, search_start, search_len, resmap->m_bitmap_len);
432 while ((offset = ocfs2_find_next_zero_bit(bitmap, resmap->m_bitmap_len,
471 static void __ocfs2_resv_find_window(struct ocfs2_reservation_map *resmap,
475 struct rb_root *root = &resmap->m_reservations;
504 clen = ocfs2_resmap_find_free_bits(resmap, wanted, goal,
505 resmap->m_bitmap_len - goal,
520 ocfs2_resv_insert(resmap, resv);
524 prev_resv = ocfs2_find_resv_lhs(resmap, goal);
555 ocfs2_dump_resv(resmap);
559 clen = ocfs2_resmap_find_free_bits(resmap, wanted, goal,
595 gap_len = resmap->m_bitmap_len - gap_start;
596 gap_end = resmap->m_bitmap_len - 1;
606 clen = ocfs2_resmap_find_free_bits(resmap, wanted, gap_start,
630 ocfs2_resv_insert(resmap, resv);
634 static void ocfs2_cannibalize_resv(struct ocfs2_reservation_map *resmap,
643 min_bits = ocfs2_resv_window_bits(resmap, resv) >> 1;
654 lru_resv = list_first_entry(&resmap->m_lru,
673 __ocfs2_resv_discard(resmap, lru_resv);
692 ocfs2_resv_insert(resmap, resv);
695 static void ocfs2_resv_find_window(struct ocfs2_reservation_map *resmap,
710 if (goal >= resmap->m_bitmap_len)
714 __ocfs2_resv_find_window(resmap, resv, goal, wanted);
718 __ocfs2_resv_find_window(resmap, resv, 0, wanted);
725 ocfs2_cannibalize_resv(resmap, resv, wanted);
731 int ocfs2_resmap_resv_bits(struct ocfs2_reservation_map *resmap,
735 if (resv == NULL || ocfs2_resmap_disabled(resmap))
746 unsigned int wanted = ocfs2_resv_window_bits(resmap, resv);
759 ocfs2_resv_find_window(resmap, resv, wanted);
772 ocfs2_adjust_resv_from_alloc(struct ocfs2_reservation_map *resmap,
785 __ocfs2_resv_discard(resmap, resv);
800 void ocfs2_resmap_claimed_bits(struct ocfs2_reservation_map *resmap,
806 if (resmap == NULL || ocfs2_resmap_disabled(resmap))
825 ocfs2_adjust_resv_from_alloc(resmap, resv, cstart, cend);
834 ocfs2_resv_mark_lru(resmap, resv);
841 ocfs2_check_resmap(resmap);