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

From: Artem Bityutskiy
Date: Fri Mar 16 2007 - 06:15:23 EST


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 (ÐÐÑÑÑÐÐÐ ÐÑÑÑÐ)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/