diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-07 11:52:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-07 11:52:19 -0500 |
commit | cf5e15fbd72c13977720aa15b7b7e00e1d8fd8f2 (patch) | |
tree | 66ecb6f516d33915171682cc602af978c0ae014f /fs | |
parent | 31555213f03bca37d2c02e10946296052f4ecfcd (diff) | |
parent | 7606f85a701ed8feeac065e133ff9a51c267aa0d (diff) |
Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6
* 'linux-next' of git://git.infradead.org/ubifs-2.6:
UBIFS: fix the dark space calculation
UBIFS: introduce a helper to dump scanning info
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ubifs/debug.c | 16 | ||||
-rw-r--r-- | fs/ubifs/debug.h | 5 | ||||
-rw-r--r-- | fs/ubifs/recovery.c | 2 | ||||
-rw-r--r-- | fs/ubifs/sb.c | 2 |
4 files changed, 23 insertions, 2 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index eef109a1a927..b09ba2dd8b62 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c | |||
@@ -870,6 +870,22 @@ void dbg_dump_lpt_info(struct ubifs_info *c) | |||
870 | spin_unlock(&dbg_lock); | 870 | spin_unlock(&dbg_lock); |
871 | } | 871 | } |
872 | 872 | ||
873 | void dbg_dump_sleb(const struct ubifs_info *c, | ||
874 | const struct ubifs_scan_leb *sleb, int offs) | ||
875 | { | ||
876 | struct ubifs_scan_node *snod; | ||
877 | |||
878 | printk(KERN_DEBUG "(pid %d) start dumping scanned data from LEB %d:%d\n", | ||
879 | current->pid, sleb->lnum, offs); | ||
880 | |||
881 | list_for_each_entry(snod, &sleb->nodes, list) { | ||
882 | cond_resched(); | ||
883 | printk(KERN_DEBUG "Dumping node at LEB %d:%d len %d\n", sleb->lnum, | ||
884 | snod->offs, snod->len); | ||
885 | dbg_dump_node(c, snod->node); | ||
886 | } | ||
887 | } | ||
888 | |||
873 | void dbg_dump_leb(const struct ubifs_info *c, int lnum) | 889 | void dbg_dump_leb(const struct ubifs_info *c, int lnum) |
874 | { | 890 | { |
875 | struct ubifs_scan_leb *sleb; | 891 | struct ubifs_scan_leb *sleb; |
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h index feb361e252ac..8d9c46810189 100644 --- a/fs/ubifs/debug.h +++ b/fs/ubifs/debug.h | |||
@@ -269,6 +269,8 @@ void dbg_dump_lprop(const struct ubifs_info *c, const struct ubifs_lprops *lp); | |||
269 | void dbg_dump_lprops(struct ubifs_info *c); | 269 | void dbg_dump_lprops(struct ubifs_info *c); |
270 | void dbg_dump_lpt_info(struct ubifs_info *c); | 270 | void dbg_dump_lpt_info(struct ubifs_info *c); |
271 | void dbg_dump_leb(const struct ubifs_info *c, int lnum); | 271 | void dbg_dump_leb(const struct ubifs_info *c, int lnum); |
272 | void dbg_dump_sleb(const struct ubifs_info *c, | ||
273 | const struct ubifs_scan_leb *sleb, int offs); | ||
272 | void dbg_dump_znode(const struct ubifs_info *c, | 274 | void dbg_dump_znode(const struct ubifs_info *c, |
273 | const struct ubifs_znode *znode); | 275 | const struct ubifs_znode *znode); |
274 | void dbg_dump_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat); | 276 | void dbg_dump_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat); |
@@ -387,6 +389,9 @@ static inline void dbg_dump_lpt_info(struct ubifs_info *c) { return; } | |||
387 | static inline void dbg_dump_leb(const struct ubifs_info *c, | 389 | static inline void dbg_dump_leb(const struct ubifs_info *c, |
388 | int lnum) { return; } | 390 | int lnum) { return; } |
389 | static inline void | 391 | static inline void |
392 | dbg_dump_sleb(const struct ubifs_info *c, | ||
393 | const struct ubifs_scan_leb *sleb, int offs) { return; } | ||
394 | static inline void | ||
390 | dbg_dump_znode(const struct ubifs_info *c, | 395 | dbg_dump_znode(const struct ubifs_info *c, |
391 | const struct ubifs_znode *znode) { return; } | 396 | const struct ubifs_znode *znode) { return; } |
392 | static inline void dbg_dump_heap(struct ubifs_info *c, | 397 | static inline void dbg_dump_heap(struct ubifs_info *c, |
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index af02790d9328..ee4f43f4bb99 100644 --- a/fs/ubifs/recovery.c +++ b/fs/ubifs/recovery.c | |||
@@ -983,7 +983,7 @@ int ubifs_recover_inl_heads(struct ubifs_info *c, void *sbuf) | |||
983 | } | 983 | } |
984 | 984 | ||
985 | /** | 985 | /** |
986 | * clean_an_unclean_leb - read and write a LEB to remove corruption. | 986 | * clean_an_unclean_leb - read and write a LEB to remove corruption. |
987 | * @c: UBIFS file-system description object | 987 | * @c: UBIFS file-system description object |
988 | * @ucleb: unclean LEB information | 988 | * @ucleb: unclean LEB information |
989 | * @sbuf: LEB-sized buffer to use | 989 | * @sbuf: LEB-sized buffer to use |
diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index 93d938ad3d2a..6094c5a5d7a8 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c | |||
@@ -247,7 +247,7 @@ static int create_default_filesystem(struct ubifs_info *c) | |||
247 | mst->total_dirty = cpu_to_le64(tmp64); | 247 | mst->total_dirty = cpu_to_le64(tmp64); |
248 | 248 | ||
249 | /* The indexing LEB does not contribute to dark space */ | 249 | /* The indexing LEB does not contribute to dark space */ |
250 | tmp64 = (c->main_lebs - 1) * c->dark_wm; | 250 | tmp64 = ((long long)(c->main_lebs - 1) * c->dark_wm); |
251 | mst->total_dark = cpu_to_le64(tmp64); | 251 | mst->total_dark = cpu_to_le64(tmp64); |
252 | 252 | ||
253 | mst->total_used = cpu_to_le64(UBIFS_INO_NODE_SZ); | 253 | mst->total_used = cpu_to_le64(UBIFS_INO_NODE_SZ); |