40 static int scan_padding_bytes(
void *
buf,
int len)
50 if (!pad_len || (pad_len & 7))
53 dbg_scan(
"%d padding bytes", pad_len);
77 if (magic == 0xFFFFFFFF) {
78 dbg_scan(
"hit empty space at LEB %d:%d", lnum, offs);
83 return scan_padding_bytes(buf, len);
101 offs + node_len + pad_len > c->
leb_size) {
111 if ((node_len + pad_len) & 7) {
114 offs, offs + node_len + pad_len);
118 dbg_scan(
"%d bytes padded at LEB %d:%d, offset now %d", pad_len,
119 lnum, offs,
ALIGN(offs + node_len + pad_len, 8));
137 int offs,
void *sbuf)
142 dbg_scan(
"scan LEB %d:%d", lnum, offs);
149 INIT_LIST_HEAD(&sleb->
nodes);
154 ubifs_err(
"cannot read %d bytes from LEB %d:%d, error %d",
155 c->
leb_size - offs, lnum, offs, err);
179 dbg_scan(
"stop scanning LEB %d at offset %d", lnum, offs);
220 key_read(c, &ino->
key, &snod->
key);
223 invalid_key_init(c, &snod->
key);
243 ubifs_err(
"corruption at LEB %d:%d", lnum, offs);
247 ubifs_err(
"first %d bytes from LEB %d:%d", len, lnum, offs);
270 void *buf = sbuf +
offs;
282 dbg_scan(
"look at LEB %d:%d (%d bytes left)",
328 ubifs_err(
"empty space starts at non-aligned offset %d",
335 for (; len > 4; offs += 4, buf = buf + 4, len -= 4)
338 for (;
len; offs++, buf++, len--)
341 ubifs_err(
"corrupt empty space at LEB %d:%d",
351 ubifs_err(
"LEB %d scanning failed", lnum);
358 ubifs_err(
"LEB %d scanning failed, error %d", lnum, err);
373 while (!list_empty(head)) {