Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755910AbZIUMIG (ORCPT ); Mon, 21 Sep 2009 08:08:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754179AbZIUMIC (ORCPT ); Mon, 21 Sep 2009 08:08:02 -0400 Received: from mail-bw0-f210.google.com ([209.85.218.210]:40313 "EHLO mail-bw0-f210.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753158AbZIUMIB convert rfc822-to-8bit (ORCPT ); Mon, 21 Sep 2009 08:08:01 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=S9XYdN168Irsh4qceKMGCehbQgThh/plGoCKuGFOISCimIayFOo0eErPqhk9DXTZJc Uj/6m4T5vMCivptjfXiOuwEmF15KytTgy57MVcb1RxaFOldFsQ9NU5FwCN0UEWEA3AUw nnGiRcIeHbulLslquGOYEH04OXF3uAOCnhby8= MIME-Version: 1.0 In-Reply-To: References: <1253227412-24342-1-git-send-email-ngupta@vflare.org> <1253260528.4959.13.camel@penberg-laptop> <1253266391.4959.15.camel@penberg-laptop> <4AB3A16B.90009@vflare.org> <4AB487FD.5060207@cs.helsinki.fi> <1253531550.5216.32.camel@penberg-laptop> Date: Mon, 21 Sep 2009 15:08:04 +0300 X-Google-Sender-Auth: 9e93f5547e120867 Message-ID: <84144f020909210508i7e8b1b3bif61dcb5b576c878d@mail.gmail.com> Subject: Re: [PATCH 2/4] send callback when swap slot is freed From: Pekka Enberg To: Hugh Dickins Cc: ngupta@vflare.org, Greg KH , Andrew Morton , Ed Tomlinson , linux-kernel , linux-mm , linux-mm-cc , kamezawa.hiroyu@jp.fujitsu.com, nishimura@mxp.nes.nec.co.jp Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1144 Lines: 25 Hi Hugh, On Mon, Sep 21, 2009 at 2:55 PM, Hugh Dickins wrote: > Though exporting the swap_info_struct still bothers me, and it > seems convoluted that the block device should have a method, so > swapon can call the block device, so the block device can call > swapfile.c to install a callout, so that swapfile.c can call the > block device when freeing swap. ?I'm not saying there is a better > way, just that I'd be glad of a better way. I guess we can combine my ->swapon() hook in struct block_device_operations with Nitin's set_swap_free_notify() function to avoid exporting struct swap_info_struct. Alternatively, we could add the ->swap_free() hook too struct block_device_operations. In any case, I don't think we can do the setup at sys_open() if we keep Nitin's hook as struct swap_info_struct is not set up until sys_swapon(). Pekka -- 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/