MCPcopy Create free account
hub / github.com/F-Stack/f-stack / textdump_writeblock

Function textdump_writeblock

freebsd/ddb/db_textdump.c:241–257  ·  view source on GitHub ↗

* textdump_writeblock() writes TEXTDUMP_BLOCKSIZE-sized blocks of data to * the space between di->mediaoffset and di->mediaoffset + di->mediasize. It * accepts an offset relative to di->mediaoffset. If we're carrying any * error from previous I/O, return that error and don't continue to try to * write. Most writers ignore the error and forge ahead on the basis that * there's not much you c

Source from the content-addressed store, hash-verified

239 * there's not much you can do.
240 */
241static int
242textdump_writeblock(struct dumperinfo *di, off_t offset, char *buffer)
243{
244
245 if (textdump_error)
246 return (textdump_error);
247 if (offset + TEXTDUMP_BLOCKSIZE > di->mediasize)
248 return (EIO);
249 if (offset < SIZEOF_METADATA)
250 return (ENOSPC);
251 textdump_error = dump_write(di, buffer, 0, offset + di->mediaoffset,
252 TEXTDUMP_BLOCKSIZE);
253 if (textdump_error)
254 printf("textdump_writeblock: offset %jd, error %d\n", (intmax_t)offset,
255 textdump_error);
256 return (textdump_error);
257}
258
259/*
260 * Interfaces to save and restore the dump offset, so that printers can go

Callers 1

textdump_writenextblockFunction · 0.85

Calls 2

dump_writeFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected