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

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

staging: lustre: llite: reduce indent in ll_dir_read



Instead of making a large chunk of code conditional
based on if a page is valid we reverse the page
validity test and exit the loop if the page is invalid
instead. This allows a section of code to reduce its
indentation one level.

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 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 0ddf80c1
Loading
Loading
Loading
Loading
+72 −75
Original line number Diff line number Diff line
@@ -508,15 +508,15 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
	while (rc == 0 && !done) {
		struct lu_dirpage *dp;
		struct lu_dirent  *ent;

		if (!IS_ERR(page)) {
			/*
			 * If page is empty (end of directory is reached),
			 * use this value.
			 */
			__u64 hash = MDS_DIR_END_OFF;
		__u64 hash;
		__u64 next;

		if (IS_ERR(page)) {
			rc = PTR_ERR(page);
			break;
		}

		hash = MDS_DIR_END_OFF;
		dp = page_address(page);
		for (ent = lu_dirent_start(dp); ent && !done;
		     ent = lu_dirent_next(ent)) {
@@ -593,9 +593,6 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
			pos = hash;
			ll_release_page(page, 0);
		}
		} else {
			rc = PTR_ERR(page);
		}
	}

	ctx->pos = pos;