panic() cleanup.

this change
   - makes panic() variadic, doing full printf() formatting -
     no more NO_NUM, and no more separate printf() statements
     needed to print extra info (or something in hex) before panicing
   - unifies panic() - same panic() name and usage for everyone -
     vm, kernel and rest have different names/syntax currently
     in order to implement their own luxuries, but no longer
   - throws out the 1st argument, to make source less noisy.
     the panic() in syslib retrieves the server name from the kernel
     so it should be clear enough who is panicing; e.g.
         panic("sigaction failed: %d", errno);
     looks like:
         at_wini(73130): panic: sigaction failed: 0
         syslib:panic.c: stacktrace: 0x74dc 0x2025 0x100a
   - throws out report() - printf() is more convenient and powerful
   - harmonizes/fixes the use of panic() - there were a few places
     that used printf-style formatting (didn't work) and newlines
     (messes up the formatting) in panic()
   - throws out a few per-server panic() functions
   - cleans up a tie-in of tty with panic()

merging printf() and panic() statements to be done incrementally.
This commit is contained in:
Ben Gras
2010-03-05 15:05:11 +00:00
parent 851dc95566
commit 35a108b911
171 changed files with 1381 additions and 1649 deletions
+4 -6
View File
@@ -79,7 +79,7 @@ int only_search; /* if NO_READ, don't read, else act normal */
}
/* Desired block is not on available chain. Take oldest block ('front'). */
if ((bp = front) == NIL_BUF) panic(__FILE__,"all buffers in use", NR_BUFS);
if ((bp = front) == NIL_BUF) panic("all buffers in use: %d", NR_BUFS);
if(bp->b_bytes < fs_block_size) {
ASSERT(!bp->bp);
@@ -90,7 +90,7 @@ int only_search; /* if NO_READ, don't read, else act normal */
bp && bp->b_bytes < fs_block_size; bp = bp->b_next)
;
if(!bp) {
panic("MFS", "no buffer available", NO_NUM);
panic("no buffer available");
}
} else {
bp->b_bytes = fs_block_size;
@@ -475,13 +475,11 @@ PUBLIC void set_blocksize(int blocksize)
for (bp = &buf[0]; bp < &buf[NR_BUFS]; bp++)
if(bp->b_count != 0)
panic("MFS", "change blocksize with buffer in use",
NO_NUM);
panic("change blocksize with buffer in use");
for (rip = &inode[0]; rip < &inode[NR_INODES]; rip++)
if (rip->i_count > 0)
panic("MFS", "change blocksize with inode in use",
NO_NUM);
panic("change blocksize with inode in use");
fs_sync();