From patchwork Tue May 23 23:48:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9744441 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 78BBC6037F for ; Tue, 23 May 2017 23:49:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BB0C28818 for ; Tue, 23 May 2017 23:49:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 609322885B; Tue, 23 May 2017 23:49:31 +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 ABA0728818 for ; Tue, 23 May 2017 23:49:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968788AbdEWXt3 (ORCPT ); Tue, 23 May 2017 19:49:29 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:31817 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765538AbdEWXtJ (ORCPT ); Tue, 23 May 2017 19:49:09 -0400 X-IronPort-AV: E=Sophos;i="5.38,383,1491235200"; d="scan'208";a="21096373" Received: from mail-by2nam01lp0180.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) ([216.32.181.180]) by ob1.hgst.iphmx.com with ESMTP; 24 May 2017 07:49:06 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=mwZ5cHVXWck1x+b5XqST2z7Pk5EnAAcil6xMLYiMCGo=; b=I21MF2t4W5fEwH+jJjCfShU1SUjQz6wCBKgvKv/f3WSafTIS/Hp0AO4pPjzHANx//bCfjy0GnzLaPKgz6W1DF3ilSrGzrFtW8T3+X9NIrBTS67S0Q1sVeeeCS8JHBXoy9+afJ4l8IEbqu3jSIdtvevEqS1/4hZnk2k/CvCRCO80= Received: from BN3PR04CA0003.namprd04.prod.outlook.com (10.166.70.141) by DM5PR04MB0362.namprd04.prod.outlook.com (10.173.169.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Tue, 23 May 2017 23:49:04 +0000 Received: from CO1NAM04FT034.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::206) by BN3PR04CA0003.outlook.office365.com (2a01:111:e400:7a4f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Tue, 23 May 2017 23:49:04 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by CO1NAM04FT034.mail.protection.outlook.com (10.152.90.119) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1075.5 via Frontend Transport; Tue, 23 May 2017 23:49:02 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id EB.64.19026.D6AC4295; Tue, 23 May 2017 16:49:01 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Tue, 23 May 2017 16:48:58 -0700 X-AuditID: 0ac94371-41ba798000004a52-04-5924ca6d0da5 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 5A.F2.18148.A6AC4295; Tue, 23 May 2017 16:48:58 -0700 (PDT) From: Bart Van Assche To: Nicholas Bellinger CC: , Bart Van Assche , Joel Becker , "Christoph Hellwig" , Subject: [PATCH 09/33] configfs: Introduce config_item_get_unless_zero() Date: Tue, 23 May 2017 16:48:30 -0700 Message-ID: <20170523234854.21452-10-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170523234854.21452-1-bart.vanassche@sandisk.com> References: <20170523234854.21452-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBLMWRmVeSWpSXmKPExsXCddJ5kW7uKZVIg5PnrSxWrj7KZHHy3DcW iz17T7JYtK0+w2jRuvQtkwOrx9OLQR73tx9h8th9s4HN4/MmuQCWKC6blNSczLLUIn27BK6M 05POMRa84K6Y8fUAewNjG1cXIyeHhICJxN79n5i7GLk4hASWMkmc2PeFFcLZwSjxrncDexcj B1jVr93xEPGNjBJbZ/xjAulmEzCS+PZ+JguILSKgIzHr7gt2EJtZYDujxKszkSC9wgIeEt82 VYGEWQRUJWbsbWcFsXkFHCQ6vzYwQhwhL3F2y05mEJsTKL5yzzZmkFYhAXuJy9+VQdZKCExi lTi4cQI7RK+gxMmZT1ggVklIHHzxAqxXSEBd4uSS+UwTGIVmISmbhaRsASPTKkax3Myc4tz0 1AJDE73ixLyUzOJsveT83E2MkPAu3MH4+rb3IUYBDkYlHt4EB5VIIdbEsuLK3EOMEhzMSiK8 yzcAhXhTEiurUovy44tKc1KLDzFKc7AoifNmyU6NEBJITyxJzU5NLUgtgskycXBKNTAalL7h rH5Wm8JV5fzeb5VEY4ofo97xFyqGSzQvbvGatEV1ef2t25c9TF+VHk/WerCv41yQGeei7FVr Zx0qeXVr4uTTZueV9S7Hf/vNm7fX/e49uUL+V9XR4VvLZ0afFTVa0zb3uNEFj61hdtv27rv+ 89aBI0evOfKzbuKcEXXaUM41yCTw+8yrSizFGYmGWsxFxYkAs7TtFGsCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBJMWRmVeSWpSXmKPExsXCtZGTTTfrlEqkQf90GYuDP9sYLVauPspk cfLcNxaLPXtPsli0rT7DaNG69C2TA5vH04tBHve3H2Hy2H2zgc1j2przTB6fN8kFsEZx2aSk 5mSWpRbp2yVwZZyedI6x4AV3xYyvB9gbGNu4uhg5OCQETCR+7Y7vYuTiEBJYzyjxe+I5xi5G Tg42ASOJb+9nsoDYIgI6ErPuvmAHKWIW2M4osfPVPnaQZmEBD4lvm6pAalgEVCVm7G1nBbF5 BRwkprzZxQZiSwjIS5zdspMZxOYEiq/cs40ZpFVIwF7i8nflCYzcCxgZVjGK5WbmFOemZxYY GukVJ+alZBZn6yXn525ihIRF1A7G6xPNDzEycXBKNTByp/BWb1/asWxT9MX7Zz8/aZi0R/Ht It/7/7My7VqD73idmHcwrDrjoL3H1omSj1f+uDX3GK/rjtPVHGvPvHxtm2/IwcRUburTXrhz w/drC97K2R/d0ynV9S7gj0IaVwr3U5MpTHmz479MbE6btFR9neBZ62tvDU8Wb0yvPmGasePg BCYmttWGSizFGYmGWsxFxYkA3l2P/bsBAAA= MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39840400002)(39850400002)(39400400002)(39410400002)(39860400002)(2980300002)(438002)(199003)(189002)(9170700003)(50466002)(81166006)(47776003)(86362001)(106466001)(54906002)(6666003)(6916009)(2950100002)(50226002)(8936002)(189998001)(478600001)(356003)(48376002)(50986999)(76176999)(72206003)(305945005)(8676002)(5660300001)(1076002)(4326008)(77096006)(36756003)(2906002)(53936002)(5003940100001)(110136004)(38730400002)(33646002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR04MB0362; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT034; 1:J7UKABBGtWmRstYDZ253pi7e9ijLSwpE/PlyUTZCAjyBF+eGnqy4HE/mt5lUklk3wMsVOQmebjLwvEuJX70B7mEXqgzj+4q9qAXQ6L6CWGpNZgHxSEOSKIsUjSvY9KhlKwC/nK569lpbWPj4tDQeRqBeA+3TNIjKsaWcIz7ao+4RMR8qxP8iREEPRbb4YWN86qKnnt8YPYooGCD5B5mMv4lHaYUkln1P/T3UvrEGoxUr+mLzY2f3bLspcaLxCpef+oGAp5iw8WNRIgiH3qP0VxZEj+Vyr6Cfwk1zVg2K7UvPXGThZq9r/9U069pk+ooS5dzAzFC0oZM+r/kJxGIdd36mU+/1W+7SUuCaJ+8Fm+ru9JHAoJfaWed4RR71cGZiIHUcVWs1kLQ7r6wxKOWcwgf28YdIDv8HMpViNCmi5wQuAS0BcfMfFzPVUf/mGVwFWh2MQxsNBnJvwSLmAe2YvsWgEOYCSb4dqVmLfYdQXGH8PXvibMnae0V9DyhOnQA+0LZ4Hd2HaLQaX1GJqAT4Usv54HO3idXQPv/F1kEJgqk= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR04MB0362: X-MS-Office365-Filtering-Correlation-Id: 5a2280c2-51b4-45ea-d92f-08d4a2364ad3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:DM5PR04MB0362; X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0362; 3:xkNPdEnLUa5Q8ZPffPO2P1IFn+2RNvq1ZoKFsHwG6bac2vhH6euhYsI3i9eJBuA0pnj2BJuqJ+RjGFB7fj0yllq2dzOlnB9LPgHyjhqXdKN9UPjs33nz8VEMfKdrCOxCyhCmIBks5+jvGC0VgsqPv8LTLIU1lFuAmT92TbvOsHH4mjQ3azL67ngR6lmPawxBIsZXZbNEBuWzaG46XDF6SPyaov7Ut4PqCLx6SAbzlQnXJj1jxqyIG4QbQ8izRwVzm8eteSod95vBzdOaguOynhiBvhcqNs4/EfapOL30XgUCUudFqHtpNwk2+WYJ0hy0wElHY2Py5mGJ61JMOim4XFk9b4QuSkVPIvMXU4PYeGn8QbLMbUim4GSYqAbCLd79HnoY/zgE4zp0ZLC2qDruQI3H5Ff9gEiN325StN5YHxSVcYeto+Aqms6hRJ/gPlXo0uOI80k6Mjg/RaCT6FWnzL/bbSMb08lI+iF4cS+Q3Mz9YYmG7/c/DSLYO13moycs X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0362; 25:cjKd2oVBNNfRxdE81PVWFR/oOLeF2PmUDLfShDKGWlGBIl2UfhAQjtL6NPHqB1smCB4ksqg8dCRpQjrpC/7X9RHzPPxRsIDWGhXJesh+OGdMTlI+gxnag8/0gqhIULexRUsnUilz8Uq3LGV6zcaE56qJISpkjhkpuUR+NEIpVA49FGJirkbtNMSKNO73eYGHstkEav2QZJ/LTcLXgHyCEZU87lPJsiYSNY370DRr3066sGR+HkU45G7BgQLfMImqcNydP9igQoBf3km3Zr2f40qUoSchVy/SArYZF2sTmbkgHOVK3xQI1l9Ciw8YJUAmOT+KpBfpEKOhah4S/usCaixczj20EdjMHff4DSk1rhWtZKjZ8mq7ceqNhf7N7e6dTdoBc0BXmX/uienxlxd44x9l4cXrELuhm8oKP1IubimkAIvWRjCFI1GFPLymusRr3039qOR9Z/ym1V+nppmT8pQxrHBrtHupyD2Am+PHAGs=; 31:j7uEBRKsZB+2f5s7fIgUtbh9I1r4zfWjYUV1vr/1jHkp3L1SMF/m7Jb8JcC1gxJQjzELD8jursIzHvyQzQ4JFMd2fbrqYK8nD84lbFMzLplJcKR9YR4RZanzuttS6d6wIyOtNk8dJ8IcPRei1NeL8Ks8074RGi5M9y4WS3GhVM/KCyO4GHBWvAX6LIppjPfOwDHa9DzrJeFr3Hgq7sncqhAaNTEPB5bR72prXSXziWouN23n5tWoNkKrPemcNKF4KOo2FiB0DUGi62+4F5jaxw== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0362; 20:n1CE2bA/cvkHIgYoVXyxD9tjqvBgLHE5FAxEWtoDp8OgqkbJv38y+5/uMc8b4Sm6zxskw+37qpVvEvq0lkIOIVTidLUZZoWGfNSUYFO5LqBSHMgWUCNsgbTkv7tH7cnVNHnAq2E1BNIryXzIl2skCbOOgNevhfEmydE6PXmYg9E4R1y+PzcvfD5SMCaBNB2pN+PFAQfG9r8apsoWGGN+Cuzvj3XZmfJjSTcModWo/C8bp4caHyyRTxOlPSPp9aqWToYgSNNKCx2OpFL0VElOmYR3jV3enZSlzEDMxjUvr+kELPbX0p361kODxZrapM2InwbKV+eYSdjvWBNikB0VFyKCZBRxwAer69XcpojSDB+/Zn4VN57o0pDVdxiWLJqhBaLldd4cljUboFN4n31p9x58S32ACEeRGP8Gt7z5QPEEDbKmaD30GN+uP8hxnWSHcv2KC2o9d/AVXGvH360MBg1i7xZCfCyurNkDDlZtky2U1TtgAwYIEzmE3U3D8/+T X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(13018025)(5005006)(13016025)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123564025)(20161123558100)(20161123562025)(6072148); SRVR:DM5PR04MB0362; BCL:0; PCL:0; RULEID:; SRVR:DM5PR04MB0362; X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0362; 4:U0ZN9j2lQvY98QLvWQZveXWmZQmfWaR4gxtQYgo+5AWnkHUa3VmnkXHiSLWbq+TlVvKjtzjmhlCuXo9Ud7yEWVSHUTJXitMSXQa2gJPuMRl7llazufiUHrQ2n2bA7EGES4gh0v8Tc01QFI7ezj66u73rOZT+aAN+b+Zmp/a1rFqymPN2MIhzD1zg9GLKfspRiPYvKNxCq8Z26kp+Szj5g5DS430FpxOkSlhYuZjLsdGZCIV38ZDt7Af1GgB98lsK87IizIzsZzYlGdrnmJjTI9W2Z5HTseXJVAhcVL4rnubU5u+iY7C0+0TWv5OBMofQew3DMOwRfdCm5mmpnb56OnGJiID5i583XDdZlfec+RkG5ThqfvL4rr3ynkjNqtx88ZtnDo3uxSfZdLsk5e1jjMU0QtkmanGETTS4OKzzsZ79MekzkeWOIOpxuktNTfDWH08uhWB1DgU2wFh/UNs4Bwrzt9fe4f18Z9NUeYQHV/CfAfphGqOn4l9pl5mxI5QJQQMBYlJo5kLqNEPC5EdAmAdcnPH3FGYY8DI2T3cKFkhgZ08cfpLmn6Ld+4ORKMY27761Dv1pY7glwP+5HY1N5OwYW8RXWyM3ajWywxil4otCk3Cfkrf+sNukSSJLsTQTHi6E1NyVMYTEkJsTWjBh11YbmCoHZWQXhziYRoKHR+bUjKjI6rH5LO/os9Y7ALDR/jINv7fW9C2Ooh523cwYh9EHnXvdD6jxftZnbcf5TvYHfdDhQTbpMBNdBlLW6j4g4nSrLAdq8vxL/7oa9gHPMN7M2AreSHoMhGFtMrGypwNLLFmZ3zACGe38ofv/D+XQTL5l7yD82LQfhwva+Aov8RULPRpFrM3cvVxmTwwmPwxpQrTXPCUyB+LIZJkWVU7iPe5frJGGM3EB90VndlkjY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v7pJzeezkbar5jflEVsIbiglSAZ9wuQL3pTs0lrAoCxN0/XnWJrYZ4fP5DnFZgkq2g==; 24:9mAVrcBI9yRDSz0X3LbzwyAvnNtFUkgFWE+/vKpwmFM05vV8Vh35iC7us6QaXXxmaK9APefSOhNb5Oi19a3bTs0giejpKfP2GQq1m1PVBwk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0362; 7:+Rc5JKhGMt9JNNi2Av9f4zDUpwMxjbUtydnrIHEEpQ/jCCUz3wTpjAcy70Likkzi7s2NUv5nP4uJf60jfTuKTiLZOY6vQXJ0mFDTlwCjHjxgCJ9YL6eXplme6dKqKvmlyQgJx77Rqa6D9FSUpeyzGmgucjM9IxkXlAmR55v2NeCD97YekyWxTIrdAJBa5erz4C8pT2//Y/3rYEUnkNHYMbIt1zoa4U8ACQpfl5fqwzhwwYr6p5Q09Q2VJDkyyu7JTU8FdhS63yiC8BlaUDpneOrq7CzmSOI8NNdwt5Q9XhIoyuJDtb4kUm3aWyZlyg+yVuHmtltAEYbwJEs8vpdzGA==; 20:z5wKAm5jwWK9eLtCJdf1j3hx40CU0aUEenoY+BJ8MJsCoKzVJlTxG7iicA6kav8s8yIrCQq+ATVEdbeE0VRiVg/ELvrtDnTN8Ok06NnwSCJvMbcf6xLKLbMxkm8WoXieVNCXHpCXYXGWXQQlvasQRSGmoZFCekTvXztlKcB63Qc= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2017 23:49:02.9976 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR04MB0362 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This new function is needed to fix a deadlock in the SCSI target XCOPY implementation. Signed-off-by: Bart Van Assche Cc: Joel Becker Cc: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org Reviewed-by: Christoph Hellwig Reviewed-by: Mike Christie --- fs/configfs/item.c | 6 ++++++ include/linux/configfs.h | 1 + 2 files changed, 7 insertions(+) diff --git a/fs/configfs/item.c b/fs/configfs/item.c index 8b2a994042dd..e3501b9bbb60 100644 --- a/fs/configfs/item.c +++ b/fs/configfs/item.c @@ -138,6 +138,12 @@ struct config_item *config_item_get(struct config_item *item) } EXPORT_SYMBOL(config_item_get); +struct config_item *config_item_get_unless_zero(struct config_item *item) +{ + return item && kref_get_unless_zero(&item->ci_kref) ? item : NULL; +} +EXPORT_SYMBOL(config_item_get_unless_zero); + static void config_item_cleanup(struct config_item *item) { struct config_item_type *t = item->ci_type; diff --git a/include/linux/configfs.h b/include/linux/configfs.h index 2319b8c108e8..406e16dabc28 100644 --- a/include/linux/configfs.h +++ b/include/linux/configfs.h @@ -75,6 +75,7 @@ extern void config_item_init_type_name(struct config_item *item, struct config_item_type *type); extern struct config_item * config_item_get(struct config_item *); +extern struct config_item * config_item_get_unless_zero(struct config_item *); extern void config_item_put(struct config_item *); struct config_item_type {