[RFC PATCH 3/7] PID namespace translation support

Ákos Uzonyi uzonyi.akos at gmail.com
Thu Jun 11 10:01:54 UTC 2020


On Wed, 10 Jun 2020 at 23:09, Eugene Syromiatnikov <esyr at redhat.com> wrote:
> On Mon, Jun 08, 2020 at 09:21:26PM +0200, Ã kos Uzonyi wrote:
> > On Mon, 8 Jun 2020 at 21:16, Ã kos Uzonyi <uzonyi.akos at gmail.com> wrote:
> > > +static uint8_t
> > > +lg2(uint64_t n)
> > > +{
> > > +       uint8_t res = 0;
> > > +       while (n) {
> > > +               res++;
> > > +               n >>= 1;
> > > +       }
> > > +       return res;
> > > +}
> >
> > Should it be moved to utils.c?
>
> There are ilog2* functions present in util.c now, I think it's better
> to switch to them.  It probably needs a bit of rework, as it was
> originally written for using with klong type only.

Ok, thanks.

Then I move them to defs.h, leave both ilog2_32 and ilog2_64 functions
defined, and use ilog2_32 in pidns.c.


More information about the Strace-devel mailing list