linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: hugang@soulinfo.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: software suspend patch [2/6]
Date: Sun, 28 Nov 2004 18:03:24 +0100	[thread overview]
Message-ID: <20041128170324.GB1214@elf.ucw.cz> (raw)
In-Reply-To: <20041128162412.GB28881@hugang.soulinfo.com>

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!

  reply	other threads:[~2004-11-28 17:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-27 22:07 Suspend 2 merge linux
2004-11-27 22:25 ` Pavel Machek
2004-11-28  8:29 ` Wichert Akkerman
2004-11-28 11:37   ` Pavel Machek
2004-11-28 16:23     ` software suspend patch [1/6] hugang
2004-11-28 16:24       ` software suspend patch [2/6] hugang
2004-11-28 17:03         ` Pavel Machek [this message]
2004-11-28 16:24       ` software suspend patch [3/6] hugang
2004-11-28 16:25       ` software suspend patch [4/6] hugang
2004-11-28 17:08         ` Pavel Machek
2004-11-28 16:25       ` software suspend patch [5/6] hugang
2004-11-28 16:25       ` software suspend patch [1/6] hugang
2004-11-28 17:11         ` Pavel Machek
2004-12-02 20:56           ` Guido Guenther
2004-11-28 16:58       ` Pavel Machek
2004-11-29 15:43         ` hugang
2005-01-09 22:43           ` Pavel Machek
2005-01-11  2:01             ` hugang
2005-01-11  3:15               ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041128170324.GB1214@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=hugang@soulinfo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).