Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107174109
D13275.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
980 B
Referenced Files
None
Subscribers
None
D13275.diff
View Options
Index: head/usr.sbin/diskinfo/diskinfo.c
===================================================================
--- head/usr.sbin/diskinfo/diskinfo.c
+++ head/usr.sbin/diskinfo/diskinfo.c
@@ -646,22 +646,22 @@
{
struct aiocb aios[MAXIOS];
off_t o;
- size_t s;
int n, error;
struct aiocb *aiop;
- for (n = 0, o = 0; size > MAXIO; n++, size -= s, o += s) {
- s = (size >= MAXIO) ? MAXIO : size;
+ // if size > MAXIO, use AIO to write n - 1 pieces in parallel
+ for (n = 0, o = 0; size > MAXIO; n++, size -= MAXIO, o += MAXIO) {
aiop = &aios[n];
bzero(aiop, sizeof(*aiop));
aiop->aio_buf = &buf[o];
aiop->aio_fildes = fd;
aiop->aio_offset = off + o;
- aiop->aio_nbytes = s;
+ aiop->aio_nbytes = MAXIO;
error = aio_write(aiop);
if (error != 0)
err(EX_IOERR, "AIO write submit error");
}
+ // Use synchronous writes for the runt of size <= MAXIO
error = pwrite(fd, &buf[o], size, off + o);
if (error < 0)
err(EX_IOERR, "Sync write error");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 12, 6:11 AM (4 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15762363
Default Alt Text
D13275.diff (980 B)
Attached To
Mode
D13275: diskinfo(8): Delete dead code in slog test
Attached
Detach File
Event Timeline
Log In to Comment