Skip to content

Commit

Permalink
Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6
Browse files Browse the repository at this point in the history
* 'linux-next' of git://git.infradead.org/ubifs-2.6:
  UBIFS: fix the dark space calculation
  UBIFS: introduce a helper to dump scanning info
  • Loading branch information
Linus Torvalds committed Nov 7, 2011
2 parents 3155521 + 7606f85 commit cf5e15f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
16 changes: 16 additions & 0 deletions fs/ubifs/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,22 @@ void dbg_dump_lpt_info(struct ubifs_info *c)
spin_unlock(&dbg_lock);
}

void dbg_dump_sleb(const struct ubifs_info *c,
const struct ubifs_scan_leb *sleb, int offs)
{
struct ubifs_scan_node *snod;

printk(KERN_DEBUG "(pid %d) start dumping scanned data from LEB %d:%d\n",
current->pid, sleb->lnum, offs);

list_for_each_entry(snod, &sleb->nodes, list) {
cond_resched();
printk(KERN_DEBUG "Dumping node at LEB %d:%d len %d\n", sleb->lnum,
snod->offs, snod->len);
dbg_dump_node(c, snod->node);
}
}

void dbg_dump_leb(const struct ubifs_info *c, int lnum)
{
struct ubifs_scan_leb *sleb;
Expand Down
5 changes: 5 additions & 0 deletions fs/ubifs/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ void dbg_dump_lprop(const struct ubifs_info *c, const struct ubifs_lprops *lp);
void dbg_dump_lprops(struct ubifs_info *c);
void dbg_dump_lpt_info(struct ubifs_info *c);
void dbg_dump_leb(const struct ubifs_info *c, int lnum);
void dbg_dump_sleb(const struct ubifs_info *c,
const struct ubifs_scan_leb *sleb, int offs);
void dbg_dump_znode(const struct ubifs_info *c,
const struct ubifs_znode *znode);
void dbg_dump_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat);
Expand Down Expand Up @@ -387,6 +389,9 @@ static inline void dbg_dump_lpt_info(struct ubifs_info *c) { return; }
static inline void dbg_dump_leb(const struct ubifs_info *c,
int lnum) { return; }
static inline void
dbg_dump_sleb(const struct ubifs_info *c,
const struct ubifs_scan_leb *sleb, int offs) { return; }
static inline void
dbg_dump_znode(const struct ubifs_info *c,
const struct ubifs_znode *znode) { return; }
static inline void dbg_dump_heap(struct ubifs_info *c,
Expand Down
2 changes: 1 addition & 1 deletion fs/ubifs/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ int ubifs_recover_inl_heads(struct ubifs_info *c, void *sbuf)
}

/**
* clean_an_unclean_leb - read and write a LEB to remove corruption.
* clean_an_unclean_leb - read and write a LEB to remove corruption.
* @c: UBIFS file-system description object
* @ucleb: unclean LEB information
* @sbuf: LEB-sized buffer to use
Expand Down
2 changes: 1 addition & 1 deletion fs/ubifs/sb.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ static int create_default_filesystem(struct ubifs_info *c)
mst->total_dirty = cpu_to_le64(tmp64);

/* The indexing LEB does not contribute to dark space */
tmp64 = (c->main_lebs - 1) * c->dark_wm;
tmp64 = ((long long)(c->main_lebs - 1) * c->dark_wm);
mst->total_dark = cpu_to_le64(tmp64);

mst->total_used = cpu_to_le64(UBIFS_INO_NODE_SZ);
Expand Down

0 comments on commit cf5e15f

Please sign in to comment.