lkml.org 
[lkml]   [2008]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/7] omfs: add inode routines
On Thu, Mar 27, 2008 at 07:13:50AM +0100, Andi Kleen wrote:
> Bob Copeland <me@bobcopeland.com> writes:
> > +
> > + bitmap_size = (sbi->s_num_blocks + 7) / 8;
> > + array_size = (bitmap_size + sb->s_blocksize - 1) / sb->s_blocksize;
> > +
> > + sbi->s_imap_size = array_size;
> > + sbi->s_imap = kzalloc(array_size * sizeof(unsigned long), GFP_KERNEL);
>
>
> If the array can be really 300k you should probably have a vmalloc fallback
> here.

bitmap_size will be 300k (20G / 8192 / 8), but array_size adds another
level of indirection so s_imap will be 300k/8192 segments, each of size
8192. Hmm, I guess that should be 'sizeof(unsigned long *)' above.

One might wonder why we keep it in memory anyway since we can read the
bitmap blocks on demand. The reason is that once the tree walk is added
for ReplayTV then it would use this same i_map. However, I've yet to
hear from interested RTV folks so it is currently read-only and there is
no tree walk for the bitmap.

--
Bob Copeland %% www.bobcopeland.com



\
 
 \ /
  Last update: 2008-03-27 13:45    [W:0.060 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site