Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252486
b: refs/heads/master
c: 1ddd0d9
h: refs/heads/master
v: v3
  • Loading branch information
Grant Erickson authored and David Woodhouse committed May 25, 2011
1 parent 279e61c commit 12060c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e45cf5e85a4f344fc4c8c901ac057a2402db125
refs/heads/master: 1ddd0d9a3177356f2a29c8f3826ad79e1ad18397
19 changes: 11 additions & 8 deletions trunk/fs/jffs2/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
uint32_t buf_size = 0;
struct jffs2_summary *s = NULL; /* summary info collected by the scan process */
#ifndef __ECOS
size_t pointlen;
size_t pointlen, try_size;

if (c->mtd->point) {
ret = c->mtd->point(c->mtd, 0, c->mtd->size, &pointlen,
Expand All @@ -113,18 +113,21 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
/* For NAND it's quicker to read a whole eraseblock at a time,
apparently */
if (jffs2_cleanmarker_oob(c))
buf_size = c->sector_size;
try_size = c->sector_size;
else
buf_size = PAGE_SIZE;
try_size = PAGE_SIZE;

/* Respect kmalloc limitations */
if (buf_size > 128*1024)
buf_size = 128*1024;
D1(printk(KERN_DEBUG "Trying to allocate readbuf of %zu "
"bytes\n", try_size));

D1(printk(KERN_DEBUG "Allocating readbuf of %d bytes\n", buf_size));
flashbuf = kmalloc(buf_size, GFP_KERNEL);
flashbuf = mtd_kmalloc_up_to(c->mtd, &try_size);
if (!flashbuf)
return -ENOMEM;

D1(printk(KERN_DEBUG "Allocated readbuf of %zu bytes\n",
try_size));

buf_size = (uint32_t)try_size;
}

if (jffs2_sum_active()) {
Expand Down

0 comments on commit 12060c7

Please sign in to comment.