Commit 3361c7be authored by Jeffrey Layton's avatar Jeffrey Layton Committed by Linus Torvalds
Browse files

make iunique use a do/while loop rather than its obscure goto loop

A while back, Christoph mentioned that he thought that iunique ought to be
cleaned up to use a more conventional loop construct. This patch does that,
turning the strange goto loop into a do/while.
Signed-off-by: default avatarJeff Layton <>
Cc: Christoph Hellwig <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 9d0633cf
......@@ -685,25 +685,21 @@ ino_t iunique(struct super_block *sb, ino_t max_reserved)
static ino_t counter;
struct inode *inode;
struct hlist_head * head;
struct hlist_head *head;
ino_t res;
if (counter > max_reserved) {
head = inode_hashtable + hash(sb,counter);
do {
if (counter <= max_reserved)
counter = max_reserved + 1;
res = counter++;
head = inode_hashtable + hash(sb, res);
inode = find_inode_fast(sb, head, res);
if (!inode) {
return res;
} else {
counter = max_reserved + 1;
goto retry;
} while (inode != NULL);
return res;
struct inode *igrab(struct inode *inode)
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