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

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-4906Reviewed-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
...@@ -562,7 +562,12 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data, ...@@ -562,7 +562,12 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
namelen, ino, type); namelen, ino, type);
} }
if (!done) { if (done) {
pos = hash;
ll_release_page(page, 0);
break;
}
next = le64_to_cpu(dp->ldp_hash_end); next = le64_to_cpu(dp->ldp_hash_end);
pos = next; pos = next;
if (pos == MDS_DIR_END_OFF) { if (pos == MDS_DIR_END_OFF) {
...@@ -590,10 +595,6 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data, ...@@ -590,10 +595,6 @@ int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
LDF_COLLIDE); LDF_COLLIDE);
ll_release_page(page, 1); ll_release_page(page, 1);
} }
} else {
pos = hash;
ll_release_page(page, 0);
}
} }
ctx->pos = pos; ctx->pos = pos;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment