diff options
Diffstat (limited to 'fs/ubifs/io.c')
-rw-r--r-- | fs/ubifs/io.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c index 762a7d6cec73..e589fedaf1ef 100644 --- a/fs/ubifs/io.c +++ b/fs/ubifs/io.c | |||
@@ -297,7 +297,7 @@ static enum hrtimer_restart wbuf_timer_callback_nolock(struct hrtimer *timer) | |||
297 | { | 297 | { |
298 | struct ubifs_wbuf *wbuf = container_of(timer, struct ubifs_wbuf, timer); | 298 | struct ubifs_wbuf *wbuf = container_of(timer, struct ubifs_wbuf, timer); |
299 | 299 | ||
300 | dbg_io("jhead %d", wbuf->jhead); | 300 | dbg_io("jhead %s", dbg_jhead(wbuf->jhead)); |
301 | wbuf->need_sync = 1; | 301 | wbuf->need_sync = 1; |
302 | wbuf->c->need_wbuf_sync = 1; | 302 | wbuf->c->need_wbuf_sync = 1; |
303 | ubifs_wake_up_bgt(wbuf->c); | 303 | ubifs_wake_up_bgt(wbuf->c); |
@@ -314,7 +314,8 @@ static void new_wbuf_timer_nolock(struct ubifs_wbuf *wbuf) | |||
314 | 314 | ||
315 | if (wbuf->no_timer) | 315 | if (wbuf->no_timer) |
316 | return; | 316 | return; |
317 | dbg_io("set timer for jhead %d, %llu-%llu millisecs", wbuf->jhead, | 317 | dbg_io("set timer for jhead %s, %llu-%llu millisecs", |
318 | dbg_jhead(wbuf->jhead), | ||
318 | div_u64(ktime_to_ns(wbuf->softlimit), USEC_PER_SEC), | 319 | div_u64(ktime_to_ns(wbuf->softlimit), USEC_PER_SEC), |
319 | div_u64(ktime_to_ns(wbuf->softlimit) + wbuf->delta, | 320 | div_u64(ktime_to_ns(wbuf->softlimit) + wbuf->delta, |
320 | USEC_PER_SEC)); | 321 | USEC_PER_SEC)); |
@@ -351,8 +352,8 @@ int ubifs_wbuf_sync_nolock(struct ubifs_wbuf *wbuf) | |||
351 | /* Write-buffer is empty or not seeked */ | 352 | /* Write-buffer is empty or not seeked */ |
352 | return 0; | 353 | return 0; |
353 | 354 | ||
354 | dbg_io("LEB %d:%d, %d bytes, jhead %d", | 355 | dbg_io("LEB %d:%d, %d bytes, jhead %s", |
355 | wbuf->lnum, wbuf->offs, wbuf->used, wbuf->jhead); | 356 | wbuf->lnum, wbuf->offs, wbuf->used, dbg_jhead(wbuf->jhead)); |
356 | ubifs_assert(!(c->vfs_sb->s_flags & MS_RDONLY)); | 357 | ubifs_assert(!(c->vfs_sb->s_flags & MS_RDONLY)); |
357 | ubifs_assert(!(wbuf->avail & 7)); | 358 | ubifs_assert(!(wbuf->avail & 7)); |
358 | ubifs_assert(wbuf->offs + c->min_io_size <= c->leb_size); | 359 | ubifs_assert(wbuf->offs + c->min_io_size <= c->leb_size); |
@@ -401,7 +402,7 @@ int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf, int lnum, int offs, | |||
401 | { | 402 | { |
402 | const struct ubifs_info *c = wbuf->c; | 403 | const struct ubifs_info *c = wbuf->c; |
403 | 404 | ||
404 | dbg_io("LEB %d:%d, jhead %d", lnum, offs, wbuf->jhead); | 405 | dbg_io("LEB %d:%d, jhead %s", lnum, offs, dbg_jhead(wbuf->jhead)); |
405 | ubifs_assert(lnum >= 0 && lnum < c->leb_cnt); | 406 | ubifs_assert(lnum >= 0 && lnum < c->leb_cnt); |
406 | ubifs_assert(offs >= 0 && offs <= c->leb_size); | 407 | ubifs_assert(offs >= 0 && offs <= c->leb_size); |
407 | ubifs_assert(offs % c->min_io_size == 0 && !(offs & 7)); | 408 | ubifs_assert(offs % c->min_io_size == 0 && !(offs & 7)); |
@@ -508,9 +509,9 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len) | |||
508 | struct ubifs_info *c = wbuf->c; | 509 | struct ubifs_info *c = wbuf->c; |
509 | int err, written, n, aligned_len = ALIGN(len, 8), offs; | 510 | int err, written, n, aligned_len = ALIGN(len, 8), offs; |
510 | 511 | ||
511 | dbg_io("%d bytes (%s) to jhead %d wbuf at LEB %d:%d", len, | 512 | dbg_io("%d bytes (%s) to jhead %s wbuf at LEB %d:%d", len, |
512 | dbg_ntype(((struct ubifs_ch *)buf)->node_type), wbuf->jhead, | 513 | dbg_ntype(((struct ubifs_ch *)buf)->node_type), |
513 | wbuf->lnum, wbuf->offs + wbuf->used); | 514 | dbg_jhead(wbuf->jhead), wbuf->lnum, wbuf->offs + wbuf->used); |
514 | ubifs_assert(len > 0 && wbuf->lnum >= 0 && wbuf->lnum < c->leb_cnt); | 515 | ubifs_assert(len > 0 && wbuf->lnum >= 0 && wbuf->lnum < c->leb_cnt); |
515 | ubifs_assert(wbuf->offs >= 0 && wbuf->offs % c->min_io_size == 0); | 516 | ubifs_assert(wbuf->offs >= 0 && wbuf->offs % c->min_io_size == 0); |
516 | ubifs_assert(!(wbuf->offs & 7) && wbuf->offs <= c->leb_size); | 517 | ubifs_assert(!(wbuf->offs & 7) && wbuf->offs <= c->leb_size); |
@@ -535,8 +536,8 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len) | |||
535 | memcpy(wbuf->buf + wbuf->used, buf, len); | 536 | memcpy(wbuf->buf + wbuf->used, buf, len); |
536 | 537 | ||
537 | if (aligned_len == wbuf->avail) { | 538 | if (aligned_len == wbuf->avail) { |
538 | dbg_io("flush jhead %d wbuf to LEB %d:%d", | 539 | dbg_io("flush jhead %s wbuf to LEB %d:%d", |
539 | wbuf->jhead, wbuf->lnum, wbuf->offs); | 540 | dbg_jhead(wbuf->jhead), wbuf->lnum, wbuf->offs); |
540 | err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf, | 541 | err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf, |
541 | wbuf->offs, c->min_io_size, | 542 | wbuf->offs, c->min_io_size, |
542 | wbuf->dtype); | 543 | wbuf->dtype); |
@@ -564,8 +565,8 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len) | |||
564 | * minimal I/O unit. We have to fill and flush write-buffer and switch | 565 | * minimal I/O unit. We have to fill and flush write-buffer and switch |
565 | * to the next min. I/O unit. | 566 | * to the next min. I/O unit. |
566 | */ | 567 | */ |
567 | dbg_io("flush jhead %d wbuf to LEB %d:%d", | 568 | dbg_io("flush jhead %s wbuf to LEB %d:%d", |
568 | wbuf->jhead, wbuf->lnum, wbuf->offs); | 569 | dbg_jhead(wbuf->jhead), wbuf->lnum, wbuf->offs); |
569 | memcpy(wbuf->buf + wbuf->used, buf, wbuf->avail); | 570 | memcpy(wbuf->buf + wbuf->used, buf, wbuf->avail); |
570 | err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf, wbuf->offs, | 571 | err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf, wbuf->offs, |
571 | c->min_io_size, wbuf->dtype); | 572 | c->min_io_size, wbuf->dtype); |
@@ -698,8 +699,8 @@ int ubifs_read_node_wbuf(struct ubifs_wbuf *wbuf, void *buf, int type, int len, | |||
698 | int err, rlen, overlap; | 699 | int err, rlen, overlap; |
699 | struct ubifs_ch *ch = buf; | 700 | struct ubifs_ch *ch = buf; |
700 | 701 | ||
701 | dbg_io("LEB %d:%d, %s, length %d, jhead %d", lnum, offs, | 702 | dbg_io("LEB %d:%d, %s, length %d, jhead %s", lnum, offs, |
702 | dbg_ntype(type), len, wbuf->jhead); | 703 | dbg_ntype(type), len, dbg_jhead(wbuf->jhead)); |
703 | ubifs_assert(wbuf && lnum >= 0 && lnum < c->leb_cnt && offs >= 0); | 704 | ubifs_assert(wbuf && lnum >= 0 && lnum < c->leb_cnt && offs >= 0); |
704 | ubifs_assert(!(offs & 7) && offs < c->leb_size); | 705 | ubifs_assert(!(offs & 7) && offs < c->leb_size); |
705 | ubifs_assert(type >= 0 && type < UBIFS_NODE_TYPES_CNT); | 706 | ubifs_assert(type >= 0 && type < UBIFS_NODE_TYPES_CNT); |