diff options
Diffstat (limited to 'fs/jffs2/readinode.c')
-rw-r--r-- | fs/jffs2/readinode.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index ee57bac1ba6d..3093ac4fb24c 100644 --- a/fs/jffs2/readinode.c +++ b/fs/jffs2/readinode.c | |||
@@ -62,17 +62,15 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info | |||
62 | #ifndef __ECOS | 62 | #ifndef __ECOS |
63 | /* TODO: instead, incapsulate point() stuff to jffs2_flash_read(), | 63 | /* TODO: instead, incapsulate point() stuff to jffs2_flash_read(), |
64 | * adding and jffs2_flash_read_end() interface. */ | 64 | * adding and jffs2_flash_read_end() interface. */ |
65 | if (c->mtd->point) { | 65 | err = mtd_point(c->mtd, ofs, len, &retlen, (void **)&buffer, NULL); |
66 | err = c->mtd->point(c->mtd, ofs, len, &retlen, | 66 | if (!err && retlen < len) { |
67 | (void **)&buffer, NULL); | 67 | JFFS2_WARNING("MTD point returned len too short: %zu instead of %u.\n", retlen, tn->csize); |
68 | if (!err && retlen < len) { | 68 | mtd_unpoint(c->mtd, ofs, retlen); |
69 | JFFS2_WARNING("MTD point returned len too short: %zu instead of %u.\n", retlen, tn->csize); | 69 | } else if (err) { |
70 | c->mtd->unpoint(c->mtd, ofs, retlen); | 70 | if (err != -EOPNOTSUPP) |
71 | } else if (err) | ||
72 | JFFS2_WARNING("MTD point failed: error code %d.\n", err); | 71 | JFFS2_WARNING("MTD point failed: error code %d.\n", err); |
73 | else | 72 | } else |
74 | pointed = 1; /* succefully pointed to device */ | 73 | pointed = 1; /* succefully pointed to device */ |
75 | } | ||
76 | #endif | 74 | #endif |
77 | 75 | ||
78 | if (!pointed) { | 76 | if (!pointed) { |
@@ -101,7 +99,7 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info | |||
101 | kfree(buffer); | 99 | kfree(buffer); |
102 | #ifndef __ECOS | 100 | #ifndef __ECOS |
103 | else | 101 | else |
104 | c->mtd->unpoint(c->mtd, ofs, len); | 102 | mtd_unpoint(c->mtd, ofs, len); |
105 | #endif | 103 | #endif |
106 | 104 | ||
107 | if (crc != tn->data_crc) { | 105 | if (crc != tn->data_crc) { |
@@ -137,7 +135,7 @@ free_out: | |||
137 | kfree(buffer); | 135 | kfree(buffer); |
138 | #ifndef __ECOS | 136 | #ifndef __ECOS |
139 | else | 137 | else |
140 | c->mtd->unpoint(c->mtd, ofs, len); | 138 | mtd_unpoint(c->mtd, ofs, len); |
141 | #endif | 139 | #endif |
142 | return err; | 140 | return err; |
143 | } | 141 | } |