From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yasuaki Ishimatsu Subject: [RFC PATCH v3 12/13] memory-hotplug : add node_device_release Date: Mon, 9 Jul 2012 19:34:46 +0900 Message-ID: <4FFAB3C6.7020803@jp.fujitsu.com> References: <4FFAB0A2.8070304@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit Return-path: Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:37097 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752854Ab2GIKfG (ORCPT ); Mon, 9 Jul 2012 06:35:06 -0400 In-Reply-To: <4FFAB0A2.8070304@jp.fujitsu.com> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-acpi@vger.kernel.org Cc: rientjes@google.com, liuj97@gmail.com, len.brown@intel.com, benh@kernel.crashing.org, paulus@samba.org, cl@linux.com, minchan.kim@gmail.com, akpm@linux-foundation.org, kosaki.motohiro@jp.fujitsu.com, wency@cn.fujitsu.com When calling unregister_node(), the function shows following message at device_release(). Device 'node2' does not have a release() function, it is broken and must be fixed. So the patch implements node_device_release() CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- drivers/base/node.c | 7 +++++++ 1 file changed, 7 insertions(+) Index: linux-3.5-rc4/drivers/base/node.c =================================================================== --- linux-3.5-rc4.orig/drivers/base/node.c 2012-07-03 14:21:44.882432167 +0900 +++ linux-3.5-rc4/drivers/base/node.c 2012-07-03 14:22:23.296951921 +0900 @@ -252,6 +252,12 @@ static inline void hugetlb_register_node static inline void hugetlb_unregister_node(struct node *node) {} #endif +static void node_device_release(struct device *dev) +{ + struct node *node_dev = to_node(dev); + + memset(node_dev, 0, sizeof(struct node)); +} /* * register_node - Setup a sysfs device for a node. @@ -265,6 +271,7 @@ int register_node(struct node *node, int node->dev.id = num; node->dev.bus = &node_subsys; + node->dev.release = node_device_release; error = device_register(&node->dev); if (!error){ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753140Ab2GIKfJ (ORCPT ); Mon, 9 Jul 2012 06:35:09 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:37097 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752854Ab2GIKfG (ORCPT ); Mon, 9 Jul 2012 06:35:06 -0400 X-SecurityPolicyCheck: OK by SHieldMailChecker v1.7.4 Message-ID: <4FFAB3C6.7020803@jp.fujitsu.com> Date: Mon, 9 Jul 2012 19:34:46 +0900 From: Yasuaki Ishimatsu User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: , , , CC: , , , , , , , , , Subject: [RFC PATCH v3 12/13] memory-hotplug : add node_device_release References: <4FFAB0A2.8070304@jp.fujitsu.com> In-Reply-To: <4FFAB0A2.8070304@jp.fujitsu.com> Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When calling unregister_node(), the function shows following message at device_release(). Device 'node2' does not have a release() function, it is broken and must be fixed. So the patch implements node_device_release() CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- drivers/base/node.c | 7 +++++++ 1 file changed, 7 insertions(+) Index: linux-3.5-rc4/drivers/base/node.c =================================================================== --- linux-3.5-rc4.orig/drivers/base/node.c 2012-07-03 14:21:44.882432167 +0900 +++ linux-3.5-rc4/drivers/base/node.c 2012-07-03 14:22:23.296951921 +0900 @@ -252,6 +252,12 @@ static inline void hugetlb_register_node static inline void hugetlb_unregister_node(struct node *node) {} #endif +static void node_device_release(struct device *dev) +{ + struct node *node_dev = to_node(dev); + + memset(node_dev, 0, sizeof(struct node)); +} /* * register_node - Setup a sysfs device for a node. @@ -265,6 +271,7 @@ int register_node(struct node *node, int node->dev.id = num; node->dev.bus = &node_subsys; + node->dev.release = node_device_release; error = device_register(&node->dev); if (!error){ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx187.postini.com [74.125.245.187]) by kanga.kvack.org (Postfix) with SMTP id 5D0846B0089 for ; Mon, 9 Jul 2012 06:35:07 -0400 (EDT) Received: from m2.gw.fujitsu.co.jp (unknown [10.0.50.72]) by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id 0073D3EE0B5 for ; Mon, 9 Jul 2012 19:35:06 +0900 (JST) Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id DAA9B45DE4E for ; Mon, 9 Jul 2012 19:35:05 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id C267445DE4D for ; Mon, 9 Jul 2012 19:35:05 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id B66F81DB802C for ; Mon, 9 Jul 2012 19:35:05 +0900 (JST) Received: from g01jpexchyt01.g01.fujitsu.local (g01jpexchyt01.g01.fujitsu.local [10.128.194.40]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 6B47C1DB803C for ; Mon, 9 Jul 2012 19:35:05 +0900 (JST) Message-ID: <4FFAB3C6.7020803@jp.fujitsu.com> Date: Mon, 9 Jul 2012 19:34:46 +0900 From: Yasuaki Ishimatsu MIME-Version: 1.0 Subject: [RFC PATCH v3 12/13] memory-hotplug : add node_device_release References: <4FFAB0A2.8070304@jp.fujitsu.com> In-Reply-To: <4FFAB0A2.8070304@jp.fujitsu.com> Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-acpi@vger.kernel.org Cc: rientjes@google.com, liuj97@gmail.com, len.brown@intel.com, benh@kernel.crashing.org, paulus@samba.org, cl@linux.com, minchan.kim@gmail.com, akpm@linux-foundation.org, kosaki.motohiro@jp.fujitsu.com, wency@cn.fujitsu.com When calling unregister_node(), the function shows following message at device_release(). Device 'node2' does not have a release() function, it is broken and must be fixed. So the patch implements node_device_release() CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- drivers/base/node.c | 7 +++++++ 1 file changed, 7 insertions(+) Index: linux-3.5-rc4/drivers/base/node.c =================================================================== --- linux-3.5-rc4.orig/drivers/base/node.c 2012-07-03 14:21:44.882432167 +0900 +++ linux-3.5-rc4/drivers/base/node.c 2012-07-03 14:22:23.296951921 +0900 @@ -252,6 +252,12 @@ static inline void hugetlb_register_node static inline void hugetlb_unregister_node(struct node *node) {} #endif +static void node_device_release(struct device *dev) +{ + struct node *node_dev = to_node(dev); + + memset(node_dev, 0, sizeof(struct node)); +} /* * register_node - Setup a sysfs device for a node. @@ -265,6 +271,7 @@ int register_node(struct node *node, int node->dev.id = num; node->dev.bus = &node_subsys; + node->dev.release = node_device_release; error = device_register(&node->dev); if (!error){ -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fgwmail6.fujitsu.co.jp (fgwmail6.fujitsu.co.jp [192.51.44.36]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 09FBE2C0040 for ; Mon, 9 Jul 2012 20:35:07 +1000 (EST) Received: from m3.gw.fujitsu.co.jp (unknown [10.0.50.73]) by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id 2DF883EE0BC for ; Mon, 9 Jul 2012 19:35:06 +0900 (JST) Received: from smail (m3 [127.0.0.1]) by outgoing.m3.gw.fujitsu.co.jp (Postfix) with ESMTP id F002C45DEB4 for ; Mon, 9 Jul 2012 19:35:05 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (s3.gw.fujitsu.co.jp [10.0.50.93]) by m3.gw.fujitsu.co.jp (Postfix) with ESMTP id D3D5345DEAD for ; Mon, 9 Jul 2012 19:35:05 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id C184F1DB8040 for ; Mon, 9 Jul 2012 19:35:05 +0900 (JST) Received: from g01jpexchyt01.g01.fujitsu.local (g01jpexchyt01.g01.fujitsu.local [10.128.194.40]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id 6BE7F1DB803F for ; Mon, 9 Jul 2012 19:35:05 +0900 (JST) Message-ID: <4FFAB3C6.7020803@jp.fujitsu.com> Date: Mon, 9 Jul 2012 19:34:46 +0900 From: Yasuaki Ishimatsu MIME-Version: 1.0 To: , , , Subject: [RFC PATCH v3 12/13] memory-hotplug : add node_device_release References: <4FFAB0A2.8070304@jp.fujitsu.com> In-Reply-To: <4FFAB0A2.8070304@jp.fujitsu.com> Content-Type: text/plain; charset="ISO-2022-JP" Cc: len.brown@intel.com, wency@cn.fujitsu.com, paulus@samba.org, minchan.kim@gmail.com, kosaki.motohiro@jp.fujitsu.com, rientjes@google.com, cl@linux.com, akpm@linux-foundation.org, liuj97@gmail.com List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , When calling unregister_node(), the function shows following message at device_release(). Device 'node2' does not have a release() function, it is broken and must be fixed. So the patch implements node_device_release() CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- drivers/base/node.c | 7 +++++++ 1 file changed, 7 insertions(+) Index: linux-3.5-rc4/drivers/base/node.c =================================================================== --- linux-3.5-rc4.orig/drivers/base/node.c 2012-07-03 14:21:44.882432167 +0900 +++ linux-3.5-rc4/drivers/base/node.c 2012-07-03 14:22:23.296951921 +0900 @@ -252,6 +252,12 @@ static inline void hugetlb_register_node static inline void hugetlb_unregister_node(struct node *node) {} #endif +static void node_device_release(struct device *dev) +{ + struct node *node_dev = to_node(dev); + + memset(node_dev, 0, sizeof(struct node)); +} /* * register_node - Setup a sysfs device for a node. @@ -265,6 +271,7 @@ int register_node(struct node *node, int node->dev.id = num; node->dev.bus = &node_subsys; + node->dev.release = node_device_release; error = device_register(&node->dev); if (!error){