[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061107161004.GS27140@parisc-linux.org>
Date: Tue, 7 Nov 2006 09:10:05 -0700
From: Matthew Wilcox <matthew@....cx>
To: Jeff Layton <jlayton@...hat.com>
Cc: Eric Sandeen <sandeen@...hat.com>,
J?rn Engel <joern@...nheim.fh-wedel.de>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] make last_inode counter in new_inode 32-bit on kernels that offer x86 compatability
On Tue, Nov 07, 2006 at 10:56:06AM -0500, Jeff Layton wrote:
> retry:
> - if (counter > max_reserved) {
> - head = inode_hashtable + hash(sb,counter);
> - res = counter++;
> + if (sb->s_lastino >= max_reserved) {
> + head = inode_hashtable + hash(sb,++sb->s_lastino);
> + res = sb->s_lastino;
I think it'd be clearer to write this as:
res = ++sb->s_lastino;
head = inode_hashtable + hash(sb, res);
My eye skipped over the preincrement entirely the way it's currently
written.
> inode = find_inode_fast(sb, head, res);
> if (!inode) {
> spin_unlock(&inode_lock);
> return res;
> }
> } else {
> - counter = max_reserved + 1;
> + sb->s_lastino = max_reserved;
> }
> goto retry;
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists