Re: [PATCH 10/22 take 3] UBI: EBA unit

Artem Bityutskiy
2007-03-16T10:14:52Z

On Thu, 2007-03-15 at 11:07 -0800, Andrew Morton wrote:
> > + spin_lock(&ubi->eba.eba_tbl_lock);
> > + ubi_assert(ubi->eba.eba_tbl[idx].recs);
> > + leb_ver = ubi->eba.eba_tbl[idx].recs[lnum].leb_ver;
> > + spin_unlock(&ubi->eba.eba_tbl_lock);
> > +
> > + return leb_ver;
> > +}
>
> I very much doubt that the locking in this function (and in the similar
> ones here) does anything useful.

Well, yes, these are integers.

> > +static inline void leb_unmap(struct ubi_info *ubi, int vol_id, int lnum)
>
> The patch is full of nutty inlining.

Yeah, this file has too much of them.

> Suggestion: just remove all of it. Then reintroduce inlining in only
> those places where a benefit is demonstrable. Reduced code size according to
> /bin/size would be a suitable metric.

OK, thanks.

> > + spin_unlock(&ubi->eba.eba_tbl_lock);
> > +
> > + return pnum;
> > +}
>
> Again, the locking seems pointless.

Thanks for comments, will be fixed.

--
Best regards,
Artem Bityutskiy (Битюцкий Артём)