db_textdump.c (175199) | db_textdump.c (175858) |
---|---|
1/*- 2 * Copyright (c) 2007 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 43 unchanged lines hidden (view full) --- 52 * TODO 53 * ---- 54 * 55 * - Allow subsytems to register to submit files for inclusion in the text 56 * dump in a generic way. 57 */ 58 59#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2007 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 43 unchanged lines hidden (view full) --- 52 * TODO 53 * ---- 54 * 55 * - Allow subsytems to register to submit files for inclusion in the text 56 * dump in a generic way. 57 */ 58 59#include <sys/cdefs.h> |
60__FBSDID("$FreeBSD: head/sys/ddb/db_textdump.c 175199 2008-01-10 00:26:47Z rwatson $"); | 60__FBSDID("$FreeBSD: head/sys/ddb/db_textdump.c 175858 2008-01-31 16:22:14Z rwatson $"); |
61 62#include "opt_config.h" 63 64#include <sys/param.h> 65#include <sys/conf.h> 66#include <sys/kernel.h> 67#include <sys/kerneldump.h> 68#include <sys/msgbuf.h> --- 185 unchanged lines hidden (view full) --- 254{ 255 256 if (textdump_error) 257 return (textdump_error); 258 if (offset + TEXTDUMP_BLOCKSIZE > di->mediasize) 259 return (EIO); 260 if (offset < SIZEOF_METADATA) 261 return (ENOSPC); | 61 62#include "opt_config.h" 63 64#include <sys/param.h> 65#include <sys/conf.h> 66#include <sys/kernel.h> 67#include <sys/kerneldump.h> 68#include <sys/msgbuf.h> --- 185 unchanged lines hidden (view full) --- 254{ 255 256 if (textdump_error) 257 return (textdump_error); 258 if (offset + TEXTDUMP_BLOCKSIZE > di->mediasize) 259 return (EIO); 260 if (offset < SIZEOF_METADATA) 261 return (ENOSPC); |
262 textdump_error = di->dumper(di->priv, buffer, 0, offset + 263 di->mediaoffset, TEXTDUMP_BLOCKSIZE); | 262 textdump_error = dump_write(di, buffer, 0, offset + di->mediaoffset, 263 TEXTDUMP_BLOCKSIZE); |
264 return (textdump_error); 265} 266 267/* 268 * Interfaces to save and restore the dump offset, so that printers can go 269 * back to rewrite a header if required, while avoiding their knowing about 270 * the global layout of the blocks. 271 * --- 225 unchanged lines hidden (view full) --- 497 (void)textdump_writenextblock(di, (char *)&kdh); 498 textdump_restoreoff(trailer_offset); 499 (void)textdump_writenextblock(di, (char *)&kdh); 500 501 /* 502 * Terminate the dump, report any errors, and clear the pending flag. 503 */ 504 if (textdump_error == 0) | 264 return (textdump_error); 265} 266 267/* 268 * Interfaces to save and restore the dump offset, so that printers can go 269 * back to rewrite a header if required, while avoiding their knowing about 270 * the global layout of the blocks. 271 * --- 225 unchanged lines hidden (view full) --- 497 (void)textdump_writenextblock(di, (char *)&kdh); 498 textdump_restoreoff(trailer_offset); 499 (void)textdump_writenextblock(di, (char *)&kdh); 500 501 /* 502 * Terminate the dump, report any errors, and clear the pending flag. 503 */ 504 if (textdump_error == 0) |
505 (void)di->dumper(di->priv, NULL, 0, 0, 0); | 505 (void)dump_write(di, NULL, 0, 0, 0); |
506 if (textdump_error == ENOSPC) 507 printf("Insufficient space on dump partition\n"); 508 else if (textdump_error != 0) 509 printf("Error %d writing dump\n", textdump_error); 510 else 511 printf("Textdump complete.\n"); 512 textdump_pending = 0; 513} --- 44 unchanged lines hidden --- | 506 if (textdump_error == ENOSPC) 507 printf("Insufficient space on dump partition\n"); 508 else if (textdump_error != 0) 509 printf("Error %d writing dump\n", textdump_error); 510 else 511 printf("Textdump complete.\n"); 512 textdump_pending = 0; 513} --- 44 unchanged lines hidden --- |