summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/budget.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs/budget.c')
-rw-r--r--fs/ubifs/budget.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c
index 11a11b32a2a9..7ef22baf9d15 100644
--- a/fs/ubifs/budget.c
+++ b/fs/ubifs/budget.c
@@ -439,16 +439,16 @@ int ubifs_budget_space(struct ubifs_info *c, struct ubifs_budget_req *req)
439{ 439{
440 int err, idx_growth, data_growth, dd_growth, retried = 0; 440 int err, idx_growth, data_growth, dd_growth, retried = 0;
441 441
442 ubifs_assert(req->new_page <= 1); 442 ubifs_assert(c, req->new_page <= 1);
443 ubifs_assert(req->dirtied_page <= 1); 443 ubifs_assert(c, req->dirtied_page <= 1);
444 ubifs_assert(req->new_dent <= 1); 444 ubifs_assert(c, req->new_dent <= 1);
445 ubifs_assert(req->mod_dent <= 1); 445 ubifs_assert(c, req->mod_dent <= 1);
446 ubifs_assert(req->new_ino <= 1); 446 ubifs_assert(c, req->new_ino <= 1);
447 ubifs_assert(req->new_ino_d <= UBIFS_MAX_INO_DATA); 447 ubifs_assert(c, req->new_ino_d <= UBIFS_MAX_INO_DATA);
448 ubifs_assert(req->dirtied_ino <= 4); 448 ubifs_assert(c, req->dirtied_ino <= 4);
449 ubifs_assert(req->dirtied_ino_d <= UBIFS_MAX_INO_DATA * 4); 449 ubifs_assert(c, req->dirtied_ino_d <= UBIFS_MAX_INO_DATA * 4);
450 ubifs_assert(!(req->new_ino_d & 7)); 450 ubifs_assert(c, !(req->new_ino_d & 7));
451 ubifs_assert(!(req->dirtied_ino_d & 7)); 451 ubifs_assert(c, !(req->dirtied_ino_d & 7));
452 452
453 data_growth = calc_data_growth(c, req); 453 data_growth = calc_data_growth(c, req);
454 dd_growth = calc_dd_growth(c, req); 454 dd_growth = calc_dd_growth(c, req);
@@ -458,9 +458,9 @@ int ubifs_budget_space(struct ubifs_info *c, struct ubifs_budget_req *req)
458 458
459again: 459again:
460 spin_lock(&c->space_lock); 460 spin_lock(&c->space_lock);
461 ubifs_assert(c->bi.idx_growth >= 0); 461 ubifs_assert(c, c->bi.idx_growth >= 0);
462 ubifs_assert(c->bi.data_growth >= 0); 462 ubifs_assert(c, c->bi.data_growth >= 0);
463 ubifs_assert(c->bi.dd_growth >= 0); 463 ubifs_assert(c, c->bi.dd_growth >= 0);
464 464
465 if (unlikely(c->bi.nospace) && (c->bi.nospace_rp || !can_use_rp(c))) { 465 if (unlikely(c->bi.nospace) && (c->bi.nospace_rp || !can_use_rp(c))) {
466 dbg_budg("no space"); 466 dbg_budg("no space");
@@ -526,20 +526,20 @@ again:
526 */ 526 */
527void ubifs_release_budget(struct ubifs_info *c, struct ubifs_budget_req *req) 527void ubifs_release_budget(struct ubifs_info *c, struct ubifs_budget_req *req)
528{ 528{
529 ubifs_assert(req->new_page <= 1); 529 ubifs_assert(c, req->new_page <= 1);
530 ubifs_assert(req->dirtied_page <= 1); 530 ubifs_assert(c, req->dirtied_page <= 1);
531 ubifs_assert(req->new_dent <= 1); 531 ubifs_assert(c, req->new_dent <= 1);
532 ubifs_assert(req->mod_dent <= 1); 532 ubifs_assert(c, req->mod_dent <= 1);
533 ubifs_assert(req->new_ino <= 1); 533 ubifs_assert(c, req->new_ino <= 1);
534 ubifs_assert(req->new_ino_d <= UBIFS_MAX_INO_DATA); 534 ubifs_assert(c, req->new_ino_d <= UBIFS_MAX_INO_DATA);
535 ubifs_assert(req->dirtied_ino <= 4); 535 ubifs_assert(c, req->dirtied_ino <= 4);
536 ubifs_assert(req->dirtied_ino_d <= UBIFS_MAX_INO_DATA * 4); 536 ubifs_assert(c, req->dirtied_ino_d <= UBIFS_MAX_INO_DATA * 4);
537 ubifs_assert(!(req->new_ino_d & 7)); 537 ubifs_assert(c, !(req->new_ino_d & 7));
538 ubifs_assert(!(req->dirtied_ino_d & 7)); 538 ubifs_assert(c, !(req->dirtied_ino_d & 7));
539 if (!req->recalculate) { 539 if (!req->recalculate) {
540 ubifs_assert(req->idx_growth >= 0); 540 ubifs_assert(c, req->idx_growth >= 0);
541 ubifs_assert(req->data_growth >= 0); 541 ubifs_assert(c, req->data_growth >= 0);
542 ubifs_assert(req->dd_growth >= 0); 542 ubifs_assert(c, req->dd_growth >= 0);
543 } 543 }
544 544
545 if (req->recalculate) { 545 if (req->recalculate) {
@@ -561,13 +561,13 @@ void ubifs_release_budget(struct ubifs_info *c, struct ubifs_budget_req *req)
561 c->bi.dd_growth -= req->dd_growth; 561 c->bi.dd_growth -= req->dd_growth;
562 c->bi.min_idx_lebs = ubifs_calc_min_idx_lebs(c); 562 c->bi.min_idx_lebs = ubifs_calc_min_idx_lebs(c);
563 563
564 ubifs_assert(c->bi.idx_growth >= 0); 564 ubifs_assert(c, c->bi.idx_growth >= 0);
565 ubifs_assert(c->bi.data_growth >= 0); 565 ubifs_assert(c, c->bi.data_growth >= 0);
566 ubifs_assert(c->bi.dd_growth >= 0); 566 ubifs_assert(c, c->bi.dd_growth >= 0);
567 ubifs_assert(c->bi.min_idx_lebs < c->main_lebs); 567 ubifs_assert(c, c->bi.min_idx_lebs < c->main_lebs);
568 ubifs_assert(!(c->bi.idx_growth & 7)); 568 ubifs_assert(c, !(c->bi.idx_growth & 7));
569 ubifs_assert(!(c->bi.data_growth & 7)); 569 ubifs_assert(c, !(c->bi.data_growth & 7));
570 ubifs_assert(!(c->bi.dd_growth & 7)); 570 ubifs_assert(c, !(c->bi.dd_growth & 7));
571 spin_unlock(&c->space_lock); 571 spin_unlock(&c->space_lock);
572} 572}
573 573
@@ -680,7 +680,7 @@ long long ubifs_get_free_space_nolock(struct ubifs_info *c)
680 int rsvd_idx_lebs, lebs; 680 int rsvd_idx_lebs, lebs;
681 long long available, outstanding, free; 681 long long available, outstanding, free;
682 682
683 ubifs_assert(c->bi.min_idx_lebs == ubifs_calc_min_idx_lebs(c)); 683 ubifs_assert(c, c->bi.min_idx_lebs == ubifs_calc_min_idx_lebs(c));
684 outstanding = c->bi.data_growth + c->bi.dd_growth; 684 outstanding = c->bi.data_growth + c->bi.dd_growth;
685 available = ubifs_calc_available(c, c->bi.min_idx_lebs); 685 available = ubifs_calc_available(c, c->bi.min_idx_lebs);
686 686