From nobody Tue Feb 10 05:44:03 2026 Received: from canpmsgout06.his.huawei.com (canpmsgout06.his.huawei.com [113.46.200.221]) (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 F12F534A79E; Thu, 22 Jan 2026 13:50:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.221 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769089829; cv=none; b=e1WYrkIOx8lvTOt2M4SgqvcuOZmzq0f5d9m4SGrAW6Z/6IQsnbu9Gvbelf4Erqbp0yj8CM/n1ZpSBWnt5zzMeTLZBD0npFYC7TjjPfBU9HsYYP2wv0Tu6d23gUufM3AtjfD8bpWNg9Hp7vc8hFGxJiitiDhAGeENppEHCalSdzY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769089829; c=relaxed/simple; bh=/DOP628ou57Yld7gMP4kYmxmunqIn78QOq3XPXhRUAY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PIIaQPzXbOWzuYBJmwVJjaNjpip1+l2/mlO48OCxN4gOEXoWQYivcD8RtVe+PKVUcyunDq5jsHaLEiEUHKijnO5OH27pstUYVXgJE+Je39U9AE6HY45xaEi5sYpvl7Tb+18nLtpyf6ZL9odOSlYplM8OlQ2DUy6qptBGSCe1fL4= 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=aViTVgKb; arc=none smtp.client-ip=113.46.200.221 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="aViTVgKb" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=IJqOVDMyH2cU6HZaQ6KGaq7L7r7sGB/NU+oSMo68sYk=; b=aViTVgKbU3p9F6fvfb/DRZ9GIhljQ3rKlHQMPA1II5YccTLm1l79Wl8RBcmkkhYNwMzHKxXz0 9YV1Y0ow6kq2fONT0jz7uycW8blnvYaMxZYGGACdFOLs9cXkvJ3tWcEIwXSiiP4I/798eIXtO+j kCdEQvGGYPkM65v8oi6/oqU= Received: from mail.maildlp.com (unknown [172.19.163.104]) by canpmsgout06.his.huawei.com (SkyGuard) with ESMTPS id 4dxj640M5tzRhR4; Thu, 22 Jan 2026 21:46:52 +0800 (CST) Received: from kwepemr500015.china.huawei.com (unknown [7.202.195.162]) by mail.maildlp.com (Postfix) with ESMTPS id C1DB64056A; Thu, 22 Jan 2026 21:50:16 +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; Thu, 22 Jan 2026 21:50:16 +0800 From: Hongbo Li To: , , CC: , , , , , , Subject: [PATCH v16 01/10] fs: Export alloc_empty_backing_file Date: Thu, 22 Jan 2026 13:37:09 +0000 Message-ID: <20260122133718.658056-2-lihongbo22@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20260122133718.658056-1-lihongbo22@huawei.com> References: <20260122133718.658056-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: kwepems200002.china.huawei.com (7.221.188.68) 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(). Signed-off-by: Hongbo Li Reviewed-by: Gao Xiang Acked-by: Amir Goldstein --- 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