befs: use simpler while loop

Replace goto with simpler while loop to make befs_readdir() more readable.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
This commit is contained in:
Luis de Bethencourt 2016-07-01 01:07:32 +01:00
parent 50858ef96d
commit 9ae51a32b1

View File

@ -216,7 +216,7 @@ befs_readdir(struct file *file, struct dir_context *ctx)
befs_debug(sb, "---> %s name %pD, inode %ld, ctx->pos %lld", befs_debug(sb, "---> %s name %pD, inode %ld, ctx->pos %lld",
__func__, file, inode->i_ino, ctx->pos); __func__, file, inode->i_ino, ctx->pos);
more: while (1) {
result = befs_btree_read(sb, ds, ctx->pos, BEFS_NAME_LEN + 1, result = befs_btree_read(sb, ds, ctx->pos, BEFS_NAME_LEN + 1,
keybuf, &keysize, &value); keybuf, &keysize, &value);
@ -239,8 +239,10 @@ more:
if (BEFS_SB(sb)->nls) { if (BEFS_SB(sb)->nls) {
char *nlsname; char *nlsname;
int nlsnamelen; int nlsnamelen;
result = result =
befs_utf2nls(sb, keybuf, keysize, &nlsname, &nlsnamelen); befs_utf2nls(sb, keybuf, keysize, &nlsname,
&nlsnamelen);
if (result < 0) { if (result < 0) {
befs_debug(sb, "<--- %s ERROR", __func__); befs_debug(sb, "<--- %s ERROR", __func__);
return result; return result;
@ -257,7 +259,7 @@ more:
return 0; return 0;
} }
ctx->pos++; ctx->pos++;
goto more; }
} }
static struct inode * static struct inode *