return -EBADF;
}
- Inode *in = f->inode.get();
+ return ll_is_encrypted(f->inode.get(), perms, enctag);
+}
+
+int Client::ll_is_encrypted(Inode *in, UserPerm& perms, char *enctag)
+{
if (in->is_encrypted()) {
int r = ll_getxattr(in, "user.ceph.subvolume.enctag", enctag, sizeof(enctag), perms);
// dir can be encrypted and xattr DNE if it isn't setup via mgr subvolume
int ll_set_fscrypt_policy_v2(Inode *in, const struct fscrypt_policy_v2& policy);
int ll_get_fscrypt_policy_v2(Inode *in, struct fscrypt_policy_v2* policy);
+ int ll_is_encrypted(Inode *in, UserPerm& perms, char* enctag);
int ll_get_stripe_osd(struct Inode *in, uint64_t blockno,
file_layout_t* layout);
int ceph_ll_lazyio(struct ceph_mount_info *cmount, Fh *fh, int enable);
+int ceph_ll_set_fscrypt_policy_v2(struct ceph_mount_info *cmount,
+ Inode *in, const struct fscrypt_policy_v2 *policy);
+
+int ceph_ll_get_fscrypt_policy_v2(struct ceph_mount_info *cmount,
+ Inode *in, struct fscrypt_policy_v2 *policy);
+
+int ceph_ll_is_encrypted(struct ceph_mount_info *cmount, Inode *in, char* enctag);
+
/*
* Delegation support
*
return cmount->get_client()->get_fscrypt_policy_v2(fd, policy);
}
+extern "C" int ceph_ll_set_fscrypt_policy_v2(struct ceph_mount_info *cmount,
+ Inode *in, const struct fscrypt_policy_v2 *policy)
+{
+ if (!cmount->is_mounted())
+ return -ENOTCONN;
+
+ return cmount->get_client()->ll_set_fscrypt_policy_v2(in, *policy);
+}
+
+extern "C" int ceph_ll_get_fscrypt_policy_v2(struct ceph_mount_info *cmount,
+ Inode *in, struct fscrypt_policy_v2 *policy)
+{
+ if (!cmount->is_mounted())
+ return -ENOTCONN;
+
+ return cmount->get_client()->ll_get_fscrypt_policy_v2(in, policy);
+}
+
+extern "C" int ceph_ll_is_encrypted(struct ceph_mount_info *cmount,
+ Inode *in, char* enctag)
+{
+ if (!cmount->is_mounted())
+ return -ENOTCONN;
+
+ return cmount->get_client()->ll_is_encrypted(in, cmount->default_perms, enctag);
+}
// This is deprecated, use ceph_ll_register_callbacks2 instead.
extern "C" void ceph_ll_register_callbacks(class ceph_mount_info *cmount,