[lkml]   [2000]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
On Thu, 7 Dec 2000, Szabolcs Szakacsits wrote:
> Read the whole get_empty_filp function, especially this part, note the
> goto new_one below and the part you didn't include above [from
> the new_one label],
> if (files_stat.nr_files < files_stat.max_files) {
> file_list_unlock();
> f = kmem_cache_alloc(filp_cachep, SLAB_KERNEL);
> file_list_lock();
> if (f) {
> files_stat.nr_files++;
> goto new_one;
> }

I have read the whole function, including the above code, of course. The
new_one label has nothing to do with freelists -- it adds the file to the
anon_list, where the new arrivales from the slab cache go. The goto
new_one above is there simply to initialize the structure with sane
initial values

So, the normal user _cannot_ take a file structure from the freelist
unless it contains more than NR_RESERVED_FILE entries. Please read the
whole function and see it for yourself.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:51    [W:0.042 / U:18.988 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site