Lines Matching defs:wbuf
1674 * read_wbuf - bulk-read from a LEB with a wbuf.
1675 * @wbuf: wbuf that may overlap the read
1683 static int read_wbuf(struct ubifs_wbuf *wbuf, void *buf, int len, int lnum,
1686 const struct ubifs_info *c = wbuf->c;
1690 ubifs_assert(c, wbuf && lnum >= 0 && lnum < c->leb_cnt && offs >= 0);
1694 spin_lock(&wbuf->lock);
1695 overlap = (lnum == wbuf->lnum && offs + len > wbuf->offs);
1698 spin_unlock(&wbuf->lock);
1702 /* Don't read under wbuf */
1703 rlen = wbuf->offs - offs;
1708 memcpy(buf + rlen, wbuf->buf + offs + rlen - wbuf->offs, len - rlen);
1709 spin_unlock(&wbuf->lock);
1791 struct ubifs_wbuf *wbuf;
1802 wbuf = ubifs_get_wbuf(c, lnum);
1803 if (wbuf)
1804 err = read_wbuf(wbuf, bu->buf, len, lnum, offs);