This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PING^3][PATCH 1/2 v1.1] Consolidate code to initialize nscd dataset header


On Mon, Apr 28, 2014 at 08:20:27PM +0530, Siddhesh Poyarekar wrote:
> Ping!
> 
> On Tue, Apr 22, 2014 at 03:18:20PM +0530, Siddhesh Poyarekar wrote:
> > Ping!
> > 
> > On Fri, Apr 18, 2014 at 01:04:47PM +0530, Siddhesh Poyarekar wrote:
> > > Ping!
> > > 
> > > On Mon, Apr 07, 2014 at 03:35:43PM +0530, Siddhesh Poyarekar wrote:
> > > > On Mon, Apr 07, 2014 at 10:11:34AM +0100, Will Newton wrote:
> > > > > > -      /* Fill in the rest of the dataset.  */
> > > > > > -      dataset->head.allocsize = total + req->key_len;
> > > > > > -      dataset->head.recsize = total - offsetof (struct dataset, resp);
> > > > > > -      dataset->head.notfound = false;
> > > > > > -      dataset->head.nreloads = he == NULL ? 0 : (dh->nreloads + 1);
> > > > > > -      dataset->head.usable = true;
> > > > > > -
> > > > > > -      /* Compute the timeout time.  */
> > > > > > -      dataset->head.ttl = ttl == INT32_MAX ? db->postimeout : ttl;
> > > > > > -      timeout = dataset->head.timeout = time (NULL) + dataset->head.ttl;
> > > > > > +      timeout = datahead_init_pos (&dataset->head, total + req->key_len,
> > > > > > +                                  total - offsetof (struct dataset, resp),
> > > > > > +                                  he == NULL ? 0 : (dh->nreloads + 1),
> > > > > 
> > > > > These brackets are redundant (and similar cases in other patch hunks).
> > > > 
> > > > Fixed.
> > > > 
> > > > > > -             dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
> > > > > > -             dataset->head.recsize = total;
> > > > > > -             dataset->head.notfound = true;
> > > > > > -             dataset->head.nreloads = 0;
> > > > > > -             dataset->head.usable = true;
> > > > > > -
> > > > > > -             /* Compute the timeout time.  */
> > > > > > -             timeout = dataset->head.timeout = t + db->negtimeout;
> > > > > > +             timeout = datahead_init_neg (&dataset->head,
> > > > > > +                                          (sizeof (struct dataset)
> > > > > > +                                           + req->key_len), total,
> > > > > 
> > > > > These brackets are also redundant (and similar elsewhere).
> > > > 
> > > > That is deliberate for correct indentation.
> > > > 
> > > > > > -  dataset->head.allocsize = sizeof (*dataset) + req->key_len;
> > > > > > -  dataset->head.recsize = sizeof (innetgroup_response_header);
> > > > > > -  dataset->head.notfound = result->head.notfound;
> > > > > > -  dataset->head.nreloads = he == NULL ? 0 : (dh->nreloads + 1);
> > > > > > -  dataset->head.usable = true;
> > > > > > -  dataset->head.ttl = result->head.ttl;
> > > > > > +  datahead_init_pos (&dataset->head, sizeof (*dataset) + req->key_len,
> > > > > > +                    sizeof (innetgroup_response_header),
> > > > > > +                    he == NULL ? 0 : (dh->nreloads + 1), result->head.ttl);
> > > > > 
> > > > > Is this correct? Won't this set notfound to false rather than
> > > > > result->head.notfound?
> > > > 
> > > > Ahh yes.  Fixed.
> > > > 
> > > > Here's an updated version now.  I haven't posted the ChangeLog since
> > > > it is unchanged.
> > > > 
> > > > Thanks,
> > > > Siddhesh
> > > > 
looks ok.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]