Lines Matching refs:buf
95 int ubifs_check_node(const struct ubifs_info *c, const void *buf, int lnum, in ubifs_check_node() argument
100 const struct ubifs_ch *ch = buf; in ubifs_check_node()
136 crc = crc32(UBIFS_CRC32_INIT, buf + 8, node_len - 8); in ubifs_check_node()
154 dbg_dump_node(c, buf); in ubifs_check_node()
176 void ubifs_pad(const struct ubifs_info *c, void *buf, int pad) in ubifs_pad() argument
183 struct ubifs_ch *ch = buf; in ubifs_pad()
184 struct ubifs_pad_node *pad_node = buf; in ubifs_pad()
194 crc = crc32(UBIFS_CRC32_INIT, buf + 8, UBIFS_PAD_NODE_SZ - 8); in ubifs_pad()
196 memset(buf + UBIFS_PAD_NODE_SZ, 0, pad); in ubifs_pad()
199 memset(buf, UBIFS_PADDING_BYTE, pad); in ubifs_pad()
361 ubifs_pad(c, wbuf->buf + wbuf->used, wbuf->avail); in ubifs_wbuf_sync_nolock()
362 err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf, wbuf->offs, in ubifs_wbuf_sync_nolock()
504 int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len) in ubifs_wbuf_write_nolock() argument
510 dbg_ntype(((struct ubifs_ch *)buf)->node_type), wbuf->lnum, in ubifs_wbuf_write_nolock()
533 memcpy(wbuf->buf + wbuf->used, buf, len); in ubifs_wbuf_write_nolock()
538 err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf, in ubifs_wbuf_write_nolock()
566 memcpy(wbuf->buf + wbuf->used, buf, wbuf->avail); in ubifs_wbuf_write_nolock()
567 err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf, wbuf->offs, in ubifs_wbuf_write_nolock()
587 err = ubi_leb_write(c->ubi, wbuf->lnum, buf + written, offs, n, in ubifs_wbuf_write_nolock()
604 memcpy(wbuf->buf, buf + written, len); in ubifs_wbuf_write_nolock()
629 dbg_dump_node(c, buf); in ubifs_wbuf_write_nolock()
650 int ubifs_write_node(struct ubifs_info *c, void *buf, int len, int lnum, in ubifs_write_node() argument
656 lnum, offs, dbg_ntype(((struct ubifs_ch *)buf)->node_type), len, in ubifs_write_node()
664 ubifs_prepare_node(c, buf, len, 1); in ubifs_write_node()
665 err = ubi_leb_write(c->ubi, lnum, buf, offs, buf_len, dtype); in ubifs_write_node()
669 dbg_dump_node(c, buf); in ubifs_write_node()
691 int ubifs_read_node_wbuf(struct ubifs_wbuf *wbuf, void *buf, int type, int len, in ubifs_read_node_wbuf() argument
696 struct ubifs_ch *ch = buf; in ubifs_read_node_wbuf()
708 return ubifs_read_node(c, buf, type, len, lnum, offs); in ubifs_read_node_wbuf()
717 memcpy(buf + rlen, wbuf->buf + offs + rlen - wbuf->offs, len - rlen); in ubifs_read_node_wbuf()
722 err = ubi_read(c->ubi, lnum, buf, offs, rlen); in ubifs_read_node_wbuf()
737 err = ubifs_check_node(c, buf, lnum, offs, 0, 0); in ubifs_read_node_wbuf()
753 dbg_dump_node(c, buf); in ubifs_read_node_wbuf()
771 int ubifs_read_node(const struct ubifs_info *c, void *buf, int type, int len, in ubifs_read_node() argument
775 struct ubifs_ch *ch = buf; in ubifs_read_node()
783 err = ubi_read(c->ubi, lnum, buf, offs, len); in ubifs_read_node()
796 err = ubifs_check_node(c, buf, lnum, offs, 0, 0); in ubifs_read_node()
812 dbg_dump_node(c, buf); in ubifs_read_node()
829 wbuf->buf = kmalloc(c->min_io_size, GFP_KERNEL); in ubifs_wbuf_init()
830 if (!wbuf->buf) in ubifs_wbuf_init()
836 kfree(wbuf->buf); in ubifs_wbuf_init()
837 wbuf->buf = NULL; in ubifs_wbuf_init()
868 if (!wbuf->buf) in ubifs_wbuf_add_ino_nolock()