lkml.org 
[lkml]   [2010]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 15/18] fs: introduce a per-cpu last_ino allocator
On Fri, Oct 08, 2010 at 04:06:12PM +0200, Eric Dumazet wrote:
> On 32bit arches, inum for sockets/pipes could be pretty fast
>
> unsigned u32 rnd_val __read_mostly; /* seeded at boot time */
>
> unsigned u32 get_inum(struct inode *ino, size_t size)
> {
> return rnd_val ^ ((long)ino + random32() % size);
> }
>
> (Ie , use fact that an inode is a kernel object, with a given address
> and a given size, two inodes cannot overlap)

Yeah, we could probably do this. From looking at the remaining users
of the last_ino replacement this could probably work for them.



\
 
 \ /
  Last update: 2010-10-08 21:13    [W:0.216 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site