Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ae51a32 authored by Luis de Bethencourt's avatar Luis de Bethencourt
Browse files

befs: use simpler while loop



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

Signed-off-by: default avatarLuis de Bethencourt <luisbg@osg.samsung.com>
parent 50858ef9
Loading
Loading
Loading
Loading
+38 −36
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ befs_readdir(struct file *file, struct dir_context *ctx)
	befs_debug(sb, "---> %s name %pD, inode %ld, ctx->pos %lld",
		  __func__, file, inode->i_ino, ctx->pos);

more:
	while (1) {
		result = befs_btree_read(sb, ds, ctx->pos, BEFS_NAME_LEN + 1,
					 keybuf, &keysize, &value);

@@ -239,8 +239,10 @@ befs_readdir(struct file *file, struct dir_context *ctx)
		if (BEFS_SB(sb)->nls) {
			char *nlsname;
			int nlsnamelen;

			result =
		    befs_utf2nls(sb, keybuf, keysize, &nlsname, &nlsnamelen);
			    befs_utf2nls(sb, keybuf, keysize, &nlsname,
					 &nlsnamelen);
			if (result < 0) {
				befs_debug(sb, "<--- %s ERROR", __func__);
				return result;
@@ -257,7 +259,7 @@ befs_readdir(struct file *file, struct dir_context *ctx)
				return 0;
		}
		ctx->pos++;
	goto more;
	}
}

static struct inode *