Lines Matching defs:wbuf
1675 * read_wbuf - bulk-read from a LEB with a wbuf.
1676 * @wbuf: wbuf that may overlap the read
1684 static int read_wbuf(struct ubifs_wbuf *wbuf, void *buf, int len, int lnum,
1687 const struct ubifs_info *c = wbuf->c;
1691 ubifs_assert(c, wbuf && lnum >= 0 && lnum < c->leb_cnt && offs >= 0);
1695 spin_lock(&wbuf->lock);
1696 overlap = (lnum == wbuf->lnum && offs + len > wbuf->offs);
1699 spin_unlock(&wbuf->lock);
1703 /* Don't read under wbuf */
1704 rlen = wbuf->offs - offs;
1709 memcpy(buf + rlen, wbuf->buf + offs + rlen - wbuf->offs, len - rlen);
1710 spin_unlock(&wbuf->lock);
1792 struct ubifs_wbuf *wbuf;
1803 wbuf = ubifs_get_wbuf(c, lnum);
1804 if (wbuf)
1805 err = read_wbuf(wbuf, bu->buf, len, lnum, offs);