From patchwork Thu Mar 6 04:19:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 3781081 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7D3839F375 for ; Thu, 6 Mar 2014 04:20:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C9462021B for ; Thu, 6 Mar 2014 04:20:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D8F520225 for ; Thu, 6 Mar 2014 04:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752935AbaCFET4 (ORCPT ); Wed, 5 Mar 2014 23:19:56 -0500 Received: from cn.fujitsu.com ([59.151.112.132]:21043 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751457AbaCFETz convert rfc822-to-8bit (ORCPT ); Wed, 5 Mar 2014 23:19:55 -0500 X-IronPort-AV: E=Sophos;i="4.97,597,1389715200"; d="scan'208";a="27638916" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 06 Mar 2014 12:17:34 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s264Jphd013119 for ; Thu, 6 Mar 2014 12:19:52 +0800 Received: from G08CNEXMBPEKD02.g08.fujitsu.local ([10.167.33.84]) by G08CNEXCHPEKD03.g08.fujitsu.local ([10.167.33.85]) with mapi id 14.03.0146.002; Thu, 6 Mar 2014 12:19:51 +0800 From: "quwenruo@cn.fujitsu.com" To: "linux-btrfs@vger.kernel.org" Subject: [PATCH 1/2] btrfs: Cleanup the btrfs_workqueue related function type Thread-Topic: [PATCH 1/2] btrfs: Cleanup the btrfs_workqueue related function type Thread-Index: AQHPOPNRsakIvhbtTUCxSA1oRbogqQ== Date: Thu, 6 Mar 2014 04:19:50 +0000 Message-ID: <1394079657-24937-1-git-send-email-quwenruo@cn.fujitsu.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.167.226.24] MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 The new btrfs_workqueue still use open-coded function defition, this patch will change them into btrfs_func_t type which is much the same as kernel workqueue. Signed-off-by: Qu Wenruo --- fs/btrfs/async-thread.c | 6 +++--- fs/btrfs/async-thread.h | 20 +++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index a709585..d8c07e5 100644 --- a/fs/btrfs/async-thread.c +++ b/fs/btrfs/async-thread.c @@ -255,9 +255,9 @@ static void normal_work_helper(struct work_struct *arg) } void btrfs_init_work(struct btrfs_work *work, - void (*func)(struct btrfs_work *), - void (*ordered_func)(struct btrfs_work *), - void (*ordered_free)(struct btrfs_work *)) + btrfs_func_t func, + btrfs_func_t ordered_func, + btrfs_func_t ordered_free) { work->func = func; work->ordered_func = ordered_func; diff --git a/fs/btrfs/async-thread.h b/fs/btrfs/async-thread.h index 08d7174..0a891cd 100644 --- a/fs/btrfs/async-thread.h +++ b/fs/btrfs/async-thread.h @@ -23,11 +23,13 @@ struct btrfs_workqueue; /* Internal use only */ struct __btrfs_workqueue; +struct btrfs_work; +typedef void (*btrfs_func_t)(struct btrfs_work *arg); struct btrfs_work { - void (*func)(struct btrfs_work *arg); - void (*ordered_func)(struct btrfs_work *arg); - void (*ordered_free)(struct btrfs_work *arg); + btrfs_func_t func; + btrfs_func_t ordered_func; + btrfs_func_t ordered_free; /* Don't touch things below */ struct work_struct normal_work; @@ -37,13 +39,13 @@ struct btrfs_work { }; struct btrfs_workqueue *btrfs_alloc_workqueue(char *name, - int flags, - int max_active, - int thresh); + int flags, + int max_active, + int thresh); void btrfs_init_work(struct btrfs_work *work, - void (*func)(struct btrfs_work *), - void (*ordered_func)(struct btrfs_work *), - void (*ordered_free)(struct btrfs_work *)); + btrfs_func_t func, + btrfs_func_t ordered_func, + btrfs_func_t ordered_free); void btrfs_queue_work(struct btrfs_workqueue *wq, struct btrfs_work *work); void btrfs_destroy_workqueue(struct btrfs_workqueue *wq);