Skip to content
  • Milan Broz's avatar
    Optimize o_direct read/writes. · e3e3027e
    Milan Broz authored
    * 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
    e3e3027e