[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d760cf2d0908232340pd8bef7byc76c4d07f09e7d63@mail.gmail.com>
Date: Mon, 24 Aug 2009 12:10:20 +0530
From: Nitin Gupta <ngupta@...are.org>
To: akpm@...ux-foundation.org, hugh.dickins@...cali.co.uk
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-mm-cc@...top.org
Subject: Re: [PATCH 3/4] compcache: send callback when swap slot is freed
On Mon, Aug 24, 2009 at 10:07 AM, Nitin Gupta<ngupta@...are.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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists