This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PING^3][PATCH 1/2 v1.1] Consolidate code to initialize nscd dataset header
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: Will Newton <will dot newton at linaro dot org>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Mon, 28 Apr 2014 17:47:27 +0200
- Subject: Re: [PING^3][PATCH 1/2 v1.1] Consolidate code to initialize nscd dataset header
- Authentication-results: sourceware.org; auth=none
- References: <20140401164051 dot GG16484 at spoyarek dot pnq dot redhat dot com> <CANu=Dmiksztx_Qpv=FTsVrcgM-dGTF9cbGWWFKGg06+HcYP=2w at mail dot gmail dot com> <20140407100543 dot GB6181 at spoyarek dot pnq dot redhat dot com> <20140418073447 dot GV11072 at spoyarek dot pnq dot redhat dot com> <20140422094819 dot GG1868 at spoyarek dot pnq dot redhat dot com> <20140428145027 dot GP10922 at spoyarek dot pnq dot redhat dot com>
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.