aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/lprops.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 12:19:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 12:19:03 -0400
commit396b122f6af3d329df3b4d688f6e66de3e2a399a (patch)
tree0b4185d529c1ba4c8eca1de23f14beecbe460323 /fs/ubifs/lprops.c
parented402af3c23a4804b3f8899263e8d0f97c62ab49 (diff)
parent54779aabb0183bbe049d2b52e96cd148366dfb0b (diff)
Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6
* 'linux-next' of git://git.infradead.org/ubifs-2.6: (25 commits) UBIFS: fix ubifs_compress commentary UBIFS: amend printk UBIFS: do not read unnecessary bytes when unpacking bits UBIFS: check buffer length when scanning for LPT nodes UBIFS: correct condition to eliminate unecessary assignment UBIFS: add more debugging messages for LPT UBIFS: fix bulk-read handling uptodate pages UBIFS: improve garbage collection UBIFS: allow for sync_fs when read-only UBIFS: commit on sync_fs UBIFS: correct comment for commit_on_unmount UBIFS: update dbg_dump_inode UBIFS: fix commentary UBIFS: fix races in bit-fields UBIFS: ensure data read beyond i_size is zeroed out correctly UBIFS: correct key comparison UBIFS: use bit-fields when possible UBIFS: check data CRC when in error state UBIFS: improve znode splitting rules UBIFS: add no_chk_data_crc mount option ...
Diffstat (limited to 'fs/ubifs/lprops.c')
-rw-r--r--fs/ubifs/lprops.c34
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 */
469void 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 */
655void 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
1268out_print: 1236out_print: