From 405b82921d77c976d4b3e7c80bebfa97d9eb3b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Rohl=C3=ADnek?= Date: Thu, 11 Dec 2025 11:52:22 +0100 Subject: [PATCH] feat(storage/vfs): Document context-less API deprecation --- docs/en/api-reference/storage/vfs.rst | 5 +++++ docs/en/migration-guides/release-6.x/6.0/storage.rst | 1 + 2 files changed, 6 insertions(+) diff --git a/docs/en/api-reference/storage/vfs.rst b/docs/en/api-reference/storage/vfs.rst index 98cd97fd7c..181a8cfdd3 100644 --- a/docs/en/api-reference/storage/vfs.rst +++ b/docs/en/api-reference/storage/vfs.rst @@ -19,6 +19,10 @@ FS Registration To register an FS driver, an application needs to define an instance of the :cpp:type:`esp_vfs_fs_ops_t` structure and populate it with function pointers to FS APIs: +.. warning:: + + The API version without a context pointer is deprecated, and will be removed in the future. See :ref:`context_api` for details. + .. highlight:: c :: @@ -65,6 +69,7 @@ The recommended approach for registering filesystem is to use statically allocat ESP_ERROR_CHECK(esp_vfs_register_fs("/data", &myfs, ESP_VFS_FLAG_DEFAULT, NULL)); } +.. _context_api: Context Aware Filesystem ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/en/migration-guides/release-6.x/6.0/storage.rst b/docs/en/migration-guides/release-6.x/6.0/storage.rst index c64bfe469b..f23586001c 100644 --- a/docs/en/migration-guides/release-6.x/6.0/storage.rst +++ b/docs/en/migration-guides/release-6.x/6.0/storage.rst @@ -19,6 +19,7 @@ VFS - ``esp_vfs_register_fd_range`` is now considered private and its signature was changed to match the new VFS API style. Projects that still rely on this internal helper must include ``esp_private/socket.h`` and should be aware that the API may change without notice. - Legacy VFS APIs (such as ``esp_vfs_register``) that operate on ``esp_vfs_t`` instead of ``esp_vfs_fs_ops_t`` are deprecated and will be removed in the next major release. Switch to the new ``esp_vfs_fs_ops_t``-based APIs. - TERMIOS support is now disabled by default. Re-enable :ref:`CONFIG_VFS_SUPPORT_TERMIOS` in menuconfig if your application calls POSIX ``termios`` APIs, such as ``tcsetattr``/``tcgetattr`` for UART configuration. +- Context-less VFS function pointers are deprecated. Switch to the context-aware ``*_p`` callbacks, register the VFS with ``ESP_VFS_FLAG_CONTEXT_PTR``, and pass ``NULL`` as the context pointer if the driver does not need per-instance state. This change simplifies the API surface and reduces runtime overhead in the VFS call path. ``esp_vfs_console``