提交 3799b3f4 编写于 作者: M Mark Tomlinson 提交者: Tom Rini

JFFS2: Return early when file read not necessary

If a destination is not provided, jffs2_1pass_read_inode() only
returns the length of the file. In this case, avoid reading all
the data nodes, and return as soon as the length of the file is
known.
Signed-off-by: NMark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
上级 39d0ce06
......@@ -719,6 +719,12 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, char *dest)
}
put_fl_mem(jNode, pL->readbuf);
}
/*
* If no destination is provided, we are done.
* Just return the total size.
*/
if (!dest)
return totalSize;
#endif
for (b = pL->frag.listHead; b != NULL; b = b->next) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册