aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-06-03 07:22:05 -0400
committerArtem Bityutskiy <dedekind1@gmail.com>2011-07-04 03:54:33 -0400
commitd3b2578f56e0a77b9e261d83e9b5a0a666b82980 (patch)
tree99a4760399d97ffad28f0a7426682cbcd664056e /fs/ubifs
parent987226a5d3a356792650f8e9028132a79815f6ef (diff)
UBIFS: switch to I/O helpers
Switch the rest of direct UBI calls to UBIFS helper functions. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs')
-rw-r--r--fs/ubifs/log.c4
-rw-r--r--fs/ubifs/lpt.c16
-rw-r--r--fs/ubifs/recovery.c14
-rw-r--r--fs/ubifs/sb.c4
-rw-r--r--fs/ubifs/super.c2
5 files changed, 19 insertions, 21 deletions
diff --git a/fs/ubifs/log.c b/fs/ubifs/log.c
index fabfb53c4fee..f9fd068d1ae0 100644
--- a/fs/ubifs/log.c
+++ b/fs/ubifs/log.c
@@ -262,7 +262,7 @@ int ubifs_add_bud_to_log(struct ubifs_info *c, int jhead, int lnum, int offs)
262 * an unclean reboot, because the target LEB might have been 262 * an unclean reboot, because the target LEB might have been
263 * unmapped, but not yet physically erased. 263 * unmapped, but not yet physically erased.
264 */ 264 */
265 err = ubi_leb_map(c->ubi, bud->lnum, UBI_SHORTTERM); 265 err = ubifs_leb_map(c, bud->lnum, UBI_SHORTTERM);
266 if (err) 266 if (err)
267 goto out_unlock; 267 goto out_unlock;
268 } 268 }
@@ -283,8 +283,6 @@ int ubifs_add_bud_to_log(struct ubifs_info *c, int jhead, int lnum, int offs)
283 return 0; 283 return 0;
284 284
285out_unlock: 285out_unlock:
286 if (err != -EAGAIN)
287 ubifs_ro_mode(c, err);
288 mutex_unlock(&c->log_mutex); 286 mutex_unlock(&c->log_mutex);
289 kfree(ref); 287 kfree(ref);
290 kfree(bud); 288 kfree(bud);
diff --git a/fs/ubifs/lpt.c b/fs/ubifs/lpt.c
index 8b9ee9fe0a41..6189c74d97f0 100644
--- a/fs/ubifs/lpt.c
+++ b/fs/ubifs/lpt.c
@@ -701,8 +701,8 @@ int ubifs_create_dflt_lpt(struct ubifs_info *c, int *main_lebs, int lpt_first,
701 alen = ALIGN(len, c->min_io_size); 701 alen = ALIGN(len, c->min_io_size);
702 set_ltab(c, lnum, c->leb_size - alen, alen - len); 702 set_ltab(c, lnum, c->leb_size - alen, alen - len);
703 memset(p, 0xff, alen - len); 703 memset(p, 0xff, alen - len);
704 err = ubi_leb_change(c->ubi, lnum++, buf, alen, 704 err = ubifs_leb_change(c, lnum++, buf, alen,
705 UBI_SHORTTERM); 705 UBI_SHORTTERM);
706 if (err) 706 if (err)
707 goto out; 707 goto out;
708 p = buf; 708 p = buf;
@@ -732,8 +732,8 @@ int ubifs_create_dflt_lpt(struct ubifs_info *c, int *main_lebs, int lpt_first,
732 set_ltab(c, lnum, c->leb_size - alen, 732 set_ltab(c, lnum, c->leb_size - alen,
733 alen - len); 733 alen - len);
734 memset(p, 0xff, alen - len); 734 memset(p, 0xff, alen - len);
735 err = ubi_leb_change(c->ubi, lnum++, buf, alen, 735 err = ubifs_leb_change(c, lnum++, buf, alen,
736 UBI_SHORTTERM); 736 UBI_SHORTTERM);
737 if (err) 737 if (err)
738 goto out; 738 goto out;
739 p = buf; 739 p = buf;
@@ -780,8 +780,8 @@ int ubifs_create_dflt_lpt(struct ubifs_info *c, int *main_lebs, int lpt_first,
780 alen = ALIGN(len, c->min_io_size); 780 alen = ALIGN(len, c->min_io_size);
781 set_ltab(c, lnum, c->leb_size - alen, alen - len); 781 set_ltab(c, lnum, c->leb_size - alen, alen - len);
782 memset(p, 0xff, alen - len); 782 memset(p, 0xff, alen - len);
783 err = ubi_leb_change(c->ubi, lnum++, buf, alen, 783 err = ubifs_leb_change(c, lnum++, buf, alen,
784 UBI_SHORTTERM); 784 UBI_SHORTTERM);
785 if (err) 785 if (err)
786 goto out; 786 goto out;
787 p = buf; 787 p = buf;
@@ -806,7 +806,7 @@ int ubifs_create_dflt_lpt(struct ubifs_info *c, int *main_lebs, int lpt_first,
806 alen = ALIGN(len, c->min_io_size); 806 alen = ALIGN(len, c->min_io_size);
807 set_ltab(c, lnum, c->leb_size - alen, alen - len); 807 set_ltab(c, lnum, c->leb_size - alen, alen - len);
808 memset(p, 0xff, alen - len); 808 memset(p, 0xff, alen - len);
809 err = ubi_leb_change(c->ubi, lnum++, buf, alen, UBI_SHORTTERM); 809 err = ubifs_leb_change(c, lnum++, buf, alen, UBI_SHORTTERM);
810 if (err) 810 if (err)
811 goto out; 811 goto out;
812 p = buf; 812 p = buf;
@@ -826,7 +826,7 @@ int ubifs_create_dflt_lpt(struct ubifs_info *c, int *main_lebs, int lpt_first,
826 826
827 /* Write remaining buffer */ 827 /* Write remaining buffer */
828 memset(p, 0xff, alen - len); 828 memset(p, 0xff, alen - len);
829 err = ubi_leb_change(c->ubi, lnum, buf, alen, UBI_SHORTTERM); 829 err = ubifs_leb_change(c, lnum, buf, alen, UBI_SHORTTERM);
830 if (err) 830 if (err)
831 goto out; 831 goto out;
832 832
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c
index f28070cb00c6..51bcf4227b29 100644
--- a/fs/ubifs/recovery.c
+++ b/fs/ubifs/recovery.c
@@ -213,10 +213,10 @@ static int write_rcvrd_mst_node(struct ubifs_info *c,
213 mst->flags |= cpu_to_le32(UBIFS_MST_RCVRY); 213 mst->flags |= cpu_to_le32(UBIFS_MST_RCVRY);
214 214
215 ubifs_prepare_node(c, mst, UBIFS_MST_NODE_SZ, 1); 215 ubifs_prepare_node(c, mst, UBIFS_MST_NODE_SZ, 1);
216 err = ubi_leb_change(c->ubi, lnum, mst, sz, UBI_SHORTTERM); 216 err = ubifs_leb_change(c, lnum, mst, sz, UBI_SHORTTERM);
217 if (err) 217 if (err)
218 goto out; 218 goto out;
219 err = ubi_leb_change(c->ubi, lnum + 1, mst, sz, UBI_SHORTTERM); 219 err = ubifs_leb_change(c, lnum + 1, mst, sz, UBI_SHORTTERM);
220 if (err) 220 if (err)
221 goto out; 221 goto out;
222out: 222out:
@@ -554,8 +554,8 @@ static int fix_unclean_leb(struct ubifs_info *c, struct ubifs_scan_leb *sleb,
554 ubifs_pad(c, buf, pad_len); 554 ubifs_pad(c, buf, pad_len);
555 } 555 }
556 } 556 }
557 err = ubi_leb_change(c->ubi, lnum, sleb->buf, len, 557 err = ubifs_leb_change(c, lnum, sleb->buf, len,
558 UBI_UNKNOWN); 558 UBI_UNKNOWN);
559 if (err) 559 if (err)
560 return err; 560 return err;
561 } 561 }
@@ -939,7 +939,7 @@ static int recover_head(struct ubifs_info *c, int lnum, int offs, void *sbuf)
939 err = ubifs_leb_read(c, lnum, sbuf, 0, offs, 1); 939 err = ubifs_leb_read(c, lnum, sbuf, 0, offs, 1);
940 if (err) 940 if (err)
941 return err; 941 return err;
942 return ubi_leb_change(c->ubi, lnum, sbuf, offs, UBI_UNKNOWN); 942 return ubifs_leb_change(c, lnum, sbuf, offs, UBI_UNKNOWN);
943 } 943 }
944 944
945 return 0; 945 return 0;
@@ -1069,7 +1069,7 @@ static int clean_an_unclean_leb(struct ubifs_info *c,
1069 } 1069 }
1070 1070
1071 /* Write back the LEB atomically */ 1071 /* Write back the LEB atomically */
1072 err = ubi_leb_change(c->ubi, lnum, sbuf, len, UBI_UNKNOWN); 1072 err = ubifs_leb_change(c, lnum, sbuf, len, UBI_UNKNOWN);
1073 if (err) 1073 if (err)
1074 return err; 1074 return err;
1075 1075
@@ -1470,7 +1470,7 @@ static int fix_size_in_place(struct ubifs_info *c, struct size_entry *e)
1470 len -= 1; 1470 len -= 1;
1471 len = ALIGN(len + 1, c->min_io_size); 1471 len = ALIGN(len + 1, c->min_io_size);
1472 /* Atomically write the fixed LEB back again */ 1472 /* Atomically write the fixed LEB back again */
1473 err = ubi_leb_change(c->ubi, lnum, c->sbuf, len, UBI_UNKNOWN); 1473 err = ubifs_leb_change(c, lnum, c->sbuf, len, UBI_UNKNOWN);
1474 if (err) 1474 if (err)
1475 goto out; 1475 goto out;
1476 dbg_rcvry("inode %lu at %d:%d size %lld -> %lld", 1476 dbg_rcvry("inode %lu at %d:%d size %lld -> %lld",
diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c
index 701dccc1d6de..93d938ad3d2a 100644
--- a/fs/ubifs/sb.c
+++ b/fs/ubifs/sb.c
@@ -674,7 +674,7 @@ static int fixup_leb(struct ubifs_info *c, int lnum, int len)
674 674
675 if (len == 0) { 675 if (len == 0) {
676 dbg_mnt("unmap empty LEB %d", lnum); 676 dbg_mnt("unmap empty LEB %d", lnum);
677 return ubi_leb_unmap(c->ubi, lnum); 677 return ubifs_leb_unmap(c, lnum);
678 } 678 }
679 679
680 dbg_mnt("fixup LEB %d, data len %d", lnum, len); 680 dbg_mnt("fixup LEB %d, data len %d", lnum, len);
@@ -682,7 +682,7 @@ static int fixup_leb(struct ubifs_info *c, int lnum, int len)
682 if (err) 682 if (err)
683 return err; 683 return err;
684 684
685 return ubi_leb_change(c->ubi, lnum, c->sbuf, len, UBI_UNKNOWN); 685 return ubifs_leb_change(c, lnum, c->sbuf, len, UBI_UNKNOWN);
686} 686}
687 687
688/** 688/**
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 285038548da9..b28121278d46 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -914,7 +914,7 @@ static int check_volume_empty(struct ubifs_info *c)
914 914
915 c->empty = 1; 915 c->empty = 1;
916 for (lnum = 0; lnum < c->leb_cnt; lnum++) { 916 for (lnum = 0; lnum < c->leb_cnt; lnum++) {
917 err = ubi_is_mapped(c->ubi, lnum); 917 err = ubifs_is_mapped(c, lnum);
918 if (unlikely(err < 0)) 918 if (unlikely(err < 0))
919 return err; 919 return err;
920 if (err == 1) { 920 if (err == 1) {