1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Removes 'fast read' plumbing.

- The dd info page mentions a special fast-read framework if no conv=FLAG is
  specified (see bs=N) which I left space for. As it turns out, this is performed already
  so it does not need to be implemented.
This commit is contained in:
Tyler 2021-06-16 12:59:43 -07:00
parent 06dcdc0f1f
commit 19996c10a9

View file

@ -843,17 +843,6 @@ fn read_helper<R: Read, W: Write>(i: &mut Input<R>, o: &mut Output<W>, bsize: us
{
// Local Predicate Fns -----------------------------------------------
#[inline]
fn is_fast_read<R: Read, W: Write>(i: &Input<R>, o: &Output<W>) -> bool
{
// TODO: Enable this once fast_reads are implemented
false &&
i.ibs == o.obs
&& !is_conv(i)
&& !is_block(i)
&& !is_unblock(i)
&& !i.cflags.swab
}
#[inline]
fn is_conv<R: Read>(i: &Input<R>) -> bool
{
i.cflags.ctable.is_some()
@ -882,15 +871,6 @@ fn read_helper<R: Read, W: Write>(i: &mut Input<R>, o: &mut Output<W>, bsize: us
}
}
// ------------------------------------------------------------------
if is_fast_read(&i, &o)
{
// TODO: fast reads are copies performed
// directly to output (without creating any buffers)
// as mentioned in the dd spec.
unimplemented!()
}
else
{
// Read
let mut buf = vec![BUF_INIT_BYTE; bsize];
let mut rstat = match i.cflags.sync
@ -920,7 +900,6 @@ fn read_helper<R: Read, W: Write>(i: &mut Input<R>, o: &mut Output<W>, bsize: us
{
Ok((rstat, buf))
}
}
}
fn print_io_lines(update: &ProgUpdate)