Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753587Ab3H2Cer (ORCPT ); Wed, 28 Aug 2013 22:34:47 -0400 Received: from mail-ob0-f180.google.com ([209.85.214.180]:60836 "EHLO mail-ob0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751772Ab3H2Ceq (ORCPT ); Wed, 28 Aug 2013 22:34:46 -0400 MIME-Version: 1.0 In-Reply-To: References: <1376981696-4312-1-git-send-email-liwanp@linux.vnet.ibm.com> <1376981696-4312-2-git-send-email-liwanp@linux.vnet.ibm.com> <20130820160735.b12fe1b3dd64b4dc146d2fa0@linux-foundation.org> <52142ffe.84c0440a.57e5.02acSMTPIN_ADDED_BROKEN@mx.google.com> <52146c58.a3e2440a.0f5a.ffffed8dSMTPIN_ADDED_BROKEN@mx.google.com> <521600cc.22ab440a.2703.53f1SMTPIN_ADDED_BROKEN@mx.google.com> Date: Wed, 28 Aug 2013 19:34:45 -0700 X-Google-Sender-Auth: WBqD6SdG39VD4EKuMnilsH1CeJQ Message-ID: Subject: Re: [PATCH v2 2/4] mm/sparse: introduce alloc_usemap_and_memmap From: Yinghai Lu To: Wanpeng Li Cc: Dave Hansen , Rik van Riel , Fengguang Wu , Joonsoo Kim , Johannes Weiner , Tejun Heo , Yasuaki Ishimatsu , David Rientjes , KOSAKI Motohiro , Jiri Kosina , Linux MM , Linux Kernel Mailing List Content-Type: multipart/mixed; boundary=e89a8ff1ceb6008a8904e50cf311 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7690 Lines: 118 --e89a8ff1ceb6008a8904e50cf311 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Aug 28, 2013 at 7:18 PM, Yinghai Lu wrote: > please change to function pointer to > void (*alloc_func)(void *data, > unsigned long pnum_begin, > unsigned long pnum_end, > unsigned long map_count, int nodeid) > > pnum_begin, pnum_end, map_coun, nodeid, should not be in the struct. looks like that is what is your first version did. I updated it a little bit. please check it. Thanks Yinghai --e89a8ff1ceb6008a8904e50cf311 Content-Type: application/octet-stream; name="0001-sparse_v2.patch" Content-Disposition: attachment; filename="0001-sparse_v2.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hkxd0k530 RnJvbSBhNzhlMTJhOWZmMzFmMmE3M2I4NzE0NWNlN2FkOTQzYTBmNzEyNzA4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQ0KRnJvbTogV2FucGVuZyBMaSA8bGl3YW5wQGxpbnV4LnZuZXQuaWJtLmNv bT4NCkRhdGU6IFdlZCwgMjEgQXVnIDIwMTMgMTU6MjM6MDggKzA4MDANClN1YmplY3Q6IFtQQVRD SF0gbW0vc3BhcnNlOiBpbnRyb2R1Y2UgYWxsb2NfdXNlbWFwX2FuZF9tZW1tYXAgZml4IA0KDQpQ YXNzIGZ1bmN0aW9uIHBvaW50ZXIgdG8gYWxsb2NfdXNlbWFwX2FuZF9tZW1tYXAoKSBpbnN0ZWFk IG9mIHRydWUvZmFsc2UuIA0KDQpTaWduZWQtb2ZmLWJ5OiBXYW5wZW5nIExpIDxsaXdhbnBAbGlu dXgudm5ldC5pYm0uY29tPg0KLS0tDQogbW0vc3BhcnNlLmMgfCAgIDU0ICsrKysrKysrKysrKysr KysrKysrKysrKystLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KIDEgZmlsZXMgY2hhbmdl ZCwgMjUgaW5zZXJ0aW9ucygrKSwgMjkgZGVsZXRpb25zKC0pDQoNCmRpZmYgLS1naXQgYS9tbS9z cGFyc2UuYyBiL21tL3NwYXJzZS5jDQppbmRleCA1NWU1NzUyLi4wNmFkZjNjIDEwMDY0NA0KLS0t IGEvbW0vc3BhcnNlLmMNCisrKyBiL21tL3NwYXJzZS5jDQpAQCAtMzM5LDE0ICszMzksMTYgQEAg c3RhdGljIHZvaWQgX19pbml0IGNoZWNrX3VzZW1hcF9zZWN0aW9uX25yKGludCBuaWQsIHVuc2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NpZ25l ZCBsb25nICoqKW1hcF9tYXAsIGZhbHNlKTsNCisJYWxsb2NfdXNlbWFwX2FuZF9tZW1tYXAoc3Bh cnNlX2Vhcmx5X21lbV9tYXBzX2FsbG9jX25vZGUsDQorCQkJCQkJKHZvaWQgKiopbWFwX21hcCk7 DQogI2VuZGlmDQogDQogCWZvciAocG51bSA9IDA7IHBudW0gPCBOUl9NRU1fU0VDVElPTlM7IHBu dW0rKykgew0KLS0gDQoxLjcuNy42DQoNCg== --e89a8ff1ceb6008a8904e50cf311-- -- 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/