55 trace_xfs_extent_busy_enomem(tp->t_mountp, agno, bno, len);
56 xfs_trans_set_sync(tp);
63 INIT_LIST_HEAD(&new->list);
67 trace_xfs_extent_busy(tp->t_mountp, agno, bno, len);
70 spin_lock(&pag->pagb_lock);
71 rbp = &pag->pagb_tree.rb_node;
76 if (new->bno < busyp->
bno) {
78 ASSERT(new->bno + new->length <= busyp->
bno);
79 }
else if (new->bno > busyp->
bno) {
87 rb_link_node(&new->rb_node, parent, rbp);
90 list_add(&new->list, &tp->t_busy);
91 spin_unlock(&pag->pagb_lock);
106 struct xfs_mount *
mp,
117 spin_lock(&pag->pagb_lock);
119 rbp = pag->pagb_tree.rb_node;
124 if (bno < busyp->bno) {
126 if (bno + len > busyp->
bno)
129 }
else if (bno > busyp->
bno) {
131 if (bno < busyp->bno + busyp->
length)
136 match = (busyp->
length == len) ? 1 : -1;
140 spin_unlock(&pag->pagb_lock);
158 struct xfs_mount *
mp,
175 spin_unlock(&pag->pagb_lock);
177 spin_lock(&pag->pagb_lock);
192 if (bbno < fbno && bend > fend) {
211 }
else if (bbno >= fbno && bend <= fend) {
253 }
else if (fend < bend) {
269 }
else if (bbno < fbno) {
288 trace_xfs_extent_busy_reuse(mp, pag->
pag_agno, fbno, flen);
292 spin_unlock(&pag->pagb_lock);
294 trace_xfs_extent_busy_force(mp, pag->
pag_agno, fbno, flen);
295 spin_lock(&pag->pagb_lock);
305 struct xfs_mount *
mp,
317 spin_lock(&pag->pagb_lock);
319 rbp = pag->pagb_tree.rb_node;
326 if (fbno + flen <= bbno) {
329 }
else if (fbno >= bend) {
338 spin_unlock(&pag->pagb_lock);
362 spin_lock(&args->
pag->pagb_lock);
366 rbp = args->
pag->pagb_tree.rb_node;
367 while (rbp && flen >= args->
minlen) {
377 }
else if (fbno >= bend) {
446 }
else if (bend >= fend) {
501 if (bbno - fbno >= args->
maxlen) {
504 }
else if (fend - bend >= args->
maxlen * 4) {
507 }
else if (bbno - fbno >= args->
minlen) {
517 spin_unlock(&args->
pag->pagb_lock);
519 if (fbno != bno || flen != len) {
520 trace_xfs_extent_busy_trim(args->
mp, args->
agno, bno, len,
531 spin_unlock(&args->
pag->pagb_lock);
532 trace_xfs_extent_busy_trim(args->
mp, args->
agno, bno, len, fbno, 0);
539 struct xfs_mount *
mp,
544 trace_xfs_extent_busy_clear(mp, busyp->
agno, busyp->
bno,
549 list_del_init(&busyp->
list);
560 struct xfs_mount *
mp,
569 if (busyp->
agno != agno) {
571 spin_unlock(&pag->pagb_lock);
575 spin_lock(&pag->pagb_lock);
579 if (do_discard && busyp->
length &&
587 spin_unlock(&pag->pagb_lock);