• Home
  • Raw
  • Download

Lines Matching refs:buf

87 int ubifs_leb_read(const struct ubifs_info *c, int lnum, void *buf, int offs,  in ubifs_leb_read()  argument
92 err = ubi_read(c->ubi, lnum, buf, offs, len); in ubifs_leb_read()
105 int ubifs_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs, in ubifs_leb_write() argument
114 err = ubi_leb_write(c->ubi, lnum, buf, offs, len); in ubifs_leb_write()
116 err = dbg_leb_write(c, lnum, buf, offs, len); in ubifs_leb_write()
126 int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len) in ubifs_leb_change() argument
134 err = ubi_leb_change(c->ubi, lnum, buf, len); in ubifs_leb_change()
136 err = dbg_leb_change(c, lnum, buf, len); in ubifs_leb_change()
225 int ubifs_check_node(const struct ubifs_info *c, const void *buf, int lnum, in ubifs_check_node() argument
230 const struct ubifs_ch *ch = buf; in ubifs_check_node()
266 crc = crc32(UBIFS_CRC32_INIT, buf + 8, node_len - 8); in ubifs_check_node()
287 ubifs_dump_node(c, buf); in ubifs_check_node()
295 buf, safe_len, 0); in ubifs_check_node()
318 void ubifs_pad(const struct ubifs_info *c, void *buf, int pad) in ubifs_pad() argument
325 struct ubifs_ch *ch = buf; in ubifs_pad()
326 struct ubifs_pad_node *pad_node = buf; in ubifs_pad()
336 crc = crc32(UBIFS_CRC32_INIT, buf + 8, UBIFS_PAD_NODE_SZ - 8); in ubifs_pad()
338 memset(buf + UBIFS_PAD_NODE_SZ, 0, pad); in ubifs_pad()
341 memset(buf, UBIFS_PADDING_BYTE, pad); in ubifs_pad()
579 ubifs_pad(c, wbuf->buf + wbuf->used, dirt); in ubifs_wbuf_sync_nolock()
580 err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, wbuf->offs, sync_len); in ubifs_wbuf_sync_nolock()
730 int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len) in ubifs_wbuf_write_nolock() argument
736 dbg_ntype(((struct ubifs_ch *)buf)->node_type), in ubifs_wbuf_write_nolock()
766 memcpy(wbuf->buf + wbuf->used, buf, len); in ubifs_wbuf_write_nolock()
769 ubifs_pad(c, wbuf->buf + wbuf->used + len, aligned_len - len); in ubifs_wbuf_write_nolock()
775 err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, in ubifs_wbuf_write_nolock()
810 memcpy(wbuf->buf + wbuf->used, buf, wbuf->avail); in ubifs_wbuf_write_nolock()
811 err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, wbuf->offs, in ubifs_wbuf_write_nolock()
830 err = ubifs_leb_write(c, wbuf->lnum, buf, wbuf->offs, in ubifs_wbuf_write_nolock()
857 err = ubifs_leb_write(c, wbuf->lnum, buf + written, in ubifs_wbuf_write_nolock()
873 memcpy(wbuf->buf, buf + written, min(len, n)); in ubifs_wbuf_write_nolock()
876 ubifs_pad(c, wbuf->buf + len, n - len); in ubifs_wbuf_write_nolock()
879 err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, wbuf->offs, n); in ubifs_wbuf_write_nolock()
895 memcpy(wbuf->buf, buf + written, len); in ubifs_wbuf_write_nolock()
898 ubifs_pad(c, wbuf->buf + len, aligned_len - len); in ubifs_wbuf_write_nolock()
928 ubifs_dump_node(c, buf); in ubifs_wbuf_write_nolock()
949 int ubifs_write_node_hmac(struct ubifs_info *c, void *buf, int len, int lnum, in ubifs_write_node_hmac() argument
955 lnum, offs, dbg_ntype(((struct ubifs_ch *)buf)->node_type), len, in ubifs_write_node_hmac()
965 err = ubifs_prepare_node_hmac(c, buf, len, hmac_offs, 1); in ubifs_write_node_hmac()
969 err = ubifs_leb_write(c, lnum, buf, offs, buf_len); in ubifs_write_node_hmac()
971 ubifs_dump_node(c, buf); in ubifs_write_node_hmac()
990 int ubifs_write_node(struct ubifs_info *c, void *buf, int len, int lnum, in ubifs_write_node() argument
993 return ubifs_write_node_hmac(c, buf, len, lnum, offs, -1); in ubifs_write_node()
1011 int ubifs_read_node_wbuf(struct ubifs_wbuf *wbuf, void *buf, int type, int len, in ubifs_read_node_wbuf() argument
1016 struct ubifs_ch *ch = buf; in ubifs_read_node_wbuf()
1029 return ubifs_read_node(c, buf, type, len, lnum, offs); in ubifs_read_node_wbuf()
1038 memcpy(buf + rlen, wbuf->buf + offs + rlen - wbuf->offs, len - rlen); in ubifs_read_node_wbuf()
1043 err = ubifs_leb_read(c, lnum, buf, offs, rlen, 0); in ubifs_read_node_wbuf()
1054 err = ubifs_check_node(c, buf, lnum, offs, 0, 0); in ubifs_read_node_wbuf()
1070 ubifs_dump_node(c, buf); in ubifs_read_node_wbuf()
1088 int ubifs_read_node(const struct ubifs_info *c, void *buf, int type, int len, in ubifs_read_node() argument
1092 struct ubifs_ch *ch = buf; in ubifs_read_node()
1100 err = ubifs_leb_read(c, lnum, buf, offs, len, 0); in ubifs_read_node()
1110 err = ubifs_check_node(c, buf, lnum, offs, 0, 0); in ubifs_read_node()
1128 ubifs_dump_node(c, buf); in ubifs_read_node()
1146 wbuf->buf = kmalloc(c->max_write_size, GFP_KERNEL); in ubifs_wbuf_init()
1147 if (!wbuf->buf) in ubifs_wbuf_init()
1153 kfree(wbuf->buf); in ubifs_wbuf_init()
1154 wbuf->buf = NULL; in ubifs_wbuf_init()
1188 if (!wbuf->buf) in ubifs_wbuf_add_ino_nolock()