[PATCH] caching optimization in share mode locks.

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Apr 8 08:39:38 MDT 2015


On Wed, Apr 08, 2015 at 04:36:01PM +0200, Stefan (metze) Metzmacher wrote:
> Am 08.04.2015 um 16:31 schrieb Volker Lendecke:
> > On Tue, Apr 07, 2015 at 09:02:32AM +0200, Stefan (metze) Metzmacher wrote:
> >> We should also use integer types (hyper/uint64_t) in the idl instead of
> >> an uint8 array.
> >> BVAL() would used to extract the current sequence number and we would
> >> avoid the ugly
> >>
> >> +	/* Update the sequence number. */
> >> +	memcpy(&seq, d->sequence_number, 8);
> >> +	seq += 1;
> >> +	memcpy(d->sequence_number, &seq, 8);
> >>
> >> and could used use d->sequence_number += 1;
> > 
> > Do we have to encode the sequence number in IDL at all? I'd rather go
> > put the sequence number in front of the data without any ndr involvement
> > to avoid reading ndr marshalled data directly.
> 
> Sure for the fast path, we'd just do BVAL(raw_buffer, 0)
> as we know about the first 8 bytes.
> 
> But it's nice to to have this in ndr_push/pull/print.

To me anything from ndr_push is an opaque blob. How can we be sure that
this will be the first 8 bytes? We should never assume a specific layout
of the data we hand over to ndr.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de


More information about the samba-technical mailing list