Re: [PATCH] make last_inode counter in new_inode 32-bit on kernels that offer x86 compatability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux