Skip to content

Commit 04c81a4

Browse files
committed
libcephfs: Implement ceph_ll_get() API
ceph_ll_get() updates the reference to the corresponding inode. Signed-off-by: Anoop C S <[email protected]>
1 parent d37f602 commit 04c81a4

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

src/client/Client.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13560,6 +13560,12 @@ bool Client::_ll_forget(Inode *in, uint64_t count)
1356013560
return last;
1356113561
}
1356213562

13563+
void Client::ll_get(Inode *in)
13564+
{
13565+
std::scoped_lock lock(client_lock);
13566+
_ll_get(in);
13567+
}
13568+
1356313569
bool Client::ll_forget(Inode *in, uint64_t count)
1356413570
{
1356513571
std::scoped_lock lock(client_lock);

src/client/Client.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ class Client : public Dispatcher, public md_config_obs_t {
599599
int ll_lookupx(Inode *parent, const char *name, Inode **out,
600600
struct ceph_statx *stx, unsigned want, unsigned flags,
601601
const UserPerm& perms);
602+
void ll_get(Inode *in);
602603
bool ll_forget(Inode *in, uint64_t count);
603604
bool ll_put(Inode *in);
604605
int ll_get_snap_ref(snapid_t snap);

src/include/cephfs/libcephfs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,6 +1994,7 @@ int ceph_ll_lookup_root(struct ceph_mount_info *cmount,
19941994
int ceph_ll_lookup(struct ceph_mount_info *cmount, Inode *parent,
19951995
const char *name, Inode **out, struct ceph_statx *stx,
19961996
unsigned want, unsigned flags, const UserPerm *perms);
1997+
void ceph_ll_get(struct ceph_mount_info *cmount, struct Inode *in);
19971998
int ceph_ll_put(struct ceph_mount_info *cmount, struct Inode *in);
19981999
int ceph_ll_forget(struct ceph_mount_info *cmount, struct Inode *in,
19992000
int count);

src/libcephfs.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,6 +2042,11 @@ extern "C" int ceph_ll_lookup(struct ceph_mount_info *cmount,
20422042
flags, *perms);
20432043
}
20442044

2045+
extern "C" void ceph_ll_get(class ceph_mount_info *cmount, Inode *in)
2046+
{
2047+
cmount->get_client()->ll_get(in);
2048+
}
2049+
20452050
extern "C" int ceph_ll_put(class ceph_mount_info *cmount, Inode *in)
20462051
{
20472052
return (cmount->get_client()->ll_put(in));

0 commit comments

Comments
 (0)