mirror of
https://github.com/samba-team/samba.git
synced 2025-03-01 04:58:35 +03:00
Based on an idea by Volker to optimize cpu usage when parsing struct share_mode_data entries. Add a 64-bit sequence number to the share mode entry, and after the entry is stored back in the db, cache the in-memory version using talloc reparenting into the memcache. The memcache key used is the same struct file_id used as the key into the locking db. On read, check if the locking db version sequence number matches the in-memory cache, and if so reparent the memcache version back onto the required memory context. Saves all the ndr decoding when multiple accesses to the same lock entry happen in succession. Design also improved by Metze and Ira. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Apr 17 22:38:34 CEST 2015 on sn-devel-104