From nobody Tue Feb 10 07:39:31 2026 Received: from canpmsgout10.his.huawei.com (canpmsgout10.his.huawei.com [113.46.200.225]) (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 BBFBA4C92; Tue, 23 Dec 2025 02:09:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.225 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766455751; cv=none; b=tDUcZwjoiVsF0+I3itn5DOasAyI+hek7PUQq3oeMu4G+pmiZHIIJXLdtYJIs0i3Gf7ljbVO/MSnzekZ7Mjq7El0KOMTQXN9uIcONOuqLmLrn7V+y5404L1ivaJenkb64SFNBUyIz4zj65U7cB59T9dDY86lP531cOKIrHDD/Qhg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766455751; c=relaxed/simple; bh=d2MoA1EH6WS3a9F2U0oPjDfxAhv6ehk0nqw6pL3frqc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QLHZH2SI0ln6I7vOqrUxUt02o+fEej178lWCTI6UwvhW+XJEWf3WbRTytgzp9r1RrfpSYcILvPp3kVdUAcRrrIWkfBJ/UK/0oRRvnLv9iCi9p3SX48gbuL7WK7iAzYKHbxqgynWeQ48Rhx73XkdVnJelekisJ4Chzq3psB4ppRs= 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=xYOb9tDf; arc=none smtp.client-ip=113.46.200.225 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="xYOb9tDf" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=1cRA9yZ2lUeSNR4inCl2rr0rsFzm8me84K0NkDYSyjw=; b=xYOb9tDfx19eGQHxJ7CkEJuDRAWU9klU/rSt4zmBXFWJQymjZ3QZMm20oECHc1+XKXm2iBDPo +l1Fc/DrP0soq5m5S5Vngl6ouNlI36bT5qqIu12EC7ThyGLmc448sFkBLhtsOlVG2RC1k+H58t6 lalenIhHriDqA9swcdMStDM= Received: from mail.maildlp.com (unknown [172.19.163.127]) by canpmsgout10.his.huawei.com (SkyGuard) with ESMTPS id 4dZyz94PKWz1K996; Tue, 23 Dec 2025 10:05:57 +0800 (CST) Received: from kwepemr500015.china.huawei.com (unknown [7.202.195.162]) by mail.maildlp.com (Postfix) with ESMTPS id ACE924056C; Tue, 23 Dec 2025 10:09:01 +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; Tue, 23 Dec 2025 10:09:01 +0800 From: Hongbo Li To: , , , , , CC: , , , Subject: [PATCH v10 03/10] fs: Export alloc_empty_backing_file Date: Tue, 23 Dec 2025 01:56:12 +0000 Message-ID: <20251223015618.485626-4-lihongbo22@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20251223015618.485626-1-lihongbo22@huawei.com> References: <20251223015618.485626-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(). Signed-off-by: Hongbo Li Acked-by: Amir Goldstein Reviewed-by: Gao Xiang --- 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