Lines Matching refs:wbuf
1639 * read_wbuf - bulk-read from a LEB with a wbuf.
1640 * @wbuf: wbuf that may overlap the read
1648 static int read_wbuf(struct ubifs_wbuf *wbuf, void *buf, int len, int lnum,
1651 const struct ubifs_info *c = wbuf->c;
1655 ubifs_assert(wbuf && lnum >= 0 && lnum < c->leb_cnt && offs >= 0);
1659 spin_lock(&wbuf->lock);
1660 overlap = (lnum == wbuf->lnum && offs + len > wbuf->offs);
1663 spin_unlock(&wbuf->lock);
1667 /* Don't read under wbuf */
1668 rlen = wbuf->offs - offs;
1673 memcpy(buf + rlen, wbuf->buf + offs + rlen - wbuf->offs, len - rlen);
1674 spin_unlock(&wbuf->lock);
1750 struct ubifs_wbuf *wbuf;
1761 wbuf = ubifs_get_wbuf(c, lnum);
1762 if (wbuf)
1763 err = read_wbuf(wbuf, bu->buf, len, lnum, offs);