diff options
author | Richard Weinberger <richard@nod.at> | 2012-05-14 11:55:51 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-05-20 13:25:59 -0400 |
commit | b36a261e8c0ab323d04db9cdd1f6bb4c273c4b32 (patch) | |
tree | 00c90c5fa556f335338f4f61c808d4dfe502bb74 /fs/ubifs | |
parent | 0964f6a27b3574d9210c59ec883cbb3fff78a78d (diff) |
UBI: Kill data type hint
We do not need this feature and to our shame it even was not working
and there was a bug found very recently.
-- Artem Bityutskiy
Without the data type hint UBI2 (fastmap) will be easier to implement.
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/debug.c | 12 | ||||
-rw-r--r-- | fs/ubifs/debug.h | 7 | ||||
-rw-r--r-- | fs/ubifs/gc.c | 2 | ||||
-rw-r--r-- | fs/ubifs/io.c | 42 | ||||
-rw-r--r-- | fs/ubifs/journal.c | 2 | ||||
-rw-r--r-- | fs/ubifs/log.c | 10 | ||||
-rw-r--r-- | fs/ubifs/lpt.c | 13 | ||||
-rw-r--r-- | fs/ubifs/lpt_commit.c | 10 | ||||
-rw-r--r-- | fs/ubifs/master.c | 4 | ||||
-rw-r--r-- | fs/ubifs/orphan.c | 5 | ||||
-rw-r--r-- | fs/ubifs/recovery.c | 13 | ||||
-rw-r--r-- | fs/ubifs/replay.c | 3 | ||||
-rw-r--r-- | fs/ubifs/sb.c | 22 | ||||
-rw-r--r-- | fs/ubifs/super.c | 2 | ||||
-rw-r--r-- | fs/ubifs/tnc_commit.c | 6 | ||||
-rw-r--r-- | fs/ubifs/ubifs.h | 15 |
16 files changed, 69 insertions, 99 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index df83d7b495fc..685a83756b2b 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c | |||
@@ -2676,7 +2676,7 @@ static void cut_data(const void *buf, unsigned int len) | |||
2676 | } | 2676 | } |
2677 | 2677 | ||
2678 | int dbg_leb_write(struct ubifs_info *c, int lnum, const void *buf, | 2678 | int dbg_leb_write(struct ubifs_info *c, int lnum, const void *buf, |
2679 | int offs, int len, int dtype) | 2679 | int offs, int len) |
2680 | { | 2680 | { |
2681 | int err, failing; | 2681 | int err, failing; |
2682 | 2682 | ||
@@ -2686,7 +2686,7 @@ int dbg_leb_write(struct ubifs_info *c, int lnum, const void *buf, | |||
2686 | failing = power_cut_emulated(c, lnum, 1); | 2686 | failing = power_cut_emulated(c, lnum, 1); |
2687 | if (failing) | 2687 | if (failing) |
2688 | cut_data(buf, len); | 2688 | cut_data(buf, len); |
2689 | err = ubi_leb_write(c->ubi, lnum, buf, offs, len, dtype); | 2689 | err = ubi_leb_write(c->ubi, lnum, buf, offs, len); |
2690 | if (err) | 2690 | if (err) |
2691 | return err; | 2691 | return err; |
2692 | if (failing) | 2692 | if (failing) |
@@ -2695,7 +2695,7 @@ int dbg_leb_write(struct ubifs_info *c, int lnum, const void *buf, | |||
2695 | } | 2695 | } |
2696 | 2696 | ||
2697 | int dbg_leb_change(struct ubifs_info *c, int lnum, const void *buf, | 2697 | int dbg_leb_change(struct ubifs_info *c, int lnum, const void *buf, |
2698 | int len, int dtype) | 2698 | int len) |
2699 | { | 2699 | { |
2700 | int err; | 2700 | int err; |
2701 | 2701 | ||
@@ -2703,7 +2703,7 @@ int dbg_leb_change(struct ubifs_info *c, int lnum, const void *buf, | |||
2703 | return -EROFS; | 2703 | return -EROFS; |
2704 | if (power_cut_emulated(c, lnum, 1)) | 2704 | if (power_cut_emulated(c, lnum, 1)) |
2705 | return -EROFS; | 2705 | return -EROFS; |
2706 | err = ubi_leb_change(c->ubi, lnum, buf, len, dtype); | 2706 | err = ubi_leb_change(c->ubi, lnum, buf, len); |
2707 | if (err) | 2707 | if (err) |
2708 | return err; | 2708 | return err; |
2709 | if (power_cut_emulated(c, lnum, 1)) | 2709 | if (power_cut_emulated(c, lnum, 1)) |
@@ -2727,7 +2727,7 @@ int dbg_leb_unmap(struct ubifs_info *c, int lnum) | |||
2727 | return 0; | 2727 | return 0; |
2728 | } | 2728 | } |
2729 | 2729 | ||
2730 | int dbg_leb_map(struct ubifs_info *c, int lnum, int dtype) | 2730 | int dbg_leb_map(struct ubifs_info *c, int lnum) |
2731 | { | 2731 | { |
2732 | int err; | 2732 | int err; |
2733 | 2733 | ||
@@ -2735,7 +2735,7 @@ int dbg_leb_map(struct ubifs_info *c, int lnum, int dtype) | |||
2735 | return -EROFS; | 2735 | return -EROFS; |
2736 | if (power_cut_emulated(c, lnum, 0)) | 2736 | if (power_cut_emulated(c, lnum, 0)) |
2737 | return -EROFS; | 2737 | return -EROFS; |
2738 | err = ubi_leb_map(c->ubi, lnum, dtype); | 2738 | err = ubi_leb_map(c->ubi, lnum); |
2739 | if (err) | 2739 | if (err) |
2740 | return err; | 2740 | return err; |
2741 | if (power_cut_emulated(c, lnum, 0)) | 2741 | if (power_cut_emulated(c, lnum, 0)) |
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h index 6b3a9e2ee19c..486a8e024fb6 100644 --- a/fs/ubifs/debug.h +++ b/fs/ubifs/debug.h | |||
@@ -299,11 +299,10 @@ int dbg_check_data_nodes_order(struct ubifs_info *c, struct list_head *head); | |||
299 | int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head); | 299 | int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head); |
300 | 300 | ||
301 | int dbg_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs, | 301 | int dbg_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs, |
302 | int len, int dtype); | 302 | int len); |
303 | int dbg_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len, | 303 | int dbg_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len); |
304 | int dtype); | ||
305 | int dbg_leb_unmap(struct ubifs_info *c, int lnum); | 304 | int dbg_leb_unmap(struct ubifs_info *c, int lnum); |
306 | int dbg_leb_map(struct ubifs_info *c, int lnum, int dtype); | 305 | int dbg_leb_map(struct ubifs_info *c, int lnum); |
307 | 306 | ||
308 | /* Debugfs-related stuff */ | 307 | /* Debugfs-related stuff */ |
309 | int dbg_debugfs_init(void); | 308 | int dbg_debugfs_init(void); |
diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c index ded29f6224c2..04dd6f47635e 100644 --- a/fs/ubifs/gc.c +++ b/fs/ubifs/gc.c | |||
@@ -109,7 +109,7 @@ static int switch_gc_head(struct ubifs_info *c) | |||
109 | return err; | 109 | return err; |
110 | 110 | ||
111 | c->gc_lnum = -1; | 111 | c->gc_lnum = -1; |
112 | err = ubifs_wbuf_seek_nolock(wbuf, gc_lnum, 0, UBI_LONGTERM); | 112 | err = ubifs_wbuf_seek_nolock(wbuf, gc_lnum, 0); |
113 | return err; | 113 | return err; |
114 | } | 114 | } |
115 | 115 | ||
diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c index 21f0835d78c9..e18b9889a51b 100644 --- a/fs/ubifs/io.c +++ b/fs/ubifs/io.c | |||
@@ -115,7 +115,7 @@ int ubifs_leb_read(const struct ubifs_info *c, int lnum, void *buf, int offs, | |||
115 | } | 115 | } |
116 | 116 | ||
117 | int ubifs_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs, | 117 | int ubifs_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs, |
118 | int len, int dtype) | 118 | int len) |
119 | { | 119 | { |
120 | int err; | 120 | int err; |
121 | 121 | ||
@@ -123,9 +123,9 @@ int ubifs_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs, | |||
123 | if (c->ro_error) | 123 | if (c->ro_error) |
124 | return -EROFS; | 124 | return -EROFS; |
125 | if (!dbg_is_tst_rcvry(c)) | 125 | if (!dbg_is_tst_rcvry(c)) |
126 | err = ubi_leb_write(c->ubi, lnum, buf, offs, len, dtype); | 126 | err = ubi_leb_write(c->ubi, lnum, buf, offs, len); |
127 | else | 127 | else |
128 | err = dbg_leb_write(c, lnum, buf, offs, len, dtype); | 128 | err = dbg_leb_write(c, lnum, buf, offs, len); |
129 | if (err) { | 129 | if (err) { |
130 | ubifs_err("writing %d bytes to LEB %d:%d failed, error %d", | 130 | ubifs_err("writing %d bytes to LEB %d:%d failed, error %d", |
131 | len, lnum, offs, err); | 131 | len, lnum, offs, err); |
@@ -135,8 +135,7 @@ int ubifs_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs, | |||
135 | return err; | 135 | return err; |
136 | } | 136 | } |
137 | 137 | ||
138 | int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len, | 138 | int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len) |
139 | int dtype) | ||
140 | { | 139 | { |
141 | int err; | 140 | int err; |
142 | 141 | ||
@@ -144,9 +143,9 @@ int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len, | |||
144 | if (c->ro_error) | 143 | if (c->ro_error) |
145 | return -EROFS; | 144 | return -EROFS; |
146 | if (!dbg_is_tst_rcvry(c)) | 145 | if (!dbg_is_tst_rcvry(c)) |
147 | err = ubi_leb_change(c->ubi, lnum, buf, len, dtype); | 146 | err = ubi_leb_change(c->ubi, lnum, buf, len); |
148 | else | 147 | else |
149 | err = dbg_leb_change(c, lnum, buf, len, dtype); | 148 | err = dbg_leb_change(c, lnum, buf, len); |
150 | if (err) { | 149 | if (err) { |
151 | ubifs_err("changing %d bytes in LEB %d failed, error %d", | 150 | ubifs_err("changing %d bytes in LEB %d failed, error %d", |
152 | len, lnum, err); | 151 | len, lnum, err); |
@@ -175,7 +174,7 @@ int ubifs_leb_unmap(struct ubifs_info *c, int lnum) | |||
175 | return err; | 174 | return err; |
176 | } | 175 | } |
177 | 176 | ||
178 | int ubifs_leb_map(struct ubifs_info *c, int lnum, int dtype) | 177 | int ubifs_leb_map(struct ubifs_info *c, int lnum) |
179 | { | 178 | { |
180 | int err; | 179 | int err; |
181 | 180 | ||
@@ -183,9 +182,9 @@ int ubifs_leb_map(struct ubifs_info *c, int lnum, int dtype) | |||
183 | if (c->ro_error) | 182 | if (c->ro_error) |
184 | return -EROFS; | 183 | return -EROFS; |
185 | if (!dbg_is_tst_rcvry(c)) | 184 | if (!dbg_is_tst_rcvry(c)) |
186 | err = ubi_leb_map(c->ubi, lnum, dtype); | 185 | err = ubi_leb_map(c->ubi, lnum); |
187 | else | 186 | else |
188 | err = dbg_leb_map(c, lnum, dtype); | 187 | err = dbg_leb_map(c, lnum); |
189 | if (err) { | 188 | if (err) { |
190 | ubifs_err("mapping LEB %d failed, error %d", lnum, err); | 189 | ubifs_err("mapping LEB %d failed, error %d", lnum, err); |
191 | ubifs_ro_mode(c, err); | 190 | ubifs_ro_mode(c, err); |
@@ -523,8 +522,7 @@ int ubifs_wbuf_sync_nolock(struct ubifs_wbuf *wbuf) | |||
523 | dirt = sync_len - wbuf->used; | 522 | dirt = sync_len - wbuf->used; |
524 | if (dirt) | 523 | if (dirt) |
525 | ubifs_pad(c, wbuf->buf + wbuf->used, dirt); | 524 | ubifs_pad(c, wbuf->buf + wbuf->used, dirt); |
526 | err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, wbuf->offs, sync_len, | 525 | err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, wbuf->offs, sync_len); |
527 | wbuf->dtype); | ||
528 | if (err) | 526 | if (err) |
529 | return err; | 527 | return err; |
530 | 528 | ||
@@ -562,14 +560,12 @@ int ubifs_wbuf_sync_nolock(struct ubifs_wbuf *wbuf) | |||
562 | * @wbuf: write-buffer | 560 | * @wbuf: write-buffer |
563 | * @lnum: logical eraseblock number to seek to | 561 | * @lnum: logical eraseblock number to seek to |
564 | * @offs: logical eraseblock offset to seek to | 562 | * @offs: logical eraseblock offset to seek to |
565 | * @dtype: data type | ||
566 | * | 563 | * |
567 | * This function targets the write-buffer to logical eraseblock @lnum:@offs. | 564 | * This function targets the write-buffer to logical eraseblock @lnum:@offs. |
568 | * The write-buffer has to be empty. Returns zero in case of success and a | 565 | * The write-buffer has to be empty. Returns zero in case of success and a |
569 | * negative error code in case of failure. | 566 | * negative error code in case of failure. |
570 | */ | 567 | */ |
571 | int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf, int lnum, int offs, | 568 | int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf, int lnum, int offs) |
572 | int dtype) | ||
573 | { | 569 | { |
574 | const struct ubifs_info *c = wbuf->c; | 570 | const struct ubifs_info *c = wbuf->c; |
575 | 571 | ||
@@ -592,7 +588,6 @@ int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf, int lnum, int offs, | |||
592 | wbuf->avail = wbuf->size; | 588 | wbuf->avail = wbuf->size; |
593 | wbuf->used = 0; | 589 | wbuf->used = 0; |
594 | spin_unlock(&wbuf->lock); | 590 | spin_unlock(&wbuf->lock); |
595 | wbuf->dtype = dtype; | ||
596 | 591 | ||
597 | return 0; | 592 | return 0; |
598 | } | 593 | } |
@@ -719,8 +714,7 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len) | |||
719 | dbg_io("flush jhead %s wbuf to LEB %d:%d", | 714 | dbg_io("flush jhead %s wbuf to LEB %d:%d", |
720 | dbg_jhead(wbuf->jhead), wbuf->lnum, wbuf->offs); | 715 | dbg_jhead(wbuf->jhead), wbuf->lnum, wbuf->offs); |
721 | err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, | 716 | err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, |
722 | wbuf->offs, wbuf->size, | 717 | wbuf->offs, wbuf->size); |
723 | wbuf->dtype); | ||
724 | if (err) | 718 | if (err) |
725 | goto out; | 719 | goto out; |
726 | 720 | ||
@@ -756,7 +750,7 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len) | |||
756 | dbg_jhead(wbuf->jhead), wbuf->lnum, wbuf->offs); | 750 | dbg_jhead(wbuf->jhead), wbuf->lnum, wbuf->offs); |
757 | memcpy(wbuf->buf + wbuf->used, buf, wbuf->avail); | 751 | memcpy(wbuf->buf + wbuf->used, buf, wbuf->avail); |
758 | err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, wbuf->offs, | 752 | err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, wbuf->offs, |
759 | wbuf->size, wbuf->dtype); | 753 | wbuf->size); |
760 | if (err) | 754 | if (err) |
761 | goto out; | 755 | goto out; |
762 | 756 | ||
@@ -775,7 +769,7 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len) | |||
775 | dbg_io("write %d bytes to LEB %d:%d", | 769 | dbg_io("write %d bytes to LEB %d:%d", |
776 | wbuf->size, wbuf->lnum, wbuf->offs); | 770 | wbuf->size, wbuf->lnum, wbuf->offs); |
777 | err = ubifs_leb_write(c, wbuf->lnum, buf, wbuf->offs, | 771 | err = ubifs_leb_write(c, wbuf->lnum, buf, wbuf->offs, |
778 | wbuf->size, wbuf->dtype); | 772 | wbuf->size); |
779 | if (err) | 773 | if (err) |
780 | goto out; | 774 | goto out; |
781 | 775 | ||
@@ -797,7 +791,7 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len) | |||
797 | dbg_io("write %d bytes to LEB %d:%d", n, wbuf->lnum, | 791 | dbg_io("write %d bytes to LEB %d:%d", n, wbuf->lnum, |
798 | wbuf->offs); | 792 | wbuf->offs); |
799 | err = ubifs_leb_write(c, wbuf->lnum, buf + written, | 793 | err = ubifs_leb_write(c, wbuf->lnum, buf + written, |
800 | wbuf->offs, n, wbuf->dtype); | 794 | wbuf->offs, n); |
801 | if (err) | 795 | if (err) |
802 | goto out; | 796 | goto out; |
803 | wbuf->offs += n; | 797 | wbuf->offs += n; |
@@ -854,7 +848,6 @@ out: | |||
854 | * @len: node length | 848 | * @len: node length |
855 | * @lnum: logical eraseblock number | 849 | * @lnum: logical eraseblock number |
856 | * @offs: offset within the logical eraseblock | 850 | * @offs: offset within the logical eraseblock |
857 | * @dtype: node life-time hint (%UBI_LONGTERM, %UBI_SHORTTERM, %UBI_UNKNOWN) | ||
858 | * | 851 | * |
859 | * This function automatically fills node magic number, assigns sequence | 852 | * This function automatically fills node magic number, assigns sequence |
860 | * number, and calculates node CRC checksum. The length of the @buf buffer has | 853 | * number, and calculates node CRC checksum. The length of the @buf buffer has |
@@ -863,7 +856,7 @@ out: | |||
863 | * success and a negative error code in case of failure. | 856 | * success and a negative error code in case of failure. |
864 | */ | 857 | */ |
865 | int ubifs_write_node(struct ubifs_info *c, void *buf, int len, int lnum, | 858 | int ubifs_write_node(struct ubifs_info *c, void *buf, int len, int lnum, |
866 | int offs, int dtype) | 859 | int offs) |
867 | { | 860 | { |
868 | int err, buf_len = ALIGN(len, c->min_io_size); | 861 | int err, buf_len = ALIGN(len, c->min_io_size); |
869 | 862 | ||
@@ -879,7 +872,7 @@ int ubifs_write_node(struct ubifs_info *c, void *buf, int len, int lnum, | |||
879 | return -EROFS; | 872 | return -EROFS; |
880 | 873 | ||
881 | ubifs_prepare_node(c, buf, len, 1); | 874 | ubifs_prepare_node(c, buf, len, 1); |
882 | err = ubifs_leb_write(c, lnum, buf, offs, buf_len, dtype); | 875 | err = ubifs_leb_write(c, lnum, buf, offs, buf_len); |
883 | if (err) | 876 | if (err) |
884 | ubifs_dump_node(c, buf); | 877 | ubifs_dump_node(c, buf); |
885 | 878 | ||
@@ -1056,7 +1049,6 @@ int ubifs_wbuf_init(struct ubifs_info *c, struct ubifs_wbuf *wbuf) | |||
1056 | */ | 1049 | */ |
1057 | size = c->max_write_size - (c->leb_start % c->max_write_size); | 1050 | size = c->max_write_size - (c->leb_start % c->max_write_size); |
1058 | wbuf->avail = wbuf->size = size; | 1051 | wbuf->avail = wbuf->size = size; |
1059 | wbuf->dtype = UBI_UNKNOWN; | ||
1060 | wbuf->sync_callback = NULL; | 1052 | wbuf->sync_callback = NULL; |
1061 | mutex_init(&wbuf->io_mutex); | 1053 | mutex_init(&wbuf->io_mutex); |
1062 | spin_lock_init(&wbuf->lock); | 1054 | spin_lock_init(&wbuf->lock); |
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index 61cd8535ffd6..12c0f154ca83 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c | |||
@@ -214,7 +214,7 @@ out: | |||
214 | err = ubifs_add_bud_to_log(c, jhead, lnum, offs); | 214 | err = ubifs_add_bud_to_log(c, jhead, lnum, offs); |
215 | if (err) | 215 | if (err) |
216 | goto out_return; | 216 | goto out_return; |
217 | err = ubifs_wbuf_seek_nolock(wbuf, lnum, offs, wbuf->dtype); | 217 | err = ubifs_wbuf_seek_nolock(wbuf, lnum, offs); |
218 | if (err) | 218 | if (err) |
219 | goto out_unlock; | 219 | goto out_unlock; |
220 | 220 | ||
diff --git a/fs/ubifs/log.c b/fs/ubifs/log.c index 9967b5a21f41..c80b15d6c8de 100644 --- a/fs/ubifs/log.c +++ b/fs/ubifs/log.c | |||
@@ -258,7 +258,7 @@ int ubifs_add_bud_to_log(struct ubifs_info *c, int jhead, int lnum, int offs) | |||
258 | * an unclean reboot, because the target LEB might have been | 258 | * an unclean reboot, because the target LEB might have been |
259 | * unmapped, but not yet physically erased. | 259 | * unmapped, but not yet physically erased. |
260 | */ | 260 | */ |
261 | err = ubifs_leb_map(c, bud->lnum, UBI_SHORTTERM); | 261 | err = ubifs_leb_map(c, bud->lnum); |
262 | if (err) | 262 | if (err) |
263 | goto out_unlock; | 263 | goto out_unlock; |
264 | } | 264 | } |
@@ -266,7 +266,7 @@ int ubifs_add_bud_to_log(struct ubifs_info *c, int jhead, int lnum, int offs) | |||
266 | dbg_log("write ref LEB %d:%d", | 266 | dbg_log("write ref LEB %d:%d", |
267 | c->lhead_lnum, c->lhead_offs); | 267 | c->lhead_lnum, c->lhead_offs); |
268 | err = ubifs_write_node(c, ref, UBIFS_REF_NODE_SZ, c->lhead_lnum, | 268 | err = ubifs_write_node(c, ref, UBIFS_REF_NODE_SZ, c->lhead_lnum, |
269 | c->lhead_offs, UBI_SHORTTERM); | 269 | c->lhead_offs); |
270 | if (err) | 270 | if (err) |
271 | goto out_unlock; | 271 | goto out_unlock; |
272 | 272 | ||
@@ -418,7 +418,7 @@ int ubifs_log_start_commit(struct ubifs_info *c, int *ltail_lnum) | |||
418 | 418 | ||
419 | len = ALIGN(len, c->min_io_size); | 419 | len = ALIGN(len, c->min_io_size); |
420 | dbg_log("writing commit start at LEB %d:0, len %d", c->lhead_lnum, len); | 420 | dbg_log("writing commit start at LEB %d:0, len %d", c->lhead_lnum, len); |
421 | err = ubifs_leb_write(c, c->lhead_lnum, cs, 0, len, UBI_SHORTTERM); | 421 | err = ubifs_leb_write(c, c->lhead_lnum, cs, 0, len); |
422 | if (err) | 422 | if (err) |
423 | goto out; | 423 | goto out; |
424 | 424 | ||
@@ -619,7 +619,7 @@ static int add_node(struct ubifs_info *c, void *buf, int *lnum, int *offs, | |||
619 | int sz = ALIGN(*offs, c->min_io_size), err; | 619 | int sz = ALIGN(*offs, c->min_io_size), err; |
620 | 620 | ||
621 | ubifs_pad(c, buf + *offs, sz - *offs); | 621 | ubifs_pad(c, buf + *offs, sz - *offs); |
622 | err = ubifs_leb_change(c, *lnum, buf, sz, UBI_SHORTTERM); | 622 | err = ubifs_leb_change(c, *lnum, buf, sz); |
623 | if (err) | 623 | if (err) |
624 | return err; | 624 | return err; |
625 | *lnum = ubifs_next_log_lnum(c, *lnum); | 625 | *lnum = ubifs_next_log_lnum(c, *lnum); |
@@ -698,7 +698,7 @@ int ubifs_consolidate_log(struct ubifs_info *c) | |||
698 | int sz = ALIGN(offs, c->min_io_size); | 698 | int sz = ALIGN(offs, c->min_io_size); |
699 | 699 | ||
700 | ubifs_pad(c, buf + offs, sz - offs); | 700 | ubifs_pad(c, buf + offs, sz - offs); |
701 | err = ubifs_leb_change(c, write_lnum, buf, sz, UBI_SHORTTERM); | 701 | err = ubifs_leb_change(c, write_lnum, buf, sz); |
702 | if (err) | 702 | if (err) |
703 | goto out_free; | 703 | goto out_free; |
704 | offs = ALIGN(offs, c->min_io_size); | 704 | offs = ALIGN(offs, c->min_io_size); |
diff --git a/fs/ubifs/lpt.c b/fs/ubifs/lpt.c index b4280c44949c..ce33b2beb151 100644 --- a/fs/ubifs/lpt.c +++ b/fs/ubifs/lpt.c | |||
@@ -701,8 +701,7 @@ 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 = ubifs_leb_change(c, lnum++, buf, alen, | 704 | err = ubifs_leb_change(c, lnum++, buf, alen); |
705 | UBI_SHORTTERM); | ||
706 | if (err) | 705 | if (err) |
707 | goto out; | 706 | goto out; |
708 | p = buf; | 707 | p = buf; |
@@ -732,8 +731,7 @@ int ubifs_create_dflt_lpt(struct ubifs_info *c, int *main_lebs, int lpt_first, | |||
732 | set_ltab(c, lnum, c->leb_size - alen, | 731 | set_ltab(c, lnum, c->leb_size - alen, |
733 | alen - len); | 732 | alen - len); |
734 | memset(p, 0xff, alen - len); | 733 | memset(p, 0xff, alen - len); |
735 | err = ubifs_leb_change(c, lnum++, buf, alen, | 734 | err = ubifs_leb_change(c, lnum++, buf, alen); |
736 | UBI_SHORTTERM); | ||
737 | if (err) | 735 | if (err) |
738 | goto out; | 736 | goto out; |
739 | p = buf; | 737 | p = buf; |
@@ -780,8 +778,7 @@ int ubifs_create_dflt_lpt(struct ubifs_info *c, int *main_lebs, int lpt_first, | |||
780 | alen = ALIGN(len, c->min_io_size); | 778 | alen = ALIGN(len, c->min_io_size); |
781 | set_ltab(c, lnum, c->leb_size - alen, alen - len); | 779 | set_ltab(c, lnum, c->leb_size - alen, alen - len); |
782 | memset(p, 0xff, alen - len); | 780 | memset(p, 0xff, alen - len); |
783 | err = ubifs_leb_change(c, lnum++, buf, alen, | 781 | err = ubifs_leb_change(c, lnum++, buf, alen); |
784 | UBI_SHORTTERM); | ||
785 | if (err) | 782 | if (err) |
786 | goto out; | 783 | goto out; |
787 | p = buf; | 784 | p = buf; |
@@ -806,7 +803,7 @@ int ubifs_create_dflt_lpt(struct ubifs_info *c, int *main_lebs, int lpt_first, | |||
806 | alen = ALIGN(len, c->min_io_size); | 803 | alen = ALIGN(len, c->min_io_size); |
807 | set_ltab(c, lnum, c->leb_size - alen, alen - len); | 804 | set_ltab(c, lnum, c->leb_size - alen, alen - len); |
808 | memset(p, 0xff, alen - len); | 805 | memset(p, 0xff, alen - len); |
809 | err = ubifs_leb_change(c, lnum++, buf, alen, UBI_SHORTTERM); | 806 | err = ubifs_leb_change(c, lnum++, buf, alen); |
810 | if (err) | 807 | if (err) |
811 | goto out; | 808 | goto out; |
812 | p = buf; | 809 | p = buf; |
@@ -826,7 +823,7 @@ int ubifs_create_dflt_lpt(struct ubifs_info *c, int *main_lebs, int lpt_first, | |||
826 | 823 | ||
827 | /* Write remaining buffer */ | 824 | /* Write remaining buffer */ |
828 | memset(p, 0xff, alen - len); | 825 | memset(p, 0xff, alen - len); |
829 | err = ubifs_leb_change(c, lnum, buf, alen, UBI_SHORTTERM); | 826 | err = ubifs_leb_change(c, lnum, buf, alen); |
830 | if (err) | 827 | if (err) |
831 | goto out; | 828 | goto out; |
832 | 829 | ||
diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c index 862c4ca98b85..4fa70734e6e7 100644 --- a/fs/ubifs/lpt_commit.c +++ b/fs/ubifs/lpt_commit.c | |||
@@ -416,7 +416,7 @@ static int write_cnodes(struct ubifs_info *c) | |||
416 | alen = ALIGN(wlen, c->min_io_size); | 416 | alen = ALIGN(wlen, c->min_io_size); |
417 | memset(buf + offs, 0xff, alen - wlen); | 417 | memset(buf + offs, 0xff, alen - wlen); |
418 | err = ubifs_leb_write(c, lnum, buf + from, from, | 418 | err = ubifs_leb_write(c, lnum, buf + from, from, |
419 | alen, UBI_SHORTTERM); | 419 | alen); |
420 | if (err) | 420 | if (err) |
421 | return err; | 421 | return err; |
422 | } | 422 | } |
@@ -474,8 +474,7 @@ static int write_cnodes(struct ubifs_info *c) | |||
474 | wlen = offs - from; | 474 | wlen = offs - from; |
475 | alen = ALIGN(wlen, c->min_io_size); | 475 | alen = ALIGN(wlen, c->min_io_size); |
476 | memset(buf + offs, 0xff, alen - wlen); | 476 | memset(buf + offs, 0xff, alen - wlen); |
477 | err = ubifs_leb_write(c, lnum, buf + from, from, alen, | 477 | err = ubifs_leb_write(c, lnum, buf + from, from, alen); |
478 | UBI_SHORTTERM); | ||
479 | if (err) | 478 | if (err) |
480 | return err; | 479 | return err; |
481 | dbg_chk_lpt_sz(c, 2, c->leb_size - offs); | 480 | dbg_chk_lpt_sz(c, 2, c->leb_size - offs); |
@@ -501,8 +500,7 @@ static int write_cnodes(struct ubifs_info *c) | |||
501 | wlen = offs - from; | 500 | wlen = offs - from; |
502 | alen = ALIGN(wlen, c->min_io_size); | 501 | alen = ALIGN(wlen, c->min_io_size); |
503 | memset(buf + offs, 0xff, alen - wlen); | 502 | memset(buf + offs, 0xff, alen - wlen); |
504 | err = ubifs_leb_write(c, lnum, buf + from, from, alen, | 503 | err = ubifs_leb_write(c, lnum, buf + from, from, alen); |
505 | UBI_SHORTTERM); | ||
506 | if (err) | 504 | if (err) |
507 | return err; | 505 | return err; |
508 | dbg_chk_lpt_sz(c, 2, c->leb_size - offs); | 506 | dbg_chk_lpt_sz(c, 2, c->leb_size - offs); |
@@ -526,7 +524,7 @@ static int write_cnodes(struct ubifs_info *c) | |||
526 | wlen = offs - from; | 524 | wlen = offs - from; |
527 | alen = ALIGN(wlen, c->min_io_size); | 525 | alen = ALIGN(wlen, c->min_io_size); |
528 | memset(buf + offs, 0xff, alen - wlen); | 526 | memset(buf + offs, 0xff, alen - wlen); |
529 | err = ubifs_leb_write(c, lnum, buf + from, from, alen, UBI_SHORTTERM); | 527 | err = ubifs_leb_write(c, lnum, buf + from, from, alen); |
530 | if (err) | 528 | if (err) |
531 | return err; | 529 | return err; |
532 | 530 | ||
diff --git a/fs/ubifs/master.c b/fs/ubifs/master.c index 9fc282984f94..ab83ace9910a 100644 --- a/fs/ubifs/master.c +++ b/fs/ubifs/master.c | |||
@@ -379,7 +379,7 @@ int ubifs_write_master(struct ubifs_info *c) | |||
379 | c->mst_offs = offs; | 379 | c->mst_offs = offs; |
380 | c->mst_node->highest_inum = cpu_to_le64(c->highest_inum); | 380 | c->mst_node->highest_inum = cpu_to_le64(c->highest_inum); |
381 | 381 | ||
382 | err = ubifs_write_node(c, c->mst_node, len, lnum, offs, UBI_SHORTTERM); | 382 | err = ubifs_write_node(c, c->mst_node, len, lnum, offs); |
383 | if (err) | 383 | if (err) |
384 | return err; | 384 | return err; |
385 | 385 | ||
@@ -390,7 +390,7 @@ int ubifs_write_master(struct ubifs_info *c) | |||
390 | if (err) | 390 | if (err) |
391 | return err; | 391 | return err; |
392 | } | 392 | } |
393 | err = ubifs_write_node(c, c->mst_node, len, lnum, offs, UBI_SHORTTERM); | 393 | err = ubifs_write_node(c, c->mst_node, len, lnum, offs); |
394 | 394 | ||
395 | return err; | 395 | return err; |
396 | } | 396 | } |
diff --git a/fs/ubifs/orphan.c b/fs/ubifs/orphan.c index 95155cc18084..b02734db187c 100644 --- a/fs/ubifs/orphan.c +++ b/fs/ubifs/orphan.c | |||
@@ -244,8 +244,7 @@ static int do_write_orph_node(struct ubifs_info *c, int len, int atomic) | |||
244 | ubifs_assert(c->ohead_offs == 0); | 244 | ubifs_assert(c->ohead_offs == 0); |
245 | ubifs_prepare_node(c, c->orph_buf, len, 1); | 245 | ubifs_prepare_node(c, c->orph_buf, len, 1); |
246 | len = ALIGN(len, c->min_io_size); | 246 | len = ALIGN(len, c->min_io_size); |
247 | err = ubifs_leb_change(c, c->ohead_lnum, c->orph_buf, len, | 247 | err = ubifs_leb_change(c, c->ohead_lnum, c->orph_buf, len); |
248 | UBI_SHORTTERM); | ||
249 | } else { | 248 | } else { |
250 | if (c->ohead_offs == 0) { | 249 | if (c->ohead_offs == 0) { |
251 | /* Ensure LEB has been unmapped */ | 250 | /* Ensure LEB has been unmapped */ |
@@ -254,7 +253,7 @@ static int do_write_orph_node(struct ubifs_info *c, int len, int atomic) | |||
254 | return err; | 253 | return err; |
255 | } | 254 | } |
256 | err = ubifs_write_node(c, c->orph_buf, len, c->ohead_lnum, | 255 | err = ubifs_write_node(c, c->orph_buf, len, c->ohead_lnum, |
257 | c->ohead_offs, UBI_SHORTTERM); | 256 | c->ohead_offs); |
258 | } | 257 | } |
259 | return err; | 258 | return err; |
260 | } | 259 | } |
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index 01a348dd4587..c30d976b4be8 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 = ubifs_leb_change(c, lnum, mst, sz, UBI_SHORTTERM); | 216 | err = ubifs_leb_change(c, lnum, mst, sz); |
217 | if (err) | 217 | if (err) |
218 | goto out; | 218 | goto out; |
219 | err = ubifs_leb_change(c, lnum + 1, mst, sz, UBI_SHORTTERM); | 219 | err = ubifs_leb_change(c, lnum + 1, mst, sz); |
220 | if (err) | 220 | if (err) |
221 | goto out; | 221 | goto out; |
222 | out: | 222 | out: |
@@ -555,8 +555,7 @@ static int fix_unclean_leb(struct ubifs_info *c, struct ubifs_scan_leb *sleb, | |||
555 | ubifs_pad(c, buf, pad_len); | 555 | ubifs_pad(c, buf, pad_len); |
556 | } | 556 | } |
557 | } | 557 | } |
558 | err = ubifs_leb_change(c, lnum, sleb->buf, len, | 558 | err = ubifs_leb_change(c, lnum, sleb->buf, len); |
559 | UBI_UNKNOWN); | ||
560 | if (err) | 559 | if (err) |
561 | return err; | 560 | return err; |
562 | } | 561 | } |
@@ -941,7 +940,7 @@ static int recover_head(struct ubifs_info *c, int lnum, int offs, void *sbuf) | |||
941 | err = ubifs_leb_read(c, lnum, sbuf, 0, offs, 1); | 940 | err = ubifs_leb_read(c, lnum, sbuf, 0, offs, 1); |
942 | if (err) | 941 | if (err) |
943 | return err; | 942 | return err; |
944 | return ubifs_leb_change(c, lnum, sbuf, offs, UBI_UNKNOWN); | 943 | return ubifs_leb_change(c, lnum, sbuf, offs); |
945 | } | 944 | } |
946 | 945 | ||
947 | return 0; | 946 | return 0; |
@@ -1071,7 +1070,7 @@ static int clean_an_unclean_leb(struct ubifs_info *c, | |||
1071 | } | 1070 | } |
1072 | 1071 | ||
1073 | /* Write back the LEB atomically */ | 1072 | /* Write back the LEB atomically */ |
1074 | err = ubifs_leb_change(c, lnum, sbuf, len, UBI_UNKNOWN); | 1073 | err = ubifs_leb_change(c, lnum, sbuf, len); |
1075 | if (err) | 1074 | if (err) |
1076 | return err; | 1075 | return err; |
1077 | 1076 | ||
@@ -1472,7 +1471,7 @@ static int fix_size_in_place(struct ubifs_info *c, struct size_entry *e) | |||
1472 | len -= 1; | 1471 | len -= 1; |
1473 | len = ALIGN(len + 1, c->min_io_size); | 1472 | len = ALIGN(len + 1, c->min_io_size); |
1474 | /* Atomically write the fixed LEB back again */ | 1473 | /* Atomically write the fixed LEB back again */ |
1475 | err = ubifs_leb_change(c, lnum, c->sbuf, len, UBI_UNKNOWN); | 1474 | err = ubifs_leb_change(c, lnum, c->sbuf, len); |
1476 | if (err) | 1475 | if (err) |
1477 | goto out; | 1476 | goto out; |
1478 | dbg_rcvry("inode %lu at %d:%d size %lld -> %lld", | 1477 | dbg_rcvry("inode %lu at %d:%d size %lld -> %lld", |
diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index 2a2e3ee720fe..3a2da7e476e5 100644 --- a/fs/ubifs/replay.c +++ b/fs/ubifs/replay.c | |||
@@ -154,8 +154,7 @@ static int set_bud_lprops(struct ubifs_info *c, struct bud_entry *b) | |||
154 | 154 | ||
155 | /* Make sure the journal head points to the latest bud */ | 155 | /* Make sure the journal head points to the latest bud */ |
156 | err = ubifs_wbuf_seek_nolock(&c->jheads[b->bud->jhead].wbuf, | 156 | err = ubifs_wbuf_seek_nolock(&c->jheads[b->bud->jhead].wbuf, |
157 | b->bud->lnum, c->leb_size - b->free, | 157 | b->bud->lnum, c->leb_size - b->free); |
158 | UBI_SHORTTERM); | ||
159 | 158 | ||
160 | out: | 159 | out: |
161 | ubifs_release_lprops(c); | 160 | ubifs_release_lprops(c); |
diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index a880d0c152e5..ef3d1ba6d992 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c | |||
@@ -194,7 +194,7 @@ static int create_default_filesystem(struct ubifs_info *c) | |||
194 | sup->rp_size = cpu_to_le64(tmp64); | 194 | sup->rp_size = cpu_to_le64(tmp64); |
195 | sup->ro_compat_version = cpu_to_le32(UBIFS_RO_COMPAT_VERSION); | 195 | sup->ro_compat_version = cpu_to_le32(UBIFS_RO_COMPAT_VERSION); |
196 | 196 | ||
197 | err = ubifs_write_node(c, sup, UBIFS_SB_NODE_SZ, 0, 0, UBI_LONGTERM); | 197 | err = ubifs_write_node(c, sup, UBIFS_SB_NODE_SZ, 0, 0); |
198 | kfree(sup); | 198 | kfree(sup); |
199 | if (err) | 199 | if (err) |
200 | return err; | 200 | return err; |
@@ -250,14 +250,13 @@ static int create_default_filesystem(struct ubifs_info *c) | |||
250 | 250 | ||
251 | mst->total_used = cpu_to_le64(UBIFS_INO_NODE_SZ); | 251 | mst->total_used = cpu_to_le64(UBIFS_INO_NODE_SZ); |
252 | 252 | ||
253 | err = ubifs_write_node(c, mst, UBIFS_MST_NODE_SZ, UBIFS_MST_LNUM, 0, | 253 | err = ubifs_write_node(c, mst, UBIFS_MST_NODE_SZ, UBIFS_MST_LNUM, 0); |
254 | UBI_UNKNOWN); | ||
255 | if (err) { | 254 | if (err) { |
256 | kfree(mst); | 255 | kfree(mst); |
257 | return err; | 256 | return err; |
258 | } | 257 | } |
259 | err = ubifs_write_node(c, mst, UBIFS_MST_NODE_SZ, UBIFS_MST_LNUM + 1, 0, | 258 | err = ubifs_write_node(c, mst, UBIFS_MST_NODE_SZ, UBIFS_MST_LNUM + 1, |
260 | UBI_UNKNOWN); | 259 | 0); |
261 | kfree(mst); | 260 | kfree(mst); |
262 | if (err) | 261 | if (err) |
263 | return err; | 262 | return err; |
@@ -280,8 +279,7 @@ static int create_default_filesystem(struct ubifs_info *c) | |||
280 | key_write_idx(c, &key, &br->key); | 279 | key_write_idx(c, &key, &br->key); |
281 | br->lnum = cpu_to_le32(main_first + DEFAULT_DATA_LEB); | 280 | br->lnum = cpu_to_le32(main_first + DEFAULT_DATA_LEB); |
282 | br->len = cpu_to_le32(UBIFS_INO_NODE_SZ); | 281 | br->len = cpu_to_le32(UBIFS_INO_NODE_SZ); |
283 | err = ubifs_write_node(c, idx, tmp, main_first + DEFAULT_IDX_LEB, 0, | 282 | err = ubifs_write_node(c, idx, tmp, main_first + DEFAULT_IDX_LEB, 0); |
284 | UBI_UNKNOWN); | ||
285 | kfree(idx); | 283 | kfree(idx); |
286 | if (err) | 284 | if (err) |
287 | return err; | 285 | return err; |
@@ -313,8 +311,7 @@ static int create_default_filesystem(struct ubifs_info *c) | |||
313 | ino->flags = cpu_to_le32(UBIFS_COMPR_FL); | 311 | ino->flags = cpu_to_le32(UBIFS_COMPR_FL); |
314 | 312 | ||
315 | err = ubifs_write_node(c, ino, UBIFS_INO_NODE_SZ, | 313 | err = ubifs_write_node(c, ino, UBIFS_INO_NODE_SZ, |
316 | main_first + DEFAULT_DATA_LEB, 0, | 314 | main_first + DEFAULT_DATA_LEB, 0); |
317 | UBI_UNKNOWN); | ||
318 | kfree(ino); | 315 | kfree(ino); |
319 | if (err) | 316 | if (err) |
320 | return err; | 317 | return err; |
@@ -333,8 +330,7 @@ static int create_default_filesystem(struct ubifs_info *c) | |||
333 | return -ENOMEM; | 330 | return -ENOMEM; |
334 | 331 | ||
335 | cs->ch.node_type = UBIFS_CS_NODE; | 332 | cs->ch.node_type = UBIFS_CS_NODE; |
336 | err = ubifs_write_node(c, cs, UBIFS_CS_NODE_SZ, UBIFS_LOG_LNUM, | 333 | err = ubifs_write_node(c, cs, UBIFS_CS_NODE_SZ, UBIFS_LOG_LNUM, 0); |
337 | 0, UBI_UNKNOWN); | ||
338 | kfree(cs); | 334 | kfree(cs); |
339 | 335 | ||
340 | ubifs_msg("default file-system created"); | 336 | ubifs_msg("default file-system created"); |
@@ -516,7 +512,7 @@ int ubifs_write_sb_node(struct ubifs_info *c, struct ubifs_sb_node *sup) | |||
516 | int len = ALIGN(UBIFS_SB_NODE_SZ, c->min_io_size); | 512 | int len = ALIGN(UBIFS_SB_NODE_SZ, c->min_io_size); |
517 | 513 | ||
518 | ubifs_prepare_node(c, sup, UBIFS_SB_NODE_SZ, 1); | 514 | ubifs_prepare_node(c, sup, UBIFS_SB_NODE_SZ, 1); |
519 | return ubifs_leb_change(c, UBIFS_SB_LNUM, sup, len, UBI_LONGTERM); | 515 | return ubifs_leb_change(c, UBIFS_SB_LNUM, sup, len); |
520 | } | 516 | } |
521 | 517 | ||
522 | /** | 518 | /** |
@@ -689,7 +685,7 @@ static int fixup_leb(struct ubifs_info *c, int lnum, int len) | |||
689 | if (err) | 685 | if (err) |
690 | return err; | 686 | return err; |
691 | 687 | ||
692 | return ubifs_leb_change(c, lnum, c->sbuf, len, UBI_UNKNOWN); | 688 | return ubifs_leb_change(c, lnum, c->sbuf, len); |
693 | } | 689 | } |
694 | 690 | ||
695 | /** | 691 | /** |
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 675b781b4699..d7cbf7aabdb7 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -813,13 +813,11 @@ static int alloc_wbufs(struct ubifs_info *c) | |||
813 | c->jheads[i].grouped = 1; | 813 | c->jheads[i].grouped = 1; |
814 | } | 814 | } |
815 | 815 | ||
816 | c->jheads[BASEHD].wbuf.dtype = UBI_SHORTTERM; | ||
817 | /* | 816 | /* |
818 | * Garbage Collector head likely contains long-term data and | 817 | * Garbage Collector head likely contains long-term data and |
819 | * does not need to be synchronized by timer. Also GC head nodes are | 818 | * does not need to be synchronized by timer. Also GC head nodes are |
820 | * not grouped. | 819 | * not grouped. |
821 | */ | 820 | */ |
822 | c->jheads[GCHD].wbuf.dtype = UBI_LONGTERM; | ||
823 | c->jheads[GCHD].wbuf.no_timer = 1; | 821 | c->jheads[GCHD].wbuf.no_timer = 1; |
824 | c->jheads[GCHD].grouped = 0; | 822 | c->jheads[GCHD].grouped = 0; |
825 | 823 | ||
diff --git a/fs/ubifs/tnc_commit.c b/fs/ubifs/tnc_commit.c index ef5df1e24dca..523bbad69c0c 100644 --- a/fs/ubifs/tnc_commit.c +++ b/fs/ubifs/tnc_commit.c | |||
@@ -320,8 +320,7 @@ static int layout_leb_in_gaps(struct ubifs_info *c, int *p) | |||
320 | 0, 0, 0); | 320 | 0, 0, 0); |
321 | if (err) | 321 | if (err) |
322 | return err; | 322 | return err; |
323 | err = ubifs_leb_change(c, lnum, c->ileb_buf, c->ileb_len, | 323 | err = ubifs_leb_change(c, lnum, c->ileb_buf, c->ileb_len); |
324 | UBI_SHORTTERM); | ||
325 | if (err) | 324 | if (err) |
326 | return err; | 325 | return err; |
327 | dbg_gc("LEB %d wrote %d index nodes", lnum, tot_written); | 326 | dbg_gc("LEB %d wrote %d index nodes", lnum, tot_written); |
@@ -951,8 +950,7 @@ static int write_index(struct ubifs_info *c) | |||
951 | } | 950 | } |
952 | 951 | ||
953 | /* The buffer is full or there are no more znodes to do */ | 952 | /* The buffer is full or there are no more znodes to do */ |
954 | err = ubifs_leb_write(c, lnum, c->cbuf, buf_offs, blen, | 953 | err = ubifs_leb_write(c, lnum, c->cbuf, buf_offs, blen); |
955 | UBI_SHORTTERM); | ||
956 | if (err) | 954 | if (err) |
957 | return err; | 955 | return err; |
958 | buf_offs += blen; | 956 | buf_offs += blen; |
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index c2cf509e14db..1e5a08623d11 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -650,8 +650,6 @@ typedef int (*ubifs_lpt_scan_callback)(struct ubifs_info *c, | |||
650 | * @avail: number of bytes available in the write-buffer | 650 | * @avail: number of bytes available in the write-buffer |
651 | * @used: number of used bytes in the write-buffer | 651 | * @used: number of used bytes in the write-buffer |
652 | * @size: write-buffer size (in [@c->min_io_size, @c->max_write_size] range) | 652 | * @size: write-buffer size (in [@c->min_io_size, @c->max_write_size] range) |
653 | * @dtype: type of data stored in this LEB (%UBI_LONGTERM, %UBI_SHORTTERM, | ||
654 | * %UBI_UNKNOWN) | ||
655 | * @jhead: journal head the mutex belongs to (note, needed only to shut lockdep | 653 | * @jhead: journal head the mutex belongs to (note, needed only to shut lockdep |
656 | * up by 'mutex_lock_nested()). | 654 | * up by 'mutex_lock_nested()). |
657 | * @sync_callback: write-buffer synchronization callback | 655 | * @sync_callback: write-buffer synchronization callback |
@@ -685,7 +683,6 @@ struct ubifs_wbuf { | |||
685 | int avail; | 683 | int avail; |
686 | int used; | 684 | int used; |
687 | int size; | 685 | int size; |
688 | int dtype; | ||
689 | int jhead; | 686 | int jhead; |
690 | int (*sync_callback)(struct ubifs_info *c, int lnum, int free, int pad); | 687 | int (*sync_callback)(struct ubifs_info *c, int lnum, int free, int pad); |
691 | struct mutex io_mutex; | 688 | struct mutex io_mutex; |
@@ -1469,22 +1466,20 @@ void ubifs_ro_mode(struct ubifs_info *c, int err); | |||
1469 | int ubifs_leb_read(const struct ubifs_info *c, int lnum, void *buf, int offs, | 1466 | int ubifs_leb_read(const struct ubifs_info *c, int lnum, void *buf, int offs, |
1470 | int len, int even_ebadmsg); | 1467 | int len, int even_ebadmsg); |
1471 | int ubifs_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs, | 1468 | int ubifs_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs, |
1472 | int len, int dtype); | 1469 | int len); |
1473 | int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len, | 1470 | int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len); |
1474 | int dtype); | ||
1475 | int ubifs_leb_unmap(struct ubifs_info *c, int lnum); | 1471 | int ubifs_leb_unmap(struct ubifs_info *c, int lnum); |
1476 | int ubifs_leb_map(struct ubifs_info *c, int lnum, int dtype); | 1472 | int ubifs_leb_map(struct ubifs_info *c, int lnum); |
1477 | int ubifs_is_mapped(const struct ubifs_info *c, int lnum); | 1473 | int ubifs_is_mapped(const struct ubifs_info *c, int lnum); |
1478 | int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len); | 1474 | int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len); |
1479 | int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf, int lnum, int offs, | 1475 | int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf, int lnum, int offs); |
1480 | int dtype); | ||
1481 | int ubifs_wbuf_init(struct ubifs_info *c, struct ubifs_wbuf *wbuf); | 1476 | int ubifs_wbuf_init(struct ubifs_info *c, struct ubifs_wbuf *wbuf); |
1482 | int ubifs_read_node(const struct ubifs_info *c, void *buf, int type, int len, | 1477 | int ubifs_read_node(const struct ubifs_info *c, void *buf, int type, int len, |
1483 | int lnum, int offs); | 1478 | int lnum, int offs); |
1484 | int ubifs_read_node_wbuf(struct ubifs_wbuf *wbuf, void *buf, int type, int len, | 1479 | int ubifs_read_node_wbuf(struct ubifs_wbuf *wbuf, void *buf, int type, int len, |
1485 | int lnum, int offs); | 1480 | int lnum, int offs); |
1486 | int ubifs_write_node(struct ubifs_info *c, void *node, int len, int lnum, | 1481 | int ubifs_write_node(struct ubifs_info *c, void *node, int len, int lnum, |
1487 | int offs, int dtype); | 1482 | int offs); |
1488 | int ubifs_check_node(const struct ubifs_info *c, const void *buf, int lnum, | 1483 | int ubifs_check_node(const struct ubifs_info *c, const void *buf, int lnum, |
1489 | int offs, int quiet, int must_chk_crc); | 1484 | int offs, int quiet, int must_chk_crc); |
1490 | void ubifs_prepare_node(struct ubifs_info *c, void *buf, int len, int pad); | 1485 | void ubifs_prepare_node(struct ubifs_info *c, void *buf, int len, int pad); |