From nobody Mon Feb 9 19:38:10 2026 Received: from canpmsgout04.his.huawei.com (canpmsgout04.his.huawei.com [113.46.200.219]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 158BF329E69; Wed, 24 Dec 2025 04:22:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.219 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766550144; cv=none; b=ZkOkA1gfOvL13nbWz/D4Q3y6Zvme4FGM5BJo9vTYGy0m9Iu5xySsxKThNTnAM6aM+j/YAP49Nhk7zXqR6zWgDpkXE03ALBVriPQ20Tt/Yz1rxQlM6pxt3BXnY7BVy2XNoJRnYZ92gopiQ4DoXZReBS7g2o45URDr8omVrSBMrek= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766550144; c=relaxed/simple; bh=o9PsDCSHfTN4dP+nsNAHSZymQD5Rfhvw6SyywGX4Was=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iw6sZfEQ2kq/7oKiDUUMiJAc+tc2S/6Sj2lxQHjpI8OEEKxX/S/5awL/13CJScvtYSrKCvNcBQIPYsW0tlBwL0DdOwngU2BMR3Z/3UZqjuWa6ew/6GEa6yVMdb0ypDEBxDyqhTuvtbxwABIioFjHRjbOvdD7jicgndO6V/cZOYY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=i1AjIdsa; arc=none smtp.client-ip=113.46.200.219 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="i1AjIdsa" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=pCEmq/7pHVFqz5yCBp8Mya2y3rUOY7LVIakJQzG9dVQ=; b=i1AjIdsaoG1hZ0YSlACtNP9nGN/ILaNjIBwDd8Elzxk+UU4cfMMe2h2lHZGfv5lvpUmUWzlFV XoVS+M4ZWk0V7yELt5NLcRzz8mDxiEZ0WyJKCbk80PL2uB2iJRXlS62NNxoeCpleOXa5qUkqRim wuegOGIfTOtQxh5Pb88teAo= Received: from mail.maildlp.com (unknown [172.19.162.197]) by canpmsgout04.his.huawei.com (SkyGuard) with ESMTPS id 4dbdtQ5cnrz1prKH; Wed, 24 Dec 2025 12:19:10 +0800 (CST) Received: from kwepemr500015.china.huawei.com (unknown [7.202.195.162]) by mail.maildlp.com (Postfix) with ESMTPS id 9C80C40363; Wed, 24 Dec 2025 12:22:19 +0800 (CST) Received: from huawei.com (10.67.174.162) by kwepemr500015.china.huawei.com (7.202.195.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 24 Dec 2025 12:22:18 +0800 From: Hongbo Li To: , , , , , CC: , , , Subject: [PATCH v11 03/10] fs: Export alloc_empty_backing_file Date: Wed, 24 Dec 2025 04:09:25 +0000 Message-ID: <20251224040932.496478-4-lihongbo22@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20251224040932.496478-1-lihongbo22@huawei.com> References: <20251224040932.496478-1-lihongbo22@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemr500015.china.huawei.com (7.202.195.162) Content-Type: text/plain; charset="utf-8" There is no need to open nonexistent real files if backing files couldn't be backed by real files (e.g., EROFS page cache sharing doesn't need typical real files to open again). Therefore, we export the alloc_empty_backing_file() helper, allowing filesystems to dynamically set the backing file without real file open. This is particularly useful for obtaining the correct @path and @inode when calling file_user_path() and file_user_inode(). Reviewed-by: Gao Xiang Acked-by: Amir Goldstein Signed-off-by: Hongbo Li --- fs/file_table.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/file_table.c b/fs/file_table.c index cd4a3db4659a..476edfe7d8f5 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -308,6 +308,7 @@ struct file *alloc_empty_backing_file(int flags, const = struct cred *cred) ff->file.f_mode |=3D FMODE_BACKING | FMODE_NOACCOUNT; return &ff->file; } +EXPORT_SYMBOL_GPL(alloc_empty_backing_file); =20 /** * file_init_path - initialize a 'struct file' based on path --=20 2.22.0