From patchwork Sun Mar 13 07:18:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 8573021 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D5A5B9F294 for ; Sun, 13 Mar 2016 07:19:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E087A2034C for ; Sun, 13 Mar 2016 07:19:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0B17B2034B for ; Sun, 13 Mar 2016 07:19:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932271AbcCMHTF (ORCPT ); Sun, 13 Mar 2016 03:19:05 -0400 Received: from m12-11.163.com ([220.181.12.11]:55510 "EHLO m12-11.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932252AbcCMHS6 (ORCPT ); Sun, 13 Mar 2016 03:18:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=VdjV9d9TqWaS29zP7h 2zHrbT497r3ANZ8R8WSiBie1A=; b=Q0PWKZRz76oX0DoOu+GNFW1HXdTIw7nkW7 SMdQw68D6GPjmpZDKvLa+ZfIWugJE5EUkudM6DJCZ4238sw95fE7UD2+4OFEaGgM aZiMXyn7aVqugY5cVieKDCJGOepbgitNpSq2o5sz4VjVPjhSD3e9bEw0LFFM9F3t 4uFqSUlQg= Received: from localhost (unknown [113.87.123.10]) by smtp7 (Coremail) with SMTP id C8CowABXqWxYFOVWf_nAAQ--.56369S3; Sun, 13 Mar 2016 15:18:48 +0800 (CST) From: Geliang Tang To: Ilya Dryomov , "Yan, Zheng" , Sage Weil , "David S. Miller" Cc: Geliang Tang , ceph-devel@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] libceph: use KMEM_CACHE macro Date: Sun, 13 Mar 2016 15:18:39 +0800 Message-Id: X-Mailer: git-send-email 2.5.0 In-Reply-To: <9242267d62daeec8a0de5a1230f750ca486d62cd.1457853190.git.geliangtang@163.com> References: <9242267d62daeec8a0de5a1230f750ca486d62cd.1457853190.git.geliangtang@163.com> In-Reply-To: <9242267d62daeec8a0de5a1230f750ca486d62cd.1457853190.git.geliangtang@163.com> References: <9242267d62daeec8a0de5a1230f750ca486d62cd.1457853190.git.geliangtang@163.com> X-CM-TRANSID: C8CowABXqWxYFOVWf_nAAQ--.56369S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7Zw4UGFyrury8Xw4ktFWUurg_yoW8WFy5pF ZrCry7JFW8Zw47Wr4vqFyxur18Crn3XFW7XFyUG3W5CFn8ZayqqFn5tr9YgFy7AFWxuanr tF40gFWUZr12y3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UvdgZUUUUU= X-Originating-IP: [113.87.123.10] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/xtbBDRcrmVaDlwYKJwABsA Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use KMEM_CACHE() instead of kmem_cache_create() to simplify the code. Signed-off-by: Geliang Tang --- net/ceph/messenger.c | 10 ++-------- net/ceph/osd_client.c | 5 +---- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 9382619..32c997e 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -235,18 +235,12 @@ static struct workqueue_struct *ceph_msgr_wq; static int ceph_msgr_slab_init(void) { BUG_ON(ceph_msg_cache); - ceph_msg_cache = kmem_cache_create("ceph_msg", - sizeof (struct ceph_msg), - __alignof__(struct ceph_msg), 0, NULL); - + ceph_msg_cache = KMEM_CACHE(ceph_msg, 0); if (!ceph_msg_cache) return -ENOMEM; BUG_ON(ceph_msg_data_cache); - ceph_msg_data_cache = kmem_cache_create("ceph_msg_data", - sizeof (struct ceph_msg_data), - __alignof__(struct ceph_msg_data), - 0, NULL); + ceph_msg_data_cache = KMEM_CACHE(ceph_msg_data, 0); if (ceph_msg_data_cache) return 0; diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 5bc0537..7558855 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -2783,10 +2783,7 @@ EXPORT_SYMBOL(ceph_osdc_writepages); int ceph_osdc_setup(void) { BUG_ON(ceph_osd_request_cache); - ceph_osd_request_cache = kmem_cache_create("ceph_osd_request", - sizeof (struct ceph_osd_request), - __alignof__(struct ceph_osd_request), - 0, NULL); + ceph_osd_request_cache = KMEM_CACHE(ceph_osd_request, 0); return ceph_osd_request_cache ? 0 : -ENOMEM; }