aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/compr.c4
-rw-r--r--fs/jffs2/compr_zlib.c4
-rw-r--r--fs/jffs2/file.c20
-rw-r--r--fs/jffs2/nodelist.c4
-rw-r--r--fs/jffs2/scan.c6
-rw-r--r--fs/jffs2/summary.c2
-rw-r--r--fs/jffs2/super.c14
7 files changed, 37 insertions, 17 deletions
diff --git a/fs/jffs2/compr.c b/fs/jffs2/compr.c
index e7944e665b9f..5f45e01d71ed 100644
--- a/fs/jffs2/compr.c
+++ b/fs/jffs2/compr.c
@@ -412,7 +412,7 @@ void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig)
412 kfree(comprbuf); 412 kfree(comprbuf);
413} 413}
414 414
415int jffs2_compressors_init(void) 415int __init jffs2_compressors_init(void)
416{ 416{
417/* Registering compressors */ 417/* Registering compressors */
418#ifdef CONFIG_JFFS2_ZLIB 418#ifdef CONFIG_JFFS2_ZLIB
@@ -440,7 +440,7 @@ int jffs2_compressors_init(void)
440 return 0; 440 return 0;
441} 441}
442 442
443int jffs2_compressors_exit(void) 443int __exit jffs2_compressors_exit(void)
444{ 444{
445/* Unregistering compressors */ 445/* Unregistering compressors */
446#ifdef CONFIG_JFFS2_RUBIN 446#ifdef CONFIG_JFFS2_RUBIN
diff --git a/fs/jffs2/compr_zlib.c b/fs/jffs2/compr_zlib.c
index 5c63e0cdcf4c..d43cbac4fb9b 100644
--- a/fs/jffs2/compr_zlib.c
+++ b/fs/jffs2/compr_zlib.c
@@ -60,7 +60,7 @@ static int __init alloc_workspaces(void)
60 return 0; 60 return 0;
61} 61}
62 62
63static void free_workspaces(void) 63static void __exit free_workspaces(void)
64{ 64{
65 vfree(def_strm.workspace); 65 vfree(def_strm.workspace);
66 vfree(inf_strm.workspace); 66 vfree(inf_strm.workspace);
@@ -216,7 +216,7 @@ int __init jffs2_zlib_init(void)
216 return ret; 216 return ret;
217} 217}
218 218
219void jffs2_zlib_exit(void) 219void __exit jffs2_zlib_exit(void)
220{ 220{
221 jffs2_unregister_compressor(&jffs2_zlib_comp); 221 jffs2_unregister_compressor(&jffs2_zlib_comp);
222 free_workspaces(); 222 free_workspaces();
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
index e92187f34d5f..e18c9437d58f 100644
--- a/fs/jffs2/file.c
+++ b/fs/jffs2/file.c
@@ -220,12 +220,20 @@ static int jffs2_commit_write (struct file *filp, struct page *pg,
220 D1(printk(KERN_DEBUG "jffs2_commit_write(): ino #%lu, page at 0x%lx, range %d-%d, flags %lx\n", 220 D1(printk(KERN_DEBUG "jffs2_commit_write(): ino #%lu, page at 0x%lx, range %d-%d, flags %lx\n",
221 inode->i_ino, pg->index << PAGE_CACHE_SHIFT, start, end, pg->flags)); 221 inode->i_ino, pg->index << PAGE_CACHE_SHIFT, start, end, pg->flags));
222 222
223 if (!start && end == PAGE_CACHE_SIZE) { 223 if (end == PAGE_CACHE_SIZE) {
224 /* We need to avoid deadlock with page_cache_read() in 224 if (!start) {
225 jffs2_garbage_collect_pass(). So we have to mark the 225 /* We need to avoid deadlock with page_cache_read() in
226 page up to date, to prevent page_cache_read() from 226 jffs2_garbage_collect_pass(). So we have to mark the
227 trying to re-lock it. */ 227 page up to date, to prevent page_cache_read() from
228 SetPageUptodate(pg); 228 trying to re-lock it. */
229 SetPageUptodate(pg);
230 } else {
231 /* When writing out the end of a page, write out the
232 _whole_ page. This helps to reduce the number of
233 nodes in files which have many short writes, like
234 syslog files. */
235 start = aligned_start = 0;
236 }
229 } 237 }
230 238
231 ri = jffs2_alloc_raw_inode(); 239 ri = jffs2_alloc_raw_inode();
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c
index 9c575733659b..4973cd648ba8 100644
--- a/fs/jffs2/nodelist.c
+++ b/fs/jffs2/nodelist.c
@@ -438,7 +438,7 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info
438 if (c->mtd->point) { 438 if (c->mtd->point) {
439 err = c->mtd->point(c->mtd, ofs, len, &retlen, &buffer); 439 err = c->mtd->point(c->mtd, ofs, len, &retlen, &buffer);
440 if (!err && retlen < tn->csize) { 440 if (!err && retlen < tn->csize) {
441 JFFS2_WARNING("MTD point returned len too short: %u instead of %u.\n", retlen, tn->csize); 441 JFFS2_WARNING("MTD point returned len too short: %zu instead of %u.\n", retlen, tn->csize);
442 c->mtd->unpoint(c->mtd, buffer, ofs, len); 442 c->mtd->unpoint(c->mtd, buffer, ofs, len);
443 } else if (err) 443 } else if (err)
444 JFFS2_WARNING("MTD point failed: error code %d.\n", err); 444 JFFS2_WARNING("MTD point failed: error code %d.\n", err);
@@ -461,7 +461,7 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info
461 } 461 }
462 462
463 if (retlen != len) { 463 if (retlen != len) {
464 JFFS2_ERROR("short read at %#08x: %d instead of %d.\n", ofs, retlen, len); 464 JFFS2_ERROR("short read at %#08x: %zd instead of %d.\n", ofs, retlen, len);
465 err = -EIO; 465 err = -EIO;
466 goto free_out; 466 goto free_out;
467 } 467 }
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 0a79fc921e9f..5847e76ce16c 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -222,9 +222,6 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
222 } 222 }
223 } 223 }
224 224
225 if (jffs2_sum_active() && s)
226 kfree(s);
227
228 /* Nextblock dirty is always seen as wasted, because we cannot recycle it now */ 225 /* Nextblock dirty is always seen as wasted, because we cannot recycle it now */
229 if (c->nextblock && (c->nextblock->dirty_size)) { 226 if (c->nextblock && (c->nextblock->dirty_size)) {
230 c->nextblock->wasted_size += c->nextblock->dirty_size; 227 c->nextblock->wasted_size += c->nextblock->dirty_size;
@@ -266,6 +263,9 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
266 else 263 else
267 c->mtd->unpoint(c->mtd, flashbuf, 0, c->mtd->size); 264 c->mtd->unpoint(c->mtd, flashbuf, 0, c->mtd->size);
268#endif 265#endif
266 if (s)
267 kfree(s);
268
269 return ret; 269 return ret;
270} 270}
271 271
diff --git a/fs/jffs2/summary.c b/fs/jffs2/summary.c
index 9763d73c0da1..439b9f6d5837 100644
--- a/fs/jffs2/summary.c
+++ b/fs/jffs2/summary.c
@@ -853,7 +853,7 @@ static int jffs2_sum_write_data(struct jffs2_sb_info *c, struct jffs2_eraseblock
853 853
854 854
855 if (ret || (retlen != infosize)) { 855 if (ret || (retlen != infosize)) {
856 JFFS2_WARNING("Write of %d bytes at 0x%08x failed. returned %d, retlen %zu\n", 856 JFFS2_WARNING("Write of %u bytes at 0x%08x failed. returned %d, retlen %zd\n",
857 infosize, jeb->offset + c->sector_size - jeb->free_size, ret, retlen); 857 infosize, jeb->offset + c->sector_size - jeb->free_size, ret, retlen);
858 858
859 c->summary->sum_size = JFFS2_SUMMARY_NOSUM_SIZE; 859 c->summary->sum_size = JFFS2_SUMMARY_NOSUM_SIZE;
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index c8b539ee7d80..9d0521451f59 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -324,6 +324,18 @@ static int __init init_jffs2_fs(void)
324{ 324{
325 int ret; 325 int ret;
326 326
327 /* Paranoia checks for on-medium structures. If we ask GCC
328 to pack them with __attribute__((packed)) then it _also_
329 assumes that they're not aligned -- so it emits crappy
330 code on some architectures. Ideally we want an attribute
331 which means just 'no padding', without the alignment
332 thing. But GCC doesn't have that -- we have to just
333 hope the structs are the right sizes, instead. */
334 BUG_ON(sizeof(struct jffs2_unknown_node) != 12);
335 BUG_ON(sizeof(struct jffs2_raw_dirent) != 40);
336 BUG_ON(sizeof(struct jffs2_raw_inode) != 68);
337 BUG_ON(sizeof(struct jffs2_raw_summary) != 32);
338
327 printk(KERN_INFO "JFFS2 version 2.2." 339 printk(KERN_INFO "JFFS2 version 2.2."
328#ifdef CONFIG_JFFS2_FS_WRITEBUFFER 340#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
329 " (NAND)" 341 " (NAND)"
@@ -331,7 +343,7 @@ static int __init init_jffs2_fs(void)
331#ifdef CONFIG_JFFS2_SUMMARY 343#ifdef CONFIG_JFFS2_SUMMARY
332 " (SUMMARY) " 344 " (SUMMARY) "
333#endif 345#endif
334 " (C) 2001-2003 Red Hat, Inc.\n"); 346 " (C) 2001-2006 Red Hat, Inc.\n");
335 347
336 jffs2_inode_cachep = kmem_cache_create("jffs2_i", 348 jffs2_inode_cachep = kmem_cache_create("jffs2_i",
337 sizeof(struct jffs2_inode_info), 349 sizeof(struct jffs2_inode_info),