Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp452245pxt; Fri, 6 Aug 2021 06:06:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKiDTuOIK3pKpszKm2oMZeEowD1eMQwjia+1gXm5xKjDcUukQ77yLR3NcKNI+SUT2SJ29X X-Received: by 2002:a92:ddcf:: with SMTP id d15mr1188415ilr.184.1628255210709; Fri, 06 Aug 2021 06:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628255210; cv=none; d=google.com; s=arc-20160816; b=RprAAw2/ARuKjoqANaLNeuj2IXDNS0pVylVrB6UpT2rXQO4dqybaIKuNwl7PNM876c O1Oy7XYfW8muaQuPqtAmU4/N+1Me3J572Pr3KxXo99CWAk4OJ83eZB6FANDOmlV0umc5 pxZTFPn9FG7XYB9sMeOKYC2LTw505elGrZMABYcVjfl8YjGREJoIK3IpeSuTHIFJAGxj pX0dDt7ypvYHWygUJ+WZm3ov20ZF6QxCqVFcwwgxqcav5YJ6e/ID+CjQxbCI+lf1h7jI GMo63u9aHWtIKQe4I5xZhxXllysAAJKcJIp4cW3JWvR7tsMTzhaJl3vUQ4wvwIVuYOPQ NYjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LXZAF+KYhXzyhi5A3LYzaCt2axrqlZWnTNEINKW8OcU=; b=pDdTFLHQ46jZ+Od2HxAIKc1RLk05hOSALyab89c7TTn9yRqnKRrsrLmYH6qgibz4yr XqljOtH/y/NA39U7o8adTRDPJJepeGVxxTdAPaVBAVe4FbpzEL3yf4bs1knTNv9CopX2 7WkbQLIQGylbxOIdD0Co3oyk4dMAwS66OjwUVZ2R+45X8hJC2HRRID1QlevzqCp1qv2d CLNUuigcjbEnhvlXWpyIsrsRP+/j02cPcBJwpNZV8mhN6wpBWnFPtKH+TY1doUocnaDW xosJq8QwYojlLKJH7icWkjEbKreqlixfgHM0bt2fUrD8LBYNyH5B7/cOMPfKeUqthw3M +M6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RzLtTI0I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y17si12715279iov.62.2021.08.06.06.06.39; Fri, 06 Aug 2021 06:06:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RzLtTI0I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244224AbhHFIT3 (ORCPT + 99 others); Fri, 6 Aug 2021 04:19:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:47152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244042AbhHFIQs (ORCPT ); Fri, 6 Aug 2021 04:16:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A4678611CE; Fri, 6 Aug 2021 08:16:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628237792; bh=MXBS4NdaYTZUtLMjFg2tRS12IH7gjij01FImmTHeLvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RzLtTI0Io9FW5O4+wswtHHdxKWdTxgLRUhlZCLq8UdXjArXCfxa/h4RlYUMvx5Umg WyBJ2xnmT9gSbKq2XOB3MYQWPvZci5PJ++O58regA56y1Dyo1B0xnA2cpc9Gmq3zDM /hVSesbpEARYtIVnQqhcO1Qt9kB5VjzY4n2A3SDQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , Jan Kara , Bart Van Assche , Jens Axboe , Sasha Levin Subject: [PATCH 4.19 07/16] bdi: move bdi_dev_name out of line Date: Fri, 6 Aug 2021 10:14:58 +0200 Message-Id: <20210806081111.382172684@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210806081111.144943357@linuxfoundation.org> References: <20210806081111.144943357@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christoph Hellwig [ Upstream commit eb7ae5e06bb6e6ac6bb86872d27c43ebab92f6b2 ] bdi_dev_name is not a fast path function, move it out of line. This prepares for using it from modular callers without having to export an implementation detail like bdi_unknown_name. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Greg Kroah-Hartman Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- include/linux/backing-dev.h | 9 +-------- mm/backing-dev.c | 10 +++++++++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 1ef4aca7b953..d28d57eefe9f 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h @@ -499,13 +499,6 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) (1 << WB_async_congested)); } -extern const char *bdi_unknown_name; - -static inline const char *bdi_dev_name(struct backing_dev_info *bdi) -{ - if (!bdi || !bdi->dev) - return bdi_unknown_name; - return dev_name(bdi->dev); -} +const char *bdi_dev_name(struct backing_dev_info *bdi); #endif /* _LINUX_BACKING_DEV_H */ diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 2152e85891d1..8501b033bca8 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -19,7 +19,7 @@ struct backing_dev_info noop_backing_dev_info = { EXPORT_SYMBOL_GPL(noop_backing_dev_info); static struct class *bdi_class; -const char *bdi_unknown_name = "(unknown)"; +static const char *bdi_unknown_name = "(unknown)"; /* * bdi_lock protects updates to bdi_list. bdi_list has RCU reader side @@ -976,6 +976,14 @@ void bdi_put(struct backing_dev_info *bdi) } EXPORT_SYMBOL(bdi_put); +const char *bdi_dev_name(struct backing_dev_info *bdi) +{ + if (!bdi || !bdi->dev) + return bdi_unknown_name; + return dev_name(bdi->dev); +} +EXPORT_SYMBOL_GPL(bdi_dev_name); + static wait_queue_head_t congestion_wqh[2] = { __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[0]), __WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[1]) -- 2.30.2