GNU bug report logs -
#9157
[PATCH] dd: sparse conv flag
Previous Next
Reported by: Roman Rybalko <devel <at> romanr.info>
Date: Sat, 23 Jul 2011 22:42:04 UTC
Severity: normal
Tags: patch
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
I recently noticed a use case for this feature:
https://review.openstack.org/#change,4435
But I managed to forget we had a patch pending for this,
and spent a couple of hours writing my own version :p
Well at least it's good practise for reviewing Roman's...
I notice Roman's seeks() the output for any run of NULs,
while mine only considers blocks of the full output block size.
Checking the full block is a bit more CPU efficient,
and gives a bit more control, so I'm marginally leaning
towards doing that?
Also Roman's doesn't handle the case where a seek
is done at the end of the file. In that case an ftruncate()
or write() is needed to correctly set the size.
Notes on my version attached are:
I first need to refactor is_nul() for use by cp too.
My version is advisory also
We may need to coalesce seeks to larger ones? something like cache_round()?
I thought it better to keep the code simple in this regard though
as it's probably not of practical concern.
I used conv= for bsd compat, rather than oflag=.
Needs tests and docs yet.
cheers,
Pádraig.
[dd-sparse.patch (text/x-patch, attachment)]
This bug report was last modified 13 years and 182 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.