From patchwork Tue May 23 16:33:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 9743027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 494CD60388 for ; Tue, 23 May 2017 16:34:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C138286A8 for ; Tue, 23 May 2017 16:34:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3105428450; Tue, 23 May 2017 16:34:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C903E286A8 for ; Tue, 23 May 2017 16:34:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937081AbdEWQeO (ORCPT ); Tue, 23 May 2017 12:34:14 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:35424 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935721AbdEWQeM (ORCPT ); Tue, 23 May 2017 12:34:12 -0400 Received: by mail-qk0-f196.google.com with SMTP id k74so23495326qke.2 for ; Tue, 23 May 2017 09:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=BDMN81ybWC83zEoJ9LuvBZzyGUzN3UKKEMU2GpItL2Y=; b=i9ytYMKCxketgUQRPUCqRtQ0yAPNTjEqRMokJzTx/RrpxdRmG2j1w/R1yHTGvIr6ZP qYVrxXgVaNFk1TL/y+0QwdH/pGy1xJFNcG/8v27yM7HcgVvhwGQ7PhUl7gn2rLs67emF pftSc39eRs67vaCSR/huG3tuafAg0Ys9u71l9s79uEIR8QhJzPbvtLh27dZp8t3RS85a 7ViwUeKwXdZ1z5IENSKP/DhM3wtXmd7u+v9314WpNVCHMCwTfNQfpiTJTfkZ6b1nFOkS 24YwVcokAaeSArBVks2t2gvK/uh6gtMNoGerZK9Qi3OfCBJ9DVuhtp4MaRMHAwBXtiAu uyPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=BDMN81ybWC83zEoJ9LuvBZzyGUzN3UKKEMU2GpItL2Y=; b=Deg5GN+QbGP+Wl7erpv7BxWs8JnajInTiYLnorrJVVYi+nO2rRCfCpyPD0578sHhBw Mn+rcnnllBP4z5h4k5wyv9ilEe+6Jo1PwNUf6c0w5JL+8OX3SyBiZKXjUVgdGQvxZXOF KXsrZhHKQXF3a5kyrUa1qTyChp66G3SP+aRZLZVQ1P2gQGXsEPNTSuQBAuHNeXuv5kRn qTOmeDOEiz+Qx1CMw8QIHcg2xTBic3DiftZorgEiNfSbtWFBXvTse7ElgY2JjSYjA7bP EAMYf9iZJKk36oftf3gjM+kkP34o+NnHeMd3dEMNZ+OMXmXd5rj3p/grjlfvCxBZSe7P haTw== X-Gm-Message-State: AODbwcBr3AcZdE+KKiQ37M0X/p9TtJ9erP+v4I0qZNkz/QvenSMjJFvN ggFJN0AwU3kpZijo55Q= X-Received: by 10.55.144.5 with SMTP id s5mr24971083qkd.39.1495557251394; Tue, 23 May 2017 09:34:11 -0700 (PDT) Received: from orange.brq.redhat.com. (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id o15sm784055qki.47.2017.05.23.09.34.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 May 2017 09:34:11 -0700 (PDT) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Subject: [PATCH 1/5] libceph: use kbasename() and kill ceph_file_part() Date: Tue, 23 May 2017 18:33:54 +0200 Message-Id: <1495557238-1077-2-git-send-email-idryomov@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1495557238-1077-1-git-send-email-idryomov@gmail.com> References: <1495557238-1077-1-git-send-email-idryomov@gmail.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Ilya Dryomov Reviewed-by: Alex Elder --- include/linux/ceph/ceph_debug.h | 6 +++--- net/ceph/ceph_common.c | 13 ------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/include/linux/ceph/ceph_debug.h b/include/linux/ceph/ceph_debug.h index aa2e19182d99..51c5bd64bd00 100644 --- a/include/linux/ceph/ceph_debug.h +++ b/include/linux/ceph/ceph_debug.h @@ -3,6 +3,8 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include + #ifdef CONFIG_CEPH_LIB_PRETTYDEBUG /* @@ -12,12 +14,10 @@ */ # if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG) -extern const char *ceph_file_part(const char *s, int len); # define dout(fmt, ...) \ pr_debug("%.*s %12.12s:%-4d : " fmt, \ 8 - (int)sizeof(KBUILD_MODNAME), " ", \ - ceph_file_part(__FILE__, sizeof(__FILE__)), \ - __LINE__, ##__VA_ARGS__) + kbasename(__FILE__), __LINE__, ##__VA_ARGS__) # else /* faux printk call just to see any compiler warnings. */ # define dout(fmt, ...) do { \ diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c index 4fd02831beed..47e94b560ba0 100644 --- a/net/ceph/ceph_common.c +++ b/net/ceph/ceph_common.c @@ -56,19 +56,6 @@ static const struct kernel_param_ops param_ops_supported_features = { module_param_cb(supported_features, ¶m_ops_supported_features, NULL, S_IRUGO); -/* - * find filename portion of a path (/foo/bar/baz -> baz) - */ -const char *ceph_file_part(const char *s, int len) -{ - const char *e = s + len; - - while (e != s && *(e-1) != '/') - e--; - return e; -} -EXPORT_SYMBOL(ceph_file_part); - const char *ceph_msg_type_name(int type) { switch (type) {