diff options
Diffstat (limited to 'fs/jffs/intrep.c')
-rw-r--r-- | fs/jffs/intrep.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/jffs/intrep.c b/fs/jffs/intrep.c index 4a543e114970..6dd18911b44c 100644 --- a/fs/jffs/intrep.c +++ b/fs/jffs/intrep.c | |||
@@ -66,6 +66,7 @@ | |||
66 | #include <linux/smp_lock.h> | 66 | #include <linux/smp_lock.h> |
67 | #include <linux/time.h> | 67 | #include <linux/time.h> |
68 | #include <linux/ctype.h> | 68 | #include <linux/ctype.h> |
69 | #include <linux/freezer.h> | ||
69 | 70 | ||
70 | #include "intrep.h" | 71 | #include "intrep.h" |
71 | #include "jffs_fm.h" | 72 | #include "jffs_fm.h" |
@@ -435,7 +436,7 @@ jffs_checksum_flash(struct mtd_info *mtd, loff_t start, int size, __u32 *result) | |||
435 | int i, length; | 436 | int i, length; |
436 | 437 | ||
437 | /* Allocate read buffer */ | 438 | /* Allocate read buffer */ |
438 | read_buf = (__u8 *) kmalloc (sizeof(__u8) * 4096, GFP_KERNEL); | 439 | read_buf = kmalloc(sizeof(__u8) * 4096, GFP_KERNEL); |
439 | if (!read_buf) { | 440 | if (!read_buf) { |
440 | printk(KERN_NOTICE "kmalloc failed in jffs_checksum_flash()\n"); | 441 | printk(KERN_NOTICE "kmalloc failed in jffs_checksum_flash()\n"); |
441 | return -ENOMEM; | 442 | return -ENOMEM; |
@@ -591,7 +592,7 @@ jffs_add_virtual_root(struct jffs_control *c) | |||
591 | D2(printk("jffs_add_virtual_root(): " | 592 | D2(printk("jffs_add_virtual_root(): " |
592 | "Creating a virtual root directory.\n")); | 593 | "Creating a virtual root directory.\n")); |
593 | 594 | ||
594 | if (!(root = kmalloc(sizeof(struct jffs_file), GFP_KERNEL))) { | 595 | if (!(root = kzalloc(sizeof(struct jffs_file), GFP_KERNEL))) { |
595 | return -ENOMEM; | 596 | return -ENOMEM; |
596 | } | 597 | } |
597 | no_jffs_file++; | 598 | no_jffs_file++; |
@@ -603,7 +604,6 @@ jffs_add_virtual_root(struct jffs_control *c) | |||
603 | DJM(no_jffs_node++); | 604 | DJM(no_jffs_node++); |
604 | memset(node, 0, sizeof(struct jffs_node)); | 605 | memset(node, 0, sizeof(struct jffs_node)); |
605 | node->ino = JFFS_MIN_INO; | 606 | node->ino = JFFS_MIN_INO; |
606 | memset(root, 0, sizeof(struct jffs_file)); | ||
607 | root->ino = JFFS_MIN_INO; | 607 | root->ino = JFFS_MIN_INO; |
608 | root->mode = S_IFDIR | S_IRWXU | S_IRGRP | 608 | root->mode = S_IFDIR | S_IRWXU | S_IRGRP |
609 | | S_IXGRP | S_IROTH | S_IXOTH; | 609 | | S_IXGRP | S_IROTH | S_IXOTH; |
@@ -744,11 +744,11 @@ static int check_partly_erased_sectors(struct jffs_fmcontrol *fmc){ | |||
744 | 744 | ||
745 | 745 | ||
746 | /* Allocate read buffers */ | 746 | /* Allocate read buffers */ |
747 | read_buf1 = (__u8 *) kmalloc (sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL); | 747 | read_buf1 = kmalloc(sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL); |
748 | if (!read_buf1) | 748 | if (!read_buf1) |
749 | return -ENOMEM; | 749 | return -ENOMEM; |
750 | 750 | ||
751 | read_buf2 = (__u8 *) kmalloc (sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL); | 751 | read_buf2 = kmalloc(sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL); |
752 | if (!read_buf2) { | 752 | if (!read_buf2) { |
753 | kfree(read_buf1); | 753 | kfree(read_buf1); |
754 | return -ENOMEM; | 754 | return -ENOMEM; |
@@ -876,7 +876,7 @@ jffs_scan_flash(struct jffs_control *c) | |||
876 | } | 876 | } |
877 | 877 | ||
878 | /* Allocate read buffer */ | 878 | /* Allocate read buffer */ |
879 | read_buf = (__u8 *) kmalloc (sizeof(__u8) * 4096, GFP_KERNEL); | 879 | read_buf = kmalloc(sizeof(__u8) * 4096, GFP_KERNEL); |
880 | if (!read_buf) { | 880 | if (!read_buf) { |
881 | flash_safe_release(fmc->mtd); | 881 | flash_safe_release(fmc->mtd); |
882 | return -ENOMEM; | 882 | return -ENOMEM; |
@@ -1463,7 +1463,7 @@ jffs_insert_node(struct jffs_control *c, struct jffs_file *f, | |||
1463 | kfree(f->name); | 1463 | kfree(f->name); |
1464 | DJM(no_name--); | 1464 | DJM(no_name--); |
1465 | } | 1465 | } |
1466 | if (!(f->name = (char *) kmalloc(raw_inode->nsize + 1, | 1466 | if (!(f->name = kmalloc(raw_inode->nsize + 1, |
1467 | GFP_KERNEL))) { | 1467 | GFP_KERNEL))) { |
1468 | return -ENOMEM; | 1468 | return -ENOMEM; |
1469 | } | 1469 | } |
@@ -1737,7 +1737,7 @@ jffs_find_child(struct jffs_file *dir, const char *name, int len) | |||
1737 | printk("jffs_find_child(): Found \"%s\".\n", f->name); | 1737 | printk("jffs_find_child(): Found \"%s\".\n", f->name); |
1738 | } | 1738 | } |
1739 | else { | 1739 | else { |
1740 | char *copy = (char *) kmalloc(len + 1, GFP_KERNEL); | 1740 | char *copy = kmalloc(len + 1, GFP_KERNEL); |
1741 | if (copy) { | 1741 | if (copy) { |
1742 | memcpy(copy, name, len); | 1742 | memcpy(copy, name, len); |
1743 | copy[len] = '\0'; | 1743 | copy[len] = '\0'; |
@@ -2627,7 +2627,7 @@ jffs_print_tree(struct jffs_file *first_file, int indent) | |||
2627 | return; | 2627 | return; |
2628 | } | 2628 | } |
2629 | 2629 | ||
2630 | if (!(space = (char *) kmalloc(indent + 1, GFP_KERNEL))) { | 2630 | if (!(space = kmalloc(indent + 1, GFP_KERNEL))) { |
2631 | printk("jffs_print_tree(): Out of memory!\n"); | 2631 | printk("jffs_print_tree(): Out of memory!\n"); |
2632 | return; | 2632 | return; |
2633 | } | 2633 | } |