Date: Mon, 25 Jan 2016 12:55:24 +0000 (UTC) From: Svatopluk Kraus <skra@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294724 - head/sys/arm/arm Message-ID: <201601251255.u0PCtO69092285@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: skra Date: Mon Jan 25 12:55:24 2016 New Revision: 294724 URL: https://svnweb.freebsd.org/changeset/base/294724 Log: Do not use blk_write_cont() and remove it. There si no need to call blk_flush() between two writes by physical address when these are PAGE_SIZE aligned. Fix some style nits. Modified: head/sys/arm/arm/minidump_machdep.c Modified: head/sys/arm/arm/minidump_machdep.c ============================================================================== --- head/sys/arm/arm/minidump_machdep.c Mon Jan 25 12:49:08 2016 (r294723) +++ head/sys/arm/arm/minidump_machdep.c Mon Jan 25 12:55:24 2016 (r294724) @@ -127,7 +127,7 @@ blk_write(struct dumperinfo *di, char *p } } if (ptr != NULL) { - /* If we're doing a virtual dump, flush any pre-existing pa pages */ + /* Flush any pre-existing pa pages before a virtual dump. */ error = blk_flush(di); if (error) return (error); @@ -178,22 +178,6 @@ blk_write(struct dumperinfo *di, char *p return (0); } -static int -blk_write_cont(struct dumperinfo *di, vm_paddr_t pa, size_t sz) -{ - int error; - - error = blk_write(di, 0, pa, sz); - if (error) - return (error); - - error = blk_flush(di); - if (error) - return (error); - - return (0); -} - /* A buffer for general use. Its size must be one page at least. */ static char dumpbuf[PAGE_SIZE]; CTASSERT(sizeof(dumpbuf) % sizeof(pt2_entry_t) == 0); @@ -298,7 +282,8 @@ minidumpsys(struct dumperinfo *di) goto fail; /* Dump msgbuf up front */ - error = blk_write(di, (char *)msgbufp->msg_ptr, 0, round_page(msgbufp->msg_size)); + error = blk_write(di, (char *)msgbufp->msg_ptr, 0, + round_page(msgbufp->msg_size)); if (error) goto fail; @@ -340,7 +325,7 @@ minidumpsys(struct dumperinfo *di) if (pa == (prev_pa + count * PAGE_SIZE)) count++; else { - error = blk_write_cont(di, prev_pa, + error = blk_write(di, NULL, prev_pa, count * PAGE_SIZE); if (error) goto fail; @@ -352,13 +337,17 @@ minidumpsys(struct dumperinfo *di) } } if (count) { - error = blk_write_cont(di, prev_pa, count * PAGE_SIZE); + error = blk_write(di, NULL, prev_pa, count * PAGE_SIZE); if (error) goto fail; count = 0; prev_pa = 0; } + error = blk_flush(di); + if (error) + goto fail; + /* Dump trailer */ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); if (error)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601251255.u0PCtO69092285>