No, but one tiny thing I did notice, you check if f->f_count is 0
(if(!f->f_count)) then tou do f->f_... = ... = f->f_count = ... = 0;
ie f->f_count is allready 0 so no need to set it any more, this is
offcource a very small thing and might be optimized away by the
compiler but it's not nessesery IMO...
> Michael.
>
> --- linux/fs/file_table.c.old Tue Jul 30 19:47:35 1996
> +++ linux/fs/file_table.c Tue Jul 30 19:59:41 1996
> @@ -102,7 +102,7 @@
> {
> int i;
> int max = max_files;
> - struct file * f;
> + static struct file * f = NULL;
>
> /*
> * Reserve a few files for the super-user..
> @@ -111,15 +111,25 @@
> max -= 10;
>
> /* if the return is taken, we are in deep trouble */
> - if (!first_file && !grow_files())
> - return NULL;
> + if (!first_file) {
> + if (!grow_files())
> + return NULL;
> + f = first_file;
> + }
>
> do {
> - for (f = first_file, i=0; i < nr_files; i++, f = f->f_next)
> + for (f = f->next, i=0; i < nr_files; i++, f = f->f_next)
> if (!f->f_count) {
> +#if 1
> + f->f_mode = f->f_pos = f->f_flags = f->f_count =
> + f->f_reada = f->f_ramax = f->f_raend = f->f_ralen =
> + f->f_rawin = f->f_owner = 0;
> + f->private_data = f->f_op = f->f_inode = NULL;
> +#else
> remove_file_free(f);
> memset(f,0,sizeof(*f));
> put_last_free(f);
> +#endif
> f->f_count = 1;
> f->f_version = ++event;
> return f;
>
-- Johnny Stenback, programmer / University of Vaasa, Computer Centre E-Mail jst@uwasa.fi, Phone +358 61 3248 387, +358 50 5575 094