[389-devel] Please review (take 3): Reduce the number of DN normalization

Noriko Hosoi nhosoi at redhat.com
Mon Oct 17 23:05:36 UTC 2011


Special thanks to Rich for his reviews and comments.  I introduced 
slapi_modify_internal_set_pb_ext to pass Slapi_DN which reduces the 
unnecessary Slapi_DN generation and DN normalization.  (The attached 
patch is gzip'ed.)
Thanks,
--noriko

     Reduce the number of DN normalization

     . Adding SLAPI_TARGET_SDN as well as its macros, SLAPI_SEARCH_TARGET_
       SDN SLAPI_ADD_TARGET_SDN, SLAPI_MODIFY_TARGET_SDN, etc.
     . Adding SLAPI_MODRDN_NEWSUPERIOR_SDN.
     . SLAPI_TARGET_DN and SLAPI_MODRDN_NEWSUPERIOR are kept for the back-
       ward compatibility.  But they are marked as deprecated.  They are
       pointing dn in SLAPI_TARGET_SDN and SLAPI_MODRDN_NEWSUPERIOR_SDN,
       respectively.
     . slapi_pblock_set(.., SLAPI_TARGET_DN/SLAPI_MODRDN_NEWSUPERIOR, dn)
       takes dn string and reset Slapi_DN to SLAPI_TARGET_SDN/SLAPI_MODRDN_
       NEWSUPERIOR_SDN.
     . slapi_pblock_get(.., SLAPI_TARGET_DN/SLAPI_MODRDN_NEWSUPERIOR, &dn)
       retrieves dn out of SLAPI_TARGET_SDN/SLAPI_MODRDN_NEWSUPERIOR_SDN.
     . Replacing slapi_dn_normalization_ext call with generating Slapi_DN
       APIs (e.g., slapi_sdn_new_dn_...) as much as possible and stash it
       in pblock using SLAPI_TARGET_SDN.
     . When a normalized DN string is needed, get it using 
slapi_sdn_get_[n]dn
       from the stashed Slapi_DN.
     . Introduced a new field to Slapi_DN.
       "udn" for the original DN; "dn" is a normalized DN; "ndn" is a case-
       ignored normalized DN.
       Taking advantage of the knowledge of the stage of the DN, call the
       most efficient DN creating API (e.g., slapi_sdn_new_dn_... vs.
       slapi_sdn_new_normdn_... vs. slapi_sdn_new_ndn_...)

     Others
     . Replacing inefficient array assignment with memset (acl.c) and
       memcpy (idl_common.c).
     . Fixing invalid memory access in LASDnsBuild 
(lib/libaccess/lasdns.cpp).
     . Fixing compiler warnings.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Reduce-the-number-of-DN-normalization.patch.gz
Type: application/x-gzip-compressed
Size: 114378 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/389-devel/attachments/20111017/d9c37493/attachment-0001.bin 


More information about the 389-devel mailing list