• 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 refs:resv

53 					   struct ocfs2_alloc_reservation *resv)
58 if (!(resv->r_flags & OCFS2_RESV_FLAG_DIR)) {
67 static inline unsigned int ocfs2_resv_end(struct ocfs2_alloc_reservation *resv)
69 if (resv->r_len)
70 return resv->r_start + resv->r_len - 1;
71 return resv->r_start;
74 static inline int ocfs2_resv_empty(struct ocfs2_alloc_reservation *resv)
76 return !!(resv->r_len == 0);
90 struct ocfs2_alloc_reservation *resv;
98 resv = rb_entry(node, struct ocfs2_alloc_reservation, r_node);
101 "\tlast_len: %u\n", resv->r_start,
102 ocfs2_resv_end(resv), resv->r_len, resv->r_last_start,
103 resv->r_last_len);
112 list_for_each_entry(resv, &resmap->m_lru, r_lru) {
114 "last_start: %u\tlast_len: %u\n", i, resv->r_start,
115 ocfs2_resv_end(resv), resv->r_len, resv->r_last_start,
116 resv->r_last_len);
125 struct ocfs2_alloc_reservation *resv)
128 unsigned int start = resv->r_start;
129 unsigned int end = ocfs2_resv_end(resv);
149 struct ocfs2_alloc_reservation *resv;
153 resv = rb_entry(node, struct ocfs2_alloc_reservation, r_node);
155 if (i > 0 && resv->r_start <= off) {
161 if (resv->r_len == 0) {
167 if (resv->r_start > ocfs2_resv_end(resv)) {
173 if (ocfs2_resv_end(resv) >= resmap->m_bitmap_len) {
179 if (ocfs2_validate_resmap_bits(resmap, i, resv))
182 off = ocfs2_resv_end(resv);
200 void ocfs2_resv_init_once(struct ocfs2_alloc_reservation *resv)
202 memset(resv, 0, sizeof(*resv));
203 INIT_LIST_HEAD(&resv->r_lru);
206 void ocfs2_resv_set_type(struct ocfs2_alloc_reservation *resv,
211 resv->r_flags |= flags;
228 struct ocfs2_alloc_reservation *resv)
232 if (!list_empty(&resv->r_lru))
233 list_del_init(&resv->r_lru);
235 list_add_tail(&resv->r_lru, &resmap->m_lru);
238 static void __ocfs2_resv_trunc(struct ocfs2_alloc_reservation *resv)
240 resv->r_len = 0;
241 resv->r_start = 0;
245 struct ocfs2_alloc_reservation *resv)
247 if (resv->r_flags & OCFS2_RESV_FLAG_INUSE) {
248 list_del_init(&resv->r_lru);
249 rb_erase(&resv->r_node, &resmap->m_reservations);
250 resv->r_flags &= ~OCFS2_RESV_FLAG_INUSE;
255 struct ocfs2_alloc_reservation *resv)
259 __ocfs2_resv_trunc(resv);
264 resv->r_last_len = resv->r_last_start = 0;
266 ocfs2_resv_remove(resmap, resv);
269 /* does nothing if 'resv' is null */
271 struct ocfs2_alloc_reservation *resv)
273 if (resv) {
275 __ocfs2_resv_discard(resmap, resv);
283 struct ocfs2_alloc_reservation *resv;
288 resv = rb_entry(node, struct ocfs2_alloc_reservation, r_node);
290 __ocfs2_resv_discard(resmap, resv);
370 struct ocfs2_alloc_reservation *resv = NULL;
381 resv = rb_entry(node, struct ocfs2_alloc_reservation, r_node);
383 if (resv->r_start <= goal && ocfs2_resv_end(resv) >= goal)
387 if (resv->r_start > goal) {
388 resv = prev_resv;
392 prev_resv = resv;
396 return resv;
472 struct ocfs2_alloc_reservation *resv,
491 mlog(0, "resv start: %u resv end: %u goal: %u wanted: %u\n",
492 resv->r_start, ocfs2_resv_end(resv), goal, wanted);
517 resv->r_start = cstart;
518 resv->r_len = clen;
520 ocfs2_resv_insert(resmap, resv);
579 mlog(0, "One more resv found in linear search\n");
628 resv->r_start = best_start;
629 resv->r_len = best_len;
630 ocfs2_resv_insert(resmap, resv);
635 struct ocfs2_alloc_reservation *resv,
639 int tmpwindow = !!(resv->r_flags & OCFS2_RESV_FLAG_TMP);
643 min_bits = ocfs2_resv_window_bits(resmap, resv) >> 1;
657 mlog(0, "lru resv: start: %u len: %u end: %u\n", lru_resv->r_start,
670 resv->r_start = lru_resv->r_start;
671 resv->r_len = lru_resv->r_len;
683 resv->r_start = ocfs2_resv_end(lru_resv) + 1;
684 resv->r_len = shrink;
689 resv->r_start, ocfs2_resv_end(resv), resv->r_len,
690 resv->r_last_start, resv->r_last_len);
692 ocfs2_resv_insert(resmap, resv);
696 struct ocfs2_alloc_reservation *resv,
701 BUG_ON(!ocfs2_resv_empty(resv));
708 if (resv->r_last_len) {
709 goal = resv->r_last_start + resv->r_last_len;
714 __ocfs2_resv_find_window(resmap, resv, goal, wanted);
717 if (ocfs2_resv_empty(resv) && goal != 0)
718 __ocfs2_resv_find_window(resmap, resv, 0, wanted);
720 if (ocfs2_resv_empty(resv)) {
725 ocfs2_cannibalize_resv(resmap, resv, wanted);
728 BUG_ON(ocfs2_resv_empty(resv));
732 struct ocfs2_alloc_reservation *resv,
735 if (resv == NULL || ocfs2_resmap_disabled(resmap))
740 if (ocfs2_resv_empty(resv)) {
746 unsigned int wanted = ocfs2_resv_window_bits(resmap, resv);
748 if ((resv->r_flags & OCFS2_RESV_FLAG_TMP) || wanted < *clen)
759 ocfs2_resv_find_window(resmap, resv, wanted);
762 BUG_ON(ocfs2_resv_empty(resv));
764 *cstart = resv->r_start;
765 *clen = resv->r_len;
773 struct ocfs2_alloc_reservation *resv,
777 unsigned int old_end = ocfs2_resv_end(resv);
779 BUG_ON(start != resv->r_start || old_end < end);
785 __ocfs2_resv_discard(resmap, resv);
796 resv->r_start = end + 1;
797 resv->r_len = old_end - resv->r_start + 1;
801 struct ocfs2_alloc_reservation *resv,
809 if (resv == NULL)
812 BUG_ON(cstart != resv->r_start);
818 cstart, cend, clen, resv->r_start, ocfs2_resv_end(resv),
819 resv->r_len, resv->r_last_start, resv->r_last_len);
821 BUG_ON(cstart < resv->r_start);
822 BUG_ON(cstart > ocfs2_resv_end(resv));
823 BUG_ON(cend > ocfs2_resv_end(resv));
825 ocfs2_adjust_resv_from_alloc(resmap, resv, cstart, cend);
826 resv->r_last_start = cstart;
827 resv->r_last_len = clen;
833 if (!ocfs2_resv_empty(resv))
834 ocfs2_resv_mark_lru(resmap, resv);
838 resv->r_start, ocfs2_resv_end(resv), resv->r_len,
839 resv->r_last_start, resv->r_last_len);