On Sun, 22 Dec 2002, Daniel Greenberg wrote:

> I would think a circular list would solve the problem, especially if the
> list size is big enough.  Is a circular list with 256 entries large
> enough?  (From looking at mfs.c it looks like hlist_stack_size was once
> set to 32.)  Is there a risk in increasing the hlist stack size beyond
> 256?

I think that 32767 is the maximum.

> Regardless of list size, would a change to mfs.c like this work:
>
> static __inline__ int
> hlist_push(struct dir_ent *hlist, unsigned psp)
> {
>   Debug0((dbg_fd, "hlist_push: %d hlist=%p PSP=%d\n", hlist_stack_indx,
> hlist, psp));
>   if (hlist_stack_indx >= HLIST_STACK_SIZE) {
>     Debug0((dbg_fd, "hlist_push: past maximum stack"));
> -   return -1;
> +   hlist_stack_indx = 0;
> +   hlist_stack[hlist_stack_indx] = hlist;
> +   hlist_psp_stack[hlist_stack_indx] = psp;
> +   return hlist_stack_indx++;
>   }
>   else {
>     hlist_stack[hlist_stack_indx] = hlist;
>     hlist_psp_stack[hlist_stack_indx] = psp;
>     return hlist_stack_indx++;
>   }
> }

yes and no. basically here you are resetting the stack. Now all the old
hlists will be leaked (in memory, as malloc()ed structures). Well, a
better solution should come later.

Bart


-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to