]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
libcephfs: Implement ceph_ll_get() API
authorAnoop C S <anoopcs@cryptolab.net>
Fri, 28 Mar 2025 02:30:32 +0000 (08:00 +0530)
committerAnoop C S <anoopcs@cryptolab.net>
Mon, 28 Apr 2025 10:29:30 +0000 (15:59 +0530)
ceph_ll_get() updates the reference to the corresponding inode.

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
src/client/Client.cc
src/client/Client.h
src/include/cephfs/libcephfs.h
src/libcephfs.cc

index f1f70c1321d81572aceb3a0c249af558ec511bf3..cebddbb8e38d0c26a0e935b7e7be7102bbf77dc2 100644 (file)
@@ -13560,6 +13560,12 @@ bool Client::_ll_forget(Inode *in, uint64_t count)
   return last;
 }
 
+void Client::ll_get(Inode *in)
+{
+  std::scoped_lock lock(client_lock);
+  _ll_get(in);
+}
+
 bool Client::ll_forget(Inode *in, uint64_t count)
 {
   std::scoped_lock lock(client_lock);
index 7ab691e2107bf2e6284049414af4278cb77637e5..1a3b8792f73f70f0d6ad007c333fe43504734345 100644 (file)
@@ -599,6 +599,7 @@ public:
   int ll_lookupx(Inode *parent, const char *name, Inode **out,
                        struct ceph_statx *stx, unsigned want, unsigned flags,
                        const UserPerm& perms);
+  void ll_get(Inode *in);
   bool ll_forget(Inode *in, uint64_t count);
   bool ll_put(Inode *in);
   int ll_get_snap_ref(snapid_t snap);
index 0a08e89566cc82d3f25597b07d099699e4843d51..bb7701579701ffb892dc0cdf99542372939d5cc9 100644 (file)
@@ -1994,6 +1994,7 @@ int ceph_ll_lookup_root(struct ceph_mount_info *cmount,
 int ceph_ll_lookup(struct ceph_mount_info *cmount, Inode *parent,
                   const char *name, Inode **out, struct ceph_statx *stx,
                   unsigned want, unsigned flags, const UserPerm *perms);
+void ceph_ll_get(struct ceph_mount_info *cmount, struct Inode *in);
 int ceph_ll_put(struct ceph_mount_info *cmount, struct Inode *in);
 int ceph_ll_forget(struct ceph_mount_info *cmount, struct Inode *in,
                   int count);
index 3c3cfe4d35af02be186ebc47356baaa6584837ae..1c1761684196491bbf3a572dda5c9eab50d01642 100644 (file)
@@ -2042,6 +2042,11 @@ extern "C" int ceph_ll_lookup(struct ceph_mount_info *cmount,
                                            flags, *perms);
 }
 
+extern "C" void ceph_ll_get(class ceph_mount_info *cmount, Inode *in)
+{
+  cmount->get_client()->ll_get(in);
+}
+
 extern "C" int ceph_ll_put(class ceph_mount_info *cmount, Inode *in)
 {
   return (cmount->get_client()->ll_put(in));