lkml.org 
[lkml]   [2004]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: software suspend patch [2/6]
Hi!

> @@ -222,8 +221,105 @@ static void lock_swapdevices(void)
> }
> swap_list_unlock();
> }
> +
> +#define ONE_PAGE_PBE_NUM (PAGE_SIZE/sizeof(struct pbe))
> +#define PBE_IS_PAGE_END(x) \
> + ( PAGE_SIZE - sizeof(struct pbe) == ((x) - ((~(PAGE_SIZE - 1)) & (x))) )
> +
> +#define pgdir_for_each_safe(pos, n, head) \
> + for(pos = head, n = pos ? (suspend_pagedir_t*)pos->dummy.val : NULL; \
> + pos != NULL; \
> + pos = n, n = pos ? (suspend_pagedir_t *)pos->dummy.val : NULL)
> +
> +#define pbe_for_each_safe(pos, n, index, max, head) \
> + for(pos = head, index = 0, \
> + n = pos ? (struct pbe *)pos->dummy.val : NULL; \
> + (pos != NULL) && (index < max); \
> + pos = (PBE_IS_PAGE_END((unsigned long)pos)) ? n : \
> + ((struct pbe *)((unsigned long)pos + sizeof(struct pbe))), \
> + index ++, \
> + n = pos ? (struct pbe*)pos->dummy.val : NULL)
> +

_safe suffix means it is safe to delete while traversing. I do not
think your macros can handle that, so you should not have _safe
suffix.
Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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