diff options
Diffstat (limited to 'fs/ubifs/lprops.c')
-rw-r--r-- | fs/ubifs/lprops.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c index 2ba93da71b65..f27176e9b70d 100644 --- a/fs/ubifs/lprops.c +++ b/fs/ubifs/lprops.c | |||
@@ -125,6 +125,7 @@ static void adjust_lpt_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, | |||
125 | } | 125 | } |
126 | } | 126 | } |
127 | } | 127 | } |
128 | |||
128 | /* Not greater than parent, so compare to children */ | 129 | /* Not greater than parent, so compare to children */ |
129 | while (1) { | 130 | while (1) { |
130 | /* Compare to left child */ | 131 | /* Compare to left child */ |
@@ -460,18 +461,6 @@ static void change_category(struct ubifs_info *c, struct ubifs_lprops *lprops) | |||
460 | } | 461 | } |
461 | 462 | ||
462 | /** | 463 | /** |
463 | * ubifs_get_lprops - get reference to LEB properties. | ||
464 | * @c: the UBIFS file-system description object | ||
465 | * | ||
466 | * This function locks lprops. Lprops have to be unlocked by | ||
467 | * 'ubifs_release_lprops()'. | ||
468 | */ | ||
469 | void ubifs_get_lprops(struct ubifs_info *c) | ||
470 | { | ||
471 | mutex_lock(&c->lp_mutex); | ||
472 | } | ||
473 | |||
474 | /** | ||
475 | * calc_dark - calculate LEB dark space size. | 464 | * calc_dark - calculate LEB dark space size. |
476 | * @c: the UBIFS file-system description object | 465 | * @c: the UBIFS file-system description object |
477 | * @spc: amount of free and dirty space in the LEB | 466 | * @spc: amount of free and dirty space in the LEB |
@@ -576,7 +565,6 @@ const struct ubifs_lprops *ubifs_change_lp(struct ubifs_info *c, | |||
576 | ubifs_assert(!(lprops->free & 7) && !(lprops->dirty & 7)); | 565 | ubifs_assert(!(lprops->free & 7) && !(lprops->dirty & 7)); |
577 | 566 | ||
578 | spin_lock(&c->space_lock); | 567 | spin_lock(&c->space_lock); |
579 | |||
580 | if ((lprops->flags & LPROPS_TAKEN) && lprops->free == c->leb_size) | 568 | if ((lprops->flags & LPROPS_TAKEN) && lprops->free == c->leb_size) |
581 | c->lst.taken_empty_lebs -= 1; | 569 | c->lst.taken_empty_lebs -= 1; |
582 | 570 | ||
@@ -637,31 +625,12 @@ const struct ubifs_lprops *ubifs_change_lp(struct ubifs_info *c, | |||
637 | c->lst.taken_empty_lebs += 1; | 625 | c->lst.taken_empty_lebs += 1; |
638 | 626 | ||
639 | change_category(c, lprops); | 627 | change_category(c, lprops); |
640 | |||
641 | c->idx_gc_cnt += idx_gc_cnt; | 628 | c->idx_gc_cnt += idx_gc_cnt; |
642 | |||
643 | spin_unlock(&c->space_lock); | 629 | spin_unlock(&c->space_lock); |
644 | |||
645 | return lprops; | 630 | return lprops; |
646 | } | 631 | } |
647 | 632 | ||
648 | /** | 633 | /** |
649 | * ubifs_release_lprops - release lprops lock. | ||
650 | * @c: the UBIFS file-system description object | ||
651 | * | ||
652 | * This function has to be called after each 'ubifs_get_lprops()' call to | ||
653 | * unlock lprops. | ||
654 | */ | ||
655 | void ubifs_release_lprops(struct ubifs_info *c) | ||
656 | { | ||
657 | ubifs_assert(mutex_is_locked(&c->lp_mutex)); | ||
658 | ubifs_assert(c->lst.empty_lebs >= 0 && | ||
659 | c->lst.empty_lebs <= c->main_lebs); | ||
660 | |||
661 | mutex_unlock(&c->lp_mutex); | ||
662 | } | ||
663 | |||
664 | /** | ||
665 | * ubifs_get_lp_stats - get lprops statistics. | 634 | * ubifs_get_lp_stats - get lprops statistics. |
666 | * @c: UBIFS file-system description object | 635 | * @c: UBIFS file-system description object |
667 | * @st: return statistics | 636 | * @st: return statistics |
@@ -1262,7 +1231,6 @@ static int scan_check_cb(struct ubifs_info *c, | |||
1262 | } | 1231 | } |
1263 | 1232 | ||
1264 | ubifs_scan_destroy(sleb); | 1233 | ubifs_scan_destroy(sleb); |
1265 | |||
1266 | return LPT_SCAN_CONTINUE; | 1234 | return LPT_SCAN_CONTINUE; |
1267 | 1235 | ||
1268 | out_print: | 1236 | out_print: |