From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755896AbYHKPXA (ORCPT ); Mon, 11 Aug 2008 11:23:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752472AbYHKPWr (ORCPT ); Mon, 11 Aug 2008 11:22:47 -0400 Received: from nlpi053.sbcis.sbc.com ([207.115.36.82]:4255 "EHLO nlpi053.prodigy.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751599AbYHKPWq (ORCPT ); Mon, 11 Aug 2008 11:22:46 -0400 Message-Id: <20080811150653.900477449@quilx.com> References: <20080811150616.207532384@quilx.com> User-Agent: quilt/0.46-1 Date: Mon, 11 Aug 2008 08:06:18 -0700 From: Christoph Lameter To: Pekka Enberg CC: akpm@linux-foundation.org, Christoph Lameter , Christoph Lameter Cc: linux-kernel@vger.kernel.org CC: linux-fsdevel@vger.kernel.org Cc: Mel Gorman Cc: andi@firstfloor.org Cc: Rik van Riel Cc: mpm@selenic.com Cc: Dave Chinner Subject: [patch 02/19] slub: Replace ctor field with ops field in /sys/slab/* Content-Disposition: inline; filename=0002-SLUB-Replace-ctor-field-with-ops-field-in-sys-slab.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Create an ops field in /sys/slab/*/ops to contain all the operations defined on a slab. This will be used to display the additional operations that will be defined soon. Reviewed-by: Rik van Riel Signed-off-by: Christoph Lameter Signed-off-by: Pekka Enberg Signed-off-by: Christoph Lameter --- mm/slub.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) Index: linux-next/mm/slub.c =================================================================== --- linux-next.orig/mm/slub.c 2008-08-11 07:47:01.030203735 -0700 +++ linux-next/mm/slub.c 2008-08-11 07:50:11.402353636 -0700 @@ -3828,16 +3828,18 @@ static ssize_t order_show(struct kmem_ca } SLAB_ATTR(order); -static ssize_t ctor_show(struct kmem_cache *s, char *buf) +static ssize_t ops_show(struct kmem_cache *s, char *buf) { - if (s->ctor) { - int n = sprint_symbol(buf, (unsigned long)s->ctor); + int x = 0; - return n + sprintf(buf + n, "\n"); + if (s->ctor) { + x += sprintf(buf + x, "ctor : "); + x += sprint_symbol(buf + x, (unsigned long)s->ctor); + x += sprintf(buf + x, "\n"); } - return 0; + return x; } -SLAB_ATTR_RO(ctor); +SLAB_ATTR_RO(ops); static ssize_t aliases_show(struct kmem_cache *s, char *buf) { @@ -4170,7 +4172,7 @@ static struct attribute *slab_attrs[] = &slabs_attr.attr, &partial_attr.attr, &cpu_slabs_attr.attr, - &ctor_attr.attr, + &ops_attr.attr, &aliases_attr.attr, &align_attr.attr, &sanity_checks_attr.attr, --