diff options
author | Jeff Layton <jlayton@redhat.com> | 2021-02-01 17:04:07 +0100 |
---|---|---|
committer | Jeff Layton <jlayton@redhat.com> | 2021-02-11 15:36:00 +0100 |
commit | 70622079c2ec55222a139fa5042902e0b19bd839 (patch) | |
tree | 037582a709bf33b35be16ec27e619c29805ddd4d /src/libcephfs.cc | |
parent | client: make _lookup_ino take a vinodeno_t (diff) | |
download | ceph-70622079c2ec55222a139fa5042902e0b19bd839.tar.xz ceph-70622079c2ec55222a139fa5042902e0b19bd839.zip |
client: add ceph_ll_lookup_vino
Add a new API function for looking up an inode via a vinodeno_t. This
should give ganesha a way to reliably look up snapshot inodes.
We do need to add some special handling for CEPH_SNAPDIRs. If we're
looking for one, then find the non-snapped parent, and then call
open_snapdir to get the snapdir inode.
Also, have the function check the local cache before calling the MDS
to look up an inode.
Fixes: https://tracker.ceph.com/issues/48991
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'src/libcephfs.cc')
-rw-r--r-- | src/libcephfs.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcephfs.cc b/src/libcephfs.cc index 261ee695499..806ad7a0a99 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -1628,6 +1628,14 @@ extern "C" struct Inode *ceph_ll_get_inode(class ceph_mount_info *cmount, } +extern "C" int ceph_ll_lookup_vino( + struct ceph_mount_info *cmount, + vinodeno_t vino, + Inode **inode) +{ + return (cmount->get_client())->ll_lookup_vino(vino, cmount->default_perms, inode); +} + /** * Populates the client cache with the requested inode, and its * parent dentry. |