linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: shobhit dayal <shobhit@calsoftinc.com>
To: hch@infradead.org
Cc: christoph@lameter.com, manfred@colorfullife.com, akpm@osdl.org,
	linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org,
	linux-mm@kvack.org, Shai Fultheim <shai@scalex86.org>
Subject: Re: Fwd: [PATCH] Pageset Localization V2
Date: Wed, 30 Mar 2005 18:36:18 +0530	[thread overview]
Message-ID: <1112187977.9773.15.camel@kuber> (raw)
In-Reply-To: <bab4333005033003295f487e3d@mail.gmail.com>

The goal here is to replace the head of a existing list pointed to by
'list' with a new head pointed to by 'nlist'. 
First there is a memcpy that copies the contents of list to nlist then
this macro is called.
The macro makes sure that if the old head was empty then INIT_LIST_HEAD
the 'nlist', if not then make sure that the nodes before and after the
head now correclty point to nlist instead of list.

regards
shobhit


> ---------- Forwarded message ----------
> From: Christoph Hellwig <hch@infradead.org>
> Date: Wed, 30 Mar 2005 12:14:39 +0100
> Subject: Re: [PATCH] Pageset Localization V2
> To: Christoph Lameter <christoph@lameter.com>
> Cc: Manfred Spraul <manfred@colorfullife.com>, Andrew Morton
> <akpm@osdl.org>, linux-kernel@vger.kernel.org,
> linux-ia64@vger.kernel.org, linux-mm@kvack.org, shai@scalex86.org
> 
> 
> > +#define MAKE_LIST(list, nlist)  \
> > +     do {    \
> > +             if(list_empty(&list))      \
> > +                     INIT_LIST_HEAD(nlist);          \
> > +             else {  nlist->next->prev = nlist;      \
> > +                     nlist->prev->next = nlist;      \
> > +             }                                       \
> > +     }while(0)
> 
> This is horrible.  Where are the nlist pointers supposed to point to?
> What's so magic you need the INIT_LIST_HEAD only conditionally?
> 
> -
> 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/
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  parent reply	other threads:[~2005-03-30 12:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-30  5:51 Christoph Lameter
2005-03-30 11:14 ` Christoph Hellwig
     [not found]   ` <bab4333005033003295f487e3d@mail.gmail.com>
2005-03-30 13:06     ` shobhit dayal [this message]
2005-03-31 14:32       ` Fwd: " Christoph Hellwig
2005-03-31 14:47         ` Matthew Wilcox
2005-03-31 15:36           ` Christoph Lameter
2005-03-31 15:53           ` Christoph Lameter
2005-03-31 15:35         ` Christoph Lameter
2005-03-30 13:40 ` Matthew Wilcox
2005-03-31  3:50   ` Christoph Lameter

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=1112187977.9773.15.camel@kuber \
    --to=shobhit@calsoftinc.com \
    --cc=akpm@osdl.org \
    --cc=christoph@lameter.com \
    --cc=hch@infradead.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=manfred@colorfullife.com \
    --cc=shai@scalex86.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