From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher denx Date: Tue, 30 Jun 2015 11:01:43 +0200 Subject: [U-Boot] [PATCH 1/8] JFFS2: Return early when file read not necessary In-Reply-To: <1435554149-18042-2-git-send-email-mark.tomlinson@alliedtelesis.co.nz> References: <1435554149-18042-1-git-send-email-mark.tomlinson@alliedtelesis.co.nz> <1435554149-18042-2-git-send-email-mark.tomlinson@alliedtelesis.co.nz> Message-ID: <55925AF7.9030708@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Mark, Am 29.06.2015 um 07:02 schrieb Mark Tomlinson: > 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: Mark Tomlinson > --- > > fs/jffs2/jffs2_1pass.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c > index b1d6470..2335db1 100644 > --- a/fs/jffs2/jffs2_1pass.c > +++ b/fs/jffs2/jffs2_1pass.c > @@ -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. > + */ please change this into /* * If no destination is provided, we are done. * Just return the total size. */ to fit with Coding style. > + if (!dest) { > + return totalSize; > + } no {} needed Beside of this: Acked-by: Heiko Schocher bye, Heiko > #endif > > for (b = pL->frag.listHead; b != NULL; b = b->next) { > -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany