110 Commits

Author SHA1 Message Date
Milan Broz
dfadce6d80 Try to read first sector from device to properly check that device is ready.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@106 36d66b0a-2a48-0410-832c-cd162a569da5
2009-09-08 10:29:50 +00:00
Milan Broz
cee0f0b49f * Move device utils code and provide context parameter (for log).
* Keyfile now must be provided by path, only stdin file descriptor is used (api only).
* Do not call isatty() on closed keyfile descriptor.

Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@93 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-30 18:09:21 +00:00
Milan Broz
bf7819ccef * Add log macros and make logging modre consitent.
* Move command successful messages to verbose level.
* Introduce --debug parameter.

Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@92 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-30 18:07:17 +00:00
Milan Broz
4e471a9b03 * Move memory locking and dm initialization to command layer.
* Increase priority of process if memory is locked.

Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@91 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-30 18:07:00 +00:00
Milan Broz
e3e3027e12 Optimize o_direct read/writes.
* Pad luks header to 512 sector size. We need read/write in whole
sector anyway and space is unused (wiped in luksFormat) so there is
no need for read/seek/write exercise.

* Rework read/write blockwise to not split operation to many pieces.
thanks to Sebastian Andrzej Siewior:

  The buffer has to be aligned due to the O_DIRECT in open(). Currently a small
  blocksize buffer is allocated and everything is read in multiple reads and
  copied back to the original buffer. In my case AFEKSize gets computed to 64000
  which results in 125 reads with 512 bytes each.
  This patch changes this behavior to a single operation where the majority is
  read()/write() plus an optional fixup in case the request is not modulo block
  size.

* Use posix_memalign and check for alignment if available.
Othewise use old align functions. Add autoconf to detect posix_memalign.



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@74 36d66b0a-2a48-0410-832c-cd162a569da5
2009-07-28 09:29:13 +00:00
Milan Broz
78cd6786fb Add some checks for error codes.
(fixes warning: ignoring return value ...)



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@59 36d66b0a-2a48-0410-832c-cd162a569da5
2009-06-22 12:40:31 +00:00
Clemens Fruhwirth
fff08051b0 Segfault bugfix thanks to Oliver Metz.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@48 36d66b0a-2a48-0410-832c-cd162a569da5
2009-04-01 20:36:35 +00:00
Clemens Fruhwirth
98cf0aedf8 Thanks to Ivan Stankovic
* write_lseek_blockwise: declare innerCount outside the if block
* add -Wall to the default CFLAGS
* fix some signedness issues



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@29 36d66b0a-2a48-0410-832c-cd162a569da5
2008-09-01 08:54:05 +00:00
Clemens Fruhwirth
4884064723 Error handling improvement thanks to Erik Edin.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@28 36d66b0a-2a48-0410-832c-cd162a569da5
2008-08-20 10:40:45 +00:00
Clemens Fruhwirth
7dc7b90a9b Initial checking of what was revision 56 on http://luks.endorphin.org/svn/cryptsetup
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@3 36d66b0a-2a48-0410-832c-cd162a569da5
2008-03-22 08:23:35 +00:00