aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-27 09:56:58 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-31 10:32:58 -0400
commit3668b70fcf1fdc6799abf15f70fe3f50f407ec82 (patch)
treee254b29f4f2882298cc60112acc6878b56903a84 /fs/ubifs
parent6b38d03f48da3006085e2d3e45168ed60475f7bb (diff)
UBIFS: print less
UBIFS currently prints a lot of information when it mounts a volume, which bothers some people. Make it less chatty - print only important information by default. Get rid of 'dbg_msg()' macro completely. Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'fs/ubifs')
-rw-r--r--fs/ubifs/commit.c6
-rw-r--r--fs/ubifs/debug.h5
-rw-r--r--fs/ubifs/lprops.c8
-rw-r--r--fs/ubifs/lpt.c2
-rw-r--r--fs/ubifs/lpt_commit.c12
-rw-r--r--fs/ubifs/replay.c2
-rw-r--r--fs/ubifs/super.c91
-rw-r--r--fs/ubifs/tnc_misc.c4
8 files changed, 60 insertions, 70 deletions
diff --git a/fs/ubifs/commit.c b/fs/ubifs/commit.c
index a054cafd614b..ff8229340cd5 100644
--- a/fs/ubifs/commit.c
+++ b/fs/ubifs/commit.c
@@ -293,8 +293,8 @@ int ubifs_bg_thread(void *info)
293 int err; 293 int err;
294 struct ubifs_info *c = info; 294 struct ubifs_info *c = info;
295 295
296 dbg_msg("background thread \"%s\" started, PID %d", 296 ubifs_msg("background thread \"%s\" started, PID %d",
297 c->bgt_name, current->pid); 297 c->bgt_name, current->pid);
298 set_freezable(); 298 set_freezable();
299 299
300 while (1) { 300 while (1) {
@@ -328,7 +328,7 @@ int ubifs_bg_thread(void *info)
328 cond_resched(); 328 cond_resched();
329 } 329 }
330 330
331 dbg_msg("background thread \"%s\" stops", c->bgt_name); 331 ubifs_msg("background thread \"%s\" stops", c->bgt_name);
332 return 0; 332 return 0;
333} 333}
334 334
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h
index 38230b1e544e..e03d5179769a 100644
--- a/fs/ubifs/debug.h
+++ b/fs/ubifs/debug.h
@@ -176,11 +176,6 @@ struct ubifs_global_debug_info {
176 dbg_snprintf_key(c, key, __tmp_key_buf, DBG_KEY_BUF_LEN)); \ 176 dbg_snprintf_key(c, key, __tmp_key_buf, DBG_KEY_BUF_LEN)); \
177} while (0) 177} while (0)
178 178
179/* Just a debugging messages not related to any specific UBIFS subsystem */
180#define dbg_msg(fmt, ...) \
181 pr_err("UBIFS DBG (pid %d): %s: " fmt "\n", current->pid, \
182 __func__, ##__VA_ARGS__)
183
184/* General messages */ 179/* General messages */
185#define dbg_gen(fmt, ...) ubifs_dbg_msg("gen", fmt, ##__VA_ARGS__) 180#define dbg_gen(fmt, ...) ubifs_dbg_msg("gen", fmt, ##__VA_ARGS__)
186/* Additional journal messages */ 181/* Additional journal messages */
diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c
index 132b8e3e7b0b..e5a2a35a46dc 100644
--- a/fs/ubifs/lprops.c
+++ b/fs/ubifs/lprops.c
@@ -982,9 +982,9 @@ void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat,
982 goto out; 982 goto out;
983 } 983 }
984 if (lprops != lp) { 984 if (lprops != lp) {
985 dbg_msg("lprops %zx lp %zx lprops->lnum %d lp->lnum %d", 985 ubifs_err("lprops %zx lp %zx lprops->lnum %d lp->lnum %d",
986 (size_t)lprops, (size_t)lp, lprops->lnum, 986 (size_t)lprops, (size_t)lp, lprops->lnum,
987 lp->lnum); 987 lp->lnum);
988 err = 4; 988 err = 4;
989 goto out; 989 goto out;
990 } 990 }
@@ -1002,7 +1002,7 @@ void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat,
1002 } 1002 }
1003out: 1003out:
1004 if (err) { 1004 if (err) {
1005 dbg_msg("failed cat %d hpos %d err %d", cat, i, err); 1005 ubifs_err("failed cat %d hpos %d err %d", cat, i, err);
1006 dump_stack(); 1006 dump_stack();
1007 ubifs_dump_heap(c, heap, cat); 1007 ubifs_dump_heap(c, heap, cat);
1008 } 1008 }
diff --git a/fs/ubifs/lpt.c b/fs/ubifs/lpt.c
index c3e6bbf13ba5..d46b19ec1815 100644
--- a/fs/ubifs/lpt.c
+++ b/fs/ubifs/lpt.c
@@ -1311,7 +1311,7 @@ out:
1311 ubifs_err("error %d reading pnode at %d:%d", err, lnum, offs); 1311 ubifs_err("error %d reading pnode at %d:%d", err, lnum, offs);
1312 ubifs_dump_pnode(c, pnode, parent, iip); 1312 ubifs_dump_pnode(c, pnode, parent, iip);
1313 dump_stack(); 1313 dump_stack();
1314 dbg_msg("calc num: %d", calc_pnode_num_from_parent(c, parent, iip)); 1314 ubifs_err("calc num: %d", calc_pnode_num_from_parent(c, parent, iip));
1315 kfree(pnode); 1315 kfree(pnode);
1316 return err; 1316 return err;
1317} 1317}
diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c
index a1de3cf9dba2..9daaeef675dd 100644
--- a/fs/ubifs/lpt_commit.c
+++ b/fs/ubifs/lpt_commit.c
@@ -1662,19 +1662,19 @@ static int dbg_check_ltab_lnum(struct ubifs_info *c, int lnum)
1662 continue; 1662 continue;
1663 } 1663 }
1664 if (!dbg_is_all_ff(p, len)) { 1664 if (!dbg_is_all_ff(p, len)) {
1665 dbg_msg("invalid empty space in LEB %d at %d", 1665 ubifs_err("invalid empty space in LEB %d at %d",
1666 lnum, c->leb_size - len); 1666 lnum, c->leb_size - len);
1667 err = -EINVAL; 1667 err = -EINVAL;
1668 } 1668 }
1669 i = lnum - c->lpt_first; 1669 i = lnum - c->lpt_first;
1670 if (len != c->ltab[i].free) { 1670 if (len != c->ltab[i].free) {
1671 dbg_msg("invalid free space in LEB %d (free %d, expected %d)", 1671 ubifs_err("invalid free space in LEB %d (free %d, expected %d)",
1672 lnum, len, c->ltab[i].free); 1672 lnum, len, c->ltab[i].free);
1673 err = -EINVAL; 1673 err = -EINVAL;
1674 } 1674 }
1675 if (dirty != c->ltab[i].dirty) { 1675 if (dirty != c->ltab[i].dirty) {
1676 dbg_msg("invalid dirty space in LEB %d (dirty %d, expected %d)", 1676 ubifs_err("invalid dirty space in LEB %d (dirty %d, expected %d)",
1677 lnum, dirty, c->ltab[i].dirty); 1677 lnum, dirty, c->ltab[i].dirty);
1678 err = -EINVAL; 1678 err = -EINVAL;
1679 } 1679 }
1680 goto out; 1680 goto out;
diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c
index ede6e5835ced..3187925e9879 100644
--- a/fs/ubifs/replay.c
+++ b/fs/ubifs/replay.c
@@ -141,7 +141,7 @@ static int set_bud_lprops(struct ubifs_info *c, struct bud_entry *b)
141 * during the replay. 141 * during the replay.
142 */ 142 */
143 if (dirty != 0) 143 if (dirty != 0)
144 dbg_msg("LEB %d lp: %d free %d dirty replay: %d free %d dirty", 144 dbg_mnt("LEB %d lp: %d free %d dirty replay: %d free %d dirty",
145 b->bud->lnum, lp->free, lp->dirty, b->free, 145 b->bud->lnum, lp->free, lp->dirty, b->free,
146 b->dirty); 146 b->dirty);
147 } 147 }
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 448bf24ef8d0..7d51f2802bda 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1160,7 +1160,7 @@ static int check_free_space(struct ubifs_info *c)
1160static int mount_ubifs(struct ubifs_info *c) 1160static int mount_ubifs(struct ubifs_info *c)
1161{ 1161{
1162 int err; 1162 int err;
1163 long long x; 1163 long long x, y;
1164 size_t sz; 1164 size_t sz;
1165 1165
1166 c->ro_mount = !!(c->vfs_sb->s_flags & MS_RDONLY); 1166 c->ro_mount = !!(c->vfs_sb->s_flags & MS_RDONLY);
@@ -1410,74 +1410,69 @@ static int mount_ubifs(struct ubifs_info *c)
1410 1410
1411 c->mounting = 0; 1411 c->mounting = 0;
1412 1412
1413 ubifs_msg("mounted UBI device %d, volume %d, name \"%s\"", 1413 ubifs_msg("mounted UBI device %d, volume %d, name \"%s\"%s",
1414 c->vi.ubi_num, c->vi.vol_id, c->vi.name); 1414 c->vi.ubi_num, c->vi.vol_id, c->vi.name,
1415 if (c->ro_mount) 1415 c->ro_mount ? ", R/O mode" : NULL);
1416 ubifs_msg("mounted read-only");
1417 x = (long long)c->main_lebs * c->leb_size; 1416 x = (long long)c->main_lebs * c->leb_size;
1418 ubifs_msg("file system size: %lld bytes (%lld KiB, %lld MiB, %d LEBs)", 1417 y = (long long)c->log_lebs * c->leb_size + c->max_bud_bytes;
1419 x, x >> 10, x >> 20, c->main_lebs); 1418 ubifs_msg("LEB size: %d bytes (%d KiB), min./max. I/O unit sizes: %d bytes/%d bytes",
1420 x = (long long)c->log_lebs * c->leb_size + c->max_bud_bytes; 1419 c->leb_size, c->leb_size >> 10, c->min_io_size,
1421 ubifs_msg("journal size: %lld bytes (%lld KiB, %lld MiB, %d LEBs)", 1420 c->max_write_size);
1422 x, x >> 10, x >> 20, c->log_lebs + c->max_bud_cnt); 1421 ubifs_msg("FS size: %lld bytes (%lld MiB, %d LEBs), journal size %lld bytes (%lld MiB, %d LEBs)",
1423 ubifs_msg("media format: w%d/r%d (latest is w%d/r%d)", 1422 x, x >> 20, c->main_lebs,
1423 y, y >> 20, c->log_lebs + c->max_bud_cnt);
1424 ubifs_msg("reserved for root: %llu bytes (%llu KiB)",
1425 c->report_rp_size, c->report_rp_size >> 10);
1426 ubifs_msg("media format: w%d/r%d (latest is w%d/r%d), UUID %pUB%s",
1424 c->fmt_version, c->ro_compat_version, 1427 c->fmt_version, c->ro_compat_version,
1425 UBIFS_FORMAT_VERSION, UBIFS_RO_COMPAT_VERSION); 1428 UBIFS_FORMAT_VERSION, UBIFS_RO_COMPAT_VERSION, c->uuid,
1426 ubifs_msg("default compressor: %s", ubifs_compr_name(c->default_compr)); 1429 c->big_lpt ? ", big LPT model" : ", small LPT model");
1427 ubifs_msg("reserved for root: %llu bytes (%llu KiB)", 1430
1428 c->report_rp_size, c->report_rp_size >> 10); 1431 dbg_gen("default compressor: %s", ubifs_compr_name(c->default_compr));
1429 1432 dbg_gen("data journal heads: %d",
1430 dbg_msg("min. I/O unit size: %d bytes", c->min_io_size);
1431 dbg_msg("max. write size: %d bytes", c->max_write_size);
1432 dbg_msg("LEB size: %d bytes (%d KiB)",
1433 c->leb_size, c->leb_size >> 10);
1434 dbg_msg("data journal heads: %d",
1435 c->jhead_cnt - NONDATA_JHEADS_CNT); 1433 c->jhead_cnt - NONDATA_JHEADS_CNT);
1436 dbg_msg("UUID: %pUB", c->uuid); 1434 dbg_gen("log LEBs: %d (%d - %d)",
1437 dbg_msg("big_lpt %d", c->big_lpt);
1438 dbg_msg("log LEBs: %d (%d - %d)",
1439 c->log_lebs, UBIFS_LOG_LNUM, c->log_last); 1435 c->log_lebs, UBIFS_LOG_LNUM, c->log_last);
1440 dbg_msg("LPT area LEBs: %d (%d - %d)", 1436 dbg_gen("LPT area LEBs: %d (%d - %d)",
1441 c->lpt_lebs, c->lpt_first, c->lpt_last); 1437 c->lpt_lebs, c->lpt_first, c->lpt_last);
1442 dbg_msg("orphan area LEBs: %d (%d - %d)", 1438 dbg_gen("orphan area LEBs: %d (%d - %d)",
1443 c->orph_lebs, c->orph_first, c->orph_last); 1439 c->orph_lebs, c->orph_first, c->orph_last);
1444 dbg_msg("main area LEBs: %d (%d - %d)", 1440 dbg_gen("main area LEBs: %d (%d - %d)",
1445 c->main_lebs, c->main_first, c->leb_cnt - 1); 1441 c->main_lebs, c->main_first, c->leb_cnt - 1);
1446 dbg_msg("index LEBs: %d", c->lst.idx_lebs); 1442 dbg_gen("index LEBs: %d", c->lst.idx_lebs);
1447 dbg_msg("total index bytes: %lld (%lld KiB, %lld MiB)", 1443 dbg_gen("total index bytes: %lld (%lld KiB, %lld MiB)",
1448 c->bi.old_idx_sz, c->bi.old_idx_sz >> 10, 1444 c->bi.old_idx_sz, c->bi.old_idx_sz >> 10,
1449 c->bi.old_idx_sz >> 20); 1445 c->bi.old_idx_sz >> 20);
1450 dbg_msg("key hash type: %d", c->key_hash_type); 1446 dbg_gen("key hash type: %d", c->key_hash_type);
1451 dbg_msg("tree fanout: %d", c->fanout); 1447 dbg_gen("tree fanout: %d", c->fanout);
1452 dbg_msg("reserved GC LEB: %d", c->gc_lnum); 1448 dbg_gen("reserved GC LEB: %d", c->gc_lnum);
1453 dbg_msg("first main LEB: %d", c->main_first); 1449 dbg_gen("max. znode size %d", c->max_znode_sz);
1454 dbg_msg("max. znode size %d", c->max_znode_sz); 1450 dbg_gen("max. index node size %d", c->max_idx_node_sz);
1455 dbg_msg("max. index node size %d", c->max_idx_node_sz); 1451 dbg_gen("node sizes: data %zu, inode %zu, dentry %zu",
1456 dbg_msg("node sizes: data %zu, inode %zu, dentry %zu",
1457 UBIFS_DATA_NODE_SZ, UBIFS_INO_NODE_SZ, UBIFS_DENT_NODE_SZ); 1452 UBIFS_DATA_NODE_SZ, UBIFS_INO_NODE_SZ, UBIFS_DENT_NODE_SZ);
1458 dbg_msg("node sizes: trun %zu, sb %zu, master %zu", 1453 dbg_gen("node sizes: trun %zu, sb %zu, master %zu",
1459 UBIFS_TRUN_NODE_SZ, UBIFS_SB_NODE_SZ, UBIFS_MST_NODE_SZ); 1454 UBIFS_TRUN_NODE_SZ, UBIFS_SB_NODE_SZ, UBIFS_MST_NODE_SZ);
1460 dbg_msg("node sizes: ref %zu, cmt. start %zu, orph %zu", 1455 dbg_gen("node sizes: ref %zu, cmt. start %zu, orph %zu",
1461 UBIFS_REF_NODE_SZ, UBIFS_CS_NODE_SZ, UBIFS_ORPH_NODE_SZ); 1456 UBIFS_REF_NODE_SZ, UBIFS_CS_NODE_SZ, UBIFS_ORPH_NODE_SZ);
1462 dbg_msg("max. node sizes: data %zu, inode %zu dentry %zu, idx %d", 1457 dbg_gen("max. node sizes: data %zu, inode %zu dentry %zu, idx %d",
1463 UBIFS_MAX_DATA_NODE_SZ, UBIFS_MAX_INO_NODE_SZ, 1458 UBIFS_MAX_DATA_NODE_SZ, UBIFS_MAX_INO_NODE_SZ,
1464 UBIFS_MAX_DENT_NODE_SZ, ubifs_idx_node_sz(c, c->fanout)); 1459 UBIFS_MAX_DENT_NODE_SZ, ubifs_idx_node_sz(c, c->fanout));
1465 dbg_msg("dead watermark: %d", c->dead_wm); 1460 dbg_gen("dead watermark: %d", c->dead_wm);
1466 dbg_msg("dark watermark: %d", c->dark_wm); 1461 dbg_gen("dark watermark: %d", c->dark_wm);
1467 dbg_msg("LEB overhead: %d", c->leb_overhead); 1462 dbg_gen("LEB overhead: %d", c->leb_overhead);
1468 x = (long long)c->main_lebs * c->dark_wm; 1463 x = (long long)c->main_lebs * c->dark_wm;
1469 dbg_msg("max. dark space: %lld (%lld KiB, %lld MiB)", 1464 dbg_gen("max. dark space: %lld (%lld KiB, %lld MiB)",
1470 x, x >> 10, x >> 20); 1465 x, x >> 10, x >> 20);
1471 dbg_msg("maximum bud bytes: %lld (%lld KiB, %lld MiB)", 1466 dbg_gen("maximum bud bytes: %lld (%lld KiB, %lld MiB)",
1472 c->max_bud_bytes, c->max_bud_bytes >> 10, 1467 c->max_bud_bytes, c->max_bud_bytes >> 10,
1473 c->max_bud_bytes >> 20); 1468 c->max_bud_bytes >> 20);
1474 dbg_msg("BG commit bud bytes: %lld (%lld KiB, %lld MiB)", 1469 dbg_gen("BG commit bud bytes: %lld (%lld KiB, %lld MiB)",
1475 c->bg_bud_bytes, c->bg_bud_bytes >> 10, 1470 c->bg_bud_bytes, c->bg_bud_bytes >> 10,
1476 c->bg_bud_bytes >> 20); 1471 c->bg_bud_bytes >> 20);
1477 dbg_msg("current bud bytes %lld (%lld KiB, %lld MiB)", 1472 dbg_gen("current bud bytes %lld (%lld KiB, %lld MiB)",
1478 c->bud_bytes, c->bud_bytes >> 10, c->bud_bytes >> 20); 1473 c->bud_bytes, c->bud_bytes >> 10, c->bud_bytes >> 20);
1479 dbg_msg("max. seq. number: %llu", c->max_sqnum); 1474 dbg_gen("max. seq. number: %llu", c->max_sqnum);
1480 dbg_msg("commit number: %llu", c->cmt_no); 1475 dbg_gen("commit number: %llu", c->cmt_no);
1481 1476
1482 return 0; 1477 return 0;
1483 1478
diff --git a/fs/ubifs/tnc_misc.c b/fs/ubifs/tnc_misc.c
index d38ac7f9654b..f6bf8995c7b1 100644
--- a/fs/ubifs/tnc_misc.c
+++ b/fs/ubifs/tnc_misc.c
@@ -328,8 +328,8 @@ static int read_znode(struct ubifs_info *c, int lnum, int offs, int len,
328 case UBIFS_XENT_KEY: 328 case UBIFS_XENT_KEY:
329 break; 329 break;
330 default: 330 default:
331 dbg_msg("bad key type at slot %d: %d", 331 ubifs_err("bad key type at slot %d: %d",
332 i, key_type(c, &zbr->key)); 332 i, key_type(c, &zbr->key));
333 err = 3; 333 err = 3;
334 goto out_dump; 334 goto out_dump;
335 } 335 }