Hi,
Unless I am mistaken, we return stuff (entry) from the local
stack in swapfile.c::get_swap_page. Am I mistaken?
Code in question:
swp_entry_t get_swap_page(void)
{
struct swap_info_struct * p;
unsigned long offset;
swp_entry_t entry;
int type, wrapped = 0;
entry.val = 0; /* Out of memory */
[...]
out:
swap_list_unlock();
return entry;
}
Regards,
Rasmus
commence Rasmus Andersen quotation:
> Unless I am mistaken, we return stuff (entry) from the local
> stack in swapfile.c::get_swap_page. Am I mistaken?
Wouldn't this only be a problem if a *pointer* to it was being
returned?
> Code in question:
>
> swp_entry_t get_swap_page(void)
> {
> struct swap_info_struct * p;
> unsigned long offset;
> swp_entry_t entry;
> int type, wrapped = 0;
>
> entry.val = 0; /* Out of memory */
> [...]
>
> out:
> swap_list_unlock();
> return entry;
> }
--
/ |
[|] Sean Neakums | Questions are a burden to others;
[|] <[email protected]> | answers a prison for oneself.
\ |
On Sun, Oct 20, 2002 at 08:36:46PM +0100, Sean Neakums wrote:
> commence Rasmus Andersen quotation:
>
> > Unless I am mistaken, we return stuff (entry) from the local
> > stack in swapfile.c::get_swap_page. Am I mistaken?
>
> Wouldn't this only be a problem if a *pointer* to it was being
> returned?
Quite. Sorry about that. I'll be a good boy and go to bed now :)
Regards,
Rasmus
On Sun, Oct 20, 2002 at 09:36:52PM +0200, bert hubert wrote:
> On Sun, Oct 20, 2002 at 09:32:17PM +0200, Rasmus Andersen wrote:
>
> > Unless I am mistaken, we return stuff (entry) from the local
> > stack in swapfile.c::get_swap_page. Am I mistaken?
>
> Yes. This just returns a struct by value over the stack, which is frowned
> upon in some circles, but is not an error per se.
Hmm. You are right and I must be confused. -ENEEDSLEEP, apparently.
Thanks,
Rasmus
On Sun, Oct 20, 2002 at 09:32:17PM +0200, Rasmus Andersen wrote:
> Unless I am mistaken, we return stuff (entry) from the local
> stack in swapfile.c::get_swap_page. Am I mistaken?
Yes. This just returns a struct by value over the stack, which is frowned
upon in some circles, but is not an error per se.
Regards,
bert
--
http://www.PowerDNS.com Versatile DNS Software & Services
http://lartc.org Linux Advanced Routing & Traffic Control HOWTO