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

Commit fee8cc87 authored by wang di's avatar wang di Committed by Greg Kroah-Hartman
Browse files

staging: lustre: llite: handle done flags differently in ll_dir_read



Invert the done flag test to reduce the code indentation.
If done is true release the page and break out of the
while loop.

Signed-off-by: default avatarwang di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/10761
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4906


Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fb659ca1
Loading
Loading
Loading
Loading
+30 −29
Original line number Diff line number Diff line
@@ -562,7 +562,12 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
					 namelen, ino, type);
		}

		if (!done) {
		if (done) {
			pos = hash;
			ll_release_page(page, 0);
			break;
		}

		next = le64_to_cpu(dp->ldp_hash_end);
		pos = next;
		if (pos == MDS_DIR_END_OFF) {
@@ -590,10 +595,6 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
				LDF_COLLIDE);
			ll_release_page(page, 1);
		}
		} else {
			pos = hash;
			ll_release_page(page, 0);
		}
	}

	ctx->pos = pos;