git: aesni(4): Properly align the context memory using out kmalloc(9) feature

Sepherosa Ziehau sephe at crater.dragonflybsd.org
Mon Aug 1 21:20:33 PDT 2011


commit 35b7857839738a2813bd18f098ebc725254a70a8
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date:   Tue Aug 2 12:11:12 2011 +0800

    aesni(4): Properly align the context memory using out kmalloc(9) feature
    
    DragonFly's kmalloc(9) will return 2^n aligned memory if the allocation
    size is 2^n; use this feature instead of using a local hack.
    
    While I'm here, release the spinlock and call kmalloc(9) w/ M_WAITOK;
    the check/free race is absolutely acceptable here, but the failure
    of kmalloc(9) w/ M_NOWAIT is probably not accetable on the init path.

Summary of changes:
 sys/dev/crypto/aesni/aesni.c |   40 ++++++++++++++++++++++++----------------
 sys/dev/crypto/aesni/aesni.h |    5 ++---
 2 files changed, 26 insertions(+), 19 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/35b7857839738a2813bd18f098ebc725254a70a8


-- 
DragonFly BSD source repository





More information about the Commits mailing list