]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/nfs: reuse CephfsClient for path checks and earmark resolver 68842/head
authorShweta Bhosale <Shweta.Bhosale1@ibm.com>
Mon, 11 May 2026 10:02:14 +0000 (15:32 +0530)
committerShweta Bhosale <Shweta.Bhosale1@ibm.com>
Tue, 12 May 2026 07:03:06 +0000 (12:33 +0530)
commita32fe1e8e0ef95f42a4b3f67baae56296d105964
tree51a1ecc71369b234c9a6d35b6aac843fedeffafa
parent402cd0ae6410d176f2aed8f08875c85303fb38d5
mgr/nfs: reuse CephfsClient for path checks and earmark resolver

cephfs_path_is_dir defined an inner function decorated with lru_cache, so
each call got a new function object and an empty cache, CephfsClient(mgr)
ran every time. Moved caching to module-level cephfs_client_for_mgr(mgr)
and call it from cephfs_path_is_dir.
Passed that shared client into CephFSEarmarkResolver from the NFS module so
export create/apply does not construct a separate CephfsClient for
earmarks.

Fixes: https://tracker.ceph.com/issues/76504
Signed-off-by: Shweta Bhosale <Shweta.Bhosale1@ibm.com>
src/pybind/mgr/nfs/module.py
src/pybind/mgr/nfs/tests/test_nfs.py
src/pybind/mgr/nfs/utils.py