linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nitin Gupta <ngupta@vflare.org>
To: akpm@linux-foundation.org, hugh.dickins@tiscali.co.uk
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-mm-cc@laptop.org
Subject: Re: [PATCH 3/4] compcache: send callback when swap slot is freed
Date: Mon, 24 Aug 2009 12:10:20 +0530	[thread overview]
Message-ID: <d760cf2d0908232340pd8bef7byc76c4d07f09e7d63@mail.gmail.com> (raw)
In-Reply-To: <200908241007.58273.ngupta@vflare.org>

On Mon, Aug 24, 2009 at 10:07 AM, Nitin Gupta<ngupta@vflare.org> wrote:

<snip>

> +/*
> + * Sets callback for event when swap_map[offset] == 0
> + * i.e. page at this swap offset is no longer used.
> + */
> +void set_swap_free_notify(struct block_device *bdev,
> +                       swap_free_notify_fn *notify_fn)
> +{
> +       unsigned int i;
> +       struct swap_info_struct *sis;
> +
> +       spin_lock(&swap_lock);
> +       for (i = 0; i <= nr_swapfiles; i++) {
> +               sis = &swap_info[i];
> +               if (!(sis->flags & SWP_USED))
> +                       continue;
> +               if (sis->bdev == bdev)
> +                       break;
> +       }
> +

> +       /* swap device not found */
> +       if (i > nr_swapfiles)
> +               return;

How could I miss this! We need to unlock before this return. I will
send revised diffs once I get additional reviews.


> +
> +       BUG_ON(!sis || sis->swap_free_notify_fn);
> +       sis->swap_free_notify_fn = notify_fn;
> +       spin_unlock(&swap_lock);
> +
> +       return;
> +}
> +EXPORT_SYMBOL_GPL(set_swap_free_notify);
> +


Nitin

--
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:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2009-08-25 20:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-24  4:37 Nitin Gupta
2009-08-24  6:40 ` Nitin Gupta [this message]

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=d760cf2d0908232340pd8bef7byc76c4d07f09e7d63@mail.gmail.com \
    --to=ngupta@vflare.org \
    --cc=akpm@linux-foundation.org \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm-cc@laptop.org \
    --cc=linux-mm@kvack.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