From patchwork Tue Jan 16 18:39:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10167911 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 90D97601E7 for ; Tue, 16 Jan 2018 18:39:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85E1A26CFC for ; Tue, 16 Jan 2018 18:39:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78D7126E3D; Tue, 16 Jan 2018 18:39:50 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 1EF1A26CFC for ; Tue, 16 Jan 2018 18:39:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751636AbeAPSjr (ORCPT ); Tue, 16 Jan 2018 13:39:47 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:44621 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751606AbeAPSjq (ORCPT ); Tue, 16 Jan 2018 13:39:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1516127988; x=1547663988; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=+ueo8/W3MJwTt7neYikNe5DQq4EeB3wlA1Erizmu+o8=; b=EQkfNV9FuzKTcnriZFhXcZKMvRpWDUaICan528bWjr5j8QiQiIlGIvhU 8GkcBDa8o0hre1smFKxTr0ds7NXX6UQv4EHtRBFSYWZXERjF7n6UNf4tx Z2x62oZJpu3l6cbnuw5OREq8MC8HlA/omt3+/Ww3E+N8C9eUJbK5gd/tk DHDXKWTaSYc7yf1mBQBxigG5PCNMrT6lIxntkleFadZ9szlj1ECX7lLyj mRvnEZ6ZQ6/pPwzxHb3CrU/pQBfTPRwBx0OUgbIu+ALpTSLVJNw00OVzA wG0xUpyEImSVGy4vZmcgw/znDKom29j6xqfVf+gY4XvuwEBjHc0BWOOmo w==; X-IronPort-AV: E=Sophos;i="5.46,369,1511798400"; d="scan'208";a="69654785" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 17 Jan 2018 02:39:47 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 16 Jan 2018 10:35:29 -0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.171.236]) by uls-op-cesaip02.wdc.com with ESMTP; 16 Jan 2018 10:39:46 -0800 From: Bart Van Assche To: Jason Gunthorpe Cc: Doug Ledford , Greg Kroah-Hartman , linux-rdma@vger.kernel.org, Bart Van Assche Subject: [PATCH v4 1/5] kobject: Export kobj_ns_grab_current() and kobj_ns_drop() Date: Tue, 16 Jan 2018 10:39:41 -0800 Message-Id: <20180116183945.30629-2-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180116183945.30629-1-bart.vanassche@wdc.com> References: <20180116183945.30629-1-bart.vanassche@wdc.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make it possible to call these two functions from a kernel module. Note: despite their name, these two functions can be used meaningfully independent of kobjects. A later patch will add calls to these functions from the SRP driver because this patch series modifies the SRP driver such that it can hold a reference to a namespace that can last longer than the lifetime of the process through which the namespace reference was obtained. Signed-off-by: Bart Van Assche Cc: Greg Kroah-Hartman Acked-by: Greg Kroah-Hartman --- lib/kobject.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/kobject.c b/lib/kobject.c index 763d70a18941..06b849eee0ca 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -1039,6 +1039,7 @@ void *kobj_ns_grab_current(enum kobj_ns_type type) return ns; } +EXPORT_SYMBOL_GPL(kobj_ns_grab_current); const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk) { @@ -1074,3 +1075,4 @@ void kobj_ns_drop(enum kobj_ns_type type, void *ns) kobj_ns_ops_tbl[type]->drop_ns(ns); spin_unlock(&kobj_ns_type_lock); } +EXPORT_SYMBOL_GPL(kobj_ns_drop);