diff options
| author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-06-03 07:12:10 -0400 |
|---|---|---|
| committer | Artem Bityutskiy <dedekind1@gmail.com> | 2011-07-04 03:54:33 -0400 |
| commit | 987226a5d3a356792650f8e9028132a79815f6ef (patch) | |
| tree | f230d62a1f05f80e99ed1d6836bfbce84b74c250 | |
| parent | d304820a1f6cdacab691bbcb7faa35ec631c6398 (diff) | |
UBIFS: switch to ubifs_leb_write
Stop using 'ubi_leb_write()' directly and switch to the 'ubifs_leb_write()'
helper.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| -rw-r--r-- | fs/ubifs/io.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c index f58f11bed38..a0c5fb4b6fa 100644 --- a/fs/ubifs/io.c +++ b/fs/ubifs/io.c | |||
| @@ -523,14 +523,10 @@ int ubifs_wbuf_sync_nolock(struct ubifs_wbuf *wbuf) | |||
| 523 | dirt = sync_len - wbuf->used; | 523 | dirt = sync_len - wbuf->used; |
| 524 | if (dirt) | 524 | if (dirt) |
| 525 | ubifs_pad(c, wbuf->buf + wbuf->used, dirt); | 525 | ubifs_pad(c, wbuf->buf + wbuf->used, dirt); |
| 526 | err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf, wbuf->offs, | 526 | err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, wbuf->offs, sync_len, |
| 527 | sync_len, wbuf->dtype); | 527 | wbuf->dtype); |
| 528 | if (err) { | 528 | if (err) |
| 529 | ubifs_err("cannot write %d bytes to LEB %d:%d", | ||
| 530 | sync_len, wbuf->lnum, wbuf->offs); | ||
| 531 | dbg_dump_stack(); | ||
| 532 | return err; | 529 | return err; |
| 533 | } | ||
| 534 | 530 | ||
| 535 | spin_lock(&wbuf->lock); | 531 | spin_lock(&wbuf->lock); |
| 536 | wbuf->offs += sync_len; | 532 | wbuf->offs += sync_len; |
| @@ -722,9 +718,9 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len) | |||
| 722 | if (aligned_len == wbuf->avail) { | 718 | if (aligned_len == wbuf->avail) { |
| 723 | dbg_io("flush jhead %s wbuf to LEB %d:%d", | 719 | dbg_io("flush jhead %s wbuf to LEB %d:%d", |
| 724 | dbg_jhead(wbuf->jhead), wbuf->lnum, wbuf->offs); | 720 | dbg_jhead(wbuf->jhead), wbuf->lnum, wbuf->offs); |
| 725 | err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf, | 721 | err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, |
| 726 | wbuf->offs, wbuf->size, | 722 | wbuf->offs, wbuf->size, |
| 727 | wbuf->dtype); | 723 | wbuf->dtype); |
| 728 | if (err) | 724 | if (err) |
| 729 | goto out; | 725 | goto out; |
| 730 | 726 | ||
| @@ -759,8 +755,8 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len) | |||
| 759 | dbg_io("flush jhead %s wbuf to LEB %d:%d", | 755 | dbg_io("flush jhead %s wbuf to LEB %d:%d", |
| 760 | dbg_jhead(wbuf->jhead), wbuf->lnum, wbuf->offs); | 756 | dbg_jhead(wbuf->jhead), wbuf->lnum, wbuf->offs); |
| 761 | memcpy(wbuf->buf + wbuf->used, buf, wbuf->avail); | 757 | memcpy(wbuf->buf + wbuf->used, buf, wbuf->avail); |
| 762 | err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf, wbuf->offs, | 758 | err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, wbuf->offs, |
| 763 | wbuf->size, wbuf->dtype); | 759 | wbuf->size, wbuf->dtype); |
| 764 | if (err) | 760 | if (err) |
| 765 | goto out; | 761 | goto out; |
| 766 | 762 | ||
| @@ -778,8 +774,8 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len) | |||
| 778 | */ | 774 | */ |
| 779 | dbg_io("write %d bytes to LEB %d:%d", | 775 | dbg_io("write %d bytes to LEB %d:%d", |
| 780 | wbuf->size, wbuf->lnum, wbuf->offs); | 776 | wbuf->size, wbuf->lnum, wbuf->offs); |
| 781 | err = ubi_leb_write(c->ubi, wbuf->lnum, buf, wbuf->offs, | 777 | err = ubifs_leb_write(c, wbuf->lnum, buf, wbuf->offs, |
| 782 | wbuf->size, wbuf->dtype); | 778 | wbuf->size, wbuf->dtype); |
| 783 | if (err) | 779 | if (err) |
| 784 | goto out; | 780 | goto out; |
| 785 | 781 | ||
| @@ -800,8 +796,8 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len) | |||
| 800 | n <<= c->max_write_shift; | 796 | n <<= c->max_write_shift; |
| 801 | dbg_io("write %d bytes to LEB %d:%d", n, wbuf->lnum, | 797 | dbg_io("write %d bytes to LEB %d:%d", n, wbuf->lnum, |
| 802 | wbuf->offs); | 798 | wbuf->offs); |
| 803 | err = ubi_leb_write(c->ubi, wbuf->lnum, buf + written, | 799 | err = ubifs_leb_write(c, wbuf->lnum, buf + written, |
| 804 | wbuf->offs, n, wbuf->dtype); | 800 | wbuf->offs, n, wbuf->dtype); |
| 805 | if (err) | 801 | if (err) |
| 806 | goto out; | 802 | goto out; |
| 807 | wbuf->offs += n; | 803 | wbuf->offs += n; |
| @@ -883,13 +879,9 @@ int ubifs_write_node(struct ubifs_info *c, void *buf, int len, int lnum, | |||
| 883 | return -EROFS; | 879 | return -EROFS; |
| 884 | 880 | ||
| 885 | ubifs_prepare_node(c, buf, len, 1); | 881 | ubifs_prepare_node(c, buf, len, 1); |
| 886 | err = ubi_leb_write(c->ubi, lnum, buf, offs, buf_len, dtype); | 882 | err = ubifs_leb_write(c, lnum, buf, offs, buf_len, dtype); |
| 887 | if (err) { | 883 | if (err) |
| 888 | ubifs_err("cannot write %d bytes to LEB %d:%d, error %d", | ||
| 889 | buf_len, lnum, offs, err); | ||
| 890 | dbg_dump_node(c, buf); | 884 | dbg_dump_node(c, buf); |
| 891 | dbg_dump_stack(); | ||
| 892 | } | ||
| 893 | 885 | ||
| 894 | return err; | 886 | return err; |
| 895 | } | 887 | } |
