Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84198
b: refs/heads/master
c: 9252572
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse committed Nov 21, 2007
1 parent 61bc2dc commit d8d90f8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 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: 8547e583a1140698cab41bc3f687efe8f8b2bb41
refs/heads/master: 92525726df0c30e080b0fce9b0eb699c622d261e
29 changes: 15 additions & 14 deletions trunk/fs/jffs2/readinode.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,24 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info

BUG_ON(tn->csize == 0);

if (!jffs2_is_writebuffered(c))
goto adj_acc;

/* Calculate how many bytes were already checked */
ofs = ref_offset(ref) + sizeof(struct jffs2_raw_inode);
len = ofs % c->wbuf_pagesize;
if (likely(len))
len = c->wbuf_pagesize - len;

if (len >= tn->csize) {
dbg_readinode("no need to check node at %#08x, data length %u, data starts at %#08x - it has already been checked.\n",
ref_offset(ref), tn->csize, ofs);
goto adj_acc;
}
len = tn->csize;

if (jffs2_is_writebuffered(c)) {
int adj = ofs % c->wbuf_pagesize;
if (likely(adj))
adj = c->wbuf_pagesize - adj;

if (adj >= tn->csize) {
dbg_readinode("no need to check node at %#08x, data length %u, data starts at %#08x - it has already been checked.\n",
ref_offset(ref), tn->csize, ofs);
goto adj_acc;
}

ofs += len;
len = tn->csize - len;
ofs += adj;
len -= adj;
}

dbg_readinode("check node at %#08x, data length %u, partial CRC %#08x, correct CRC %#08x, data starts at %#08x, start checking from %#08x - %u bytes.\n",
ref_offset(ref), tn->csize, tn->partial_crc, tn->data_crc, ofs - len, ofs, len);
Expand Down

0 comments on commit d8d90f8

Please sign in to comment.