[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#3652) Add access_control() hook to overlays



ando@sys-net.it wrote:

>One thing that scares me is that when running thru the stack of overlays,
>if the SLAP_DBFLAG_OVERLAY flag is not set in the database structure, the
>structure is copied in a temporary and the flag is set for the duration of
>the operation; then the original copy is set again into the o_bd field of
>the operation.
>
>I'm not sure if this is strictly required (why don't we just set that flag
>into the original structure permanetly?) or if it poses a light or severe
>performance penalty.
>
The flag indicates that the current structure is a temporary copy. There 
may be a better way to do things. The reason it's copied is because the 
op->o_bd->bd_info pointer must be set for each overlay that gets 
invoked. And since the database structure is a shared resource, we can't 
just write into the original, and we can't just make one copy that's 
used everywhere (without adding a mutex, which is not a good idea.)

Come to think of it, if we just added the pointer to the Operation 
structure we could eliminate the copy. That would require updating all 
the overlays to use the Operation pointer of course.

-- 
  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support