return res;
}
+ int Client::_getvxattr(
+ Inode *in,
+ const UserPerm& perms,
+ const char *xattr_name,
+ ssize_t size,
+ void *value,
+ mds_rank_t rank)
+ {
+ if (!xattr_name || strlen(xattr_name) <= 0 || strlen(xattr_name) > 255) {
+ return -CEPHFS_ENODATA;
+ }
+
+ MetaRequest *req = new MetaRequest(CEPH_MDS_OP_GETVXATTR);
+ filepath path;
+ in->make_nosnap_relative_path(path);
+ req->set_filepath(path);
+ req->set_inode(in);
+ req->set_string2(xattr_name);
+
+ bufferlist bl;
+ int res = make_request(req, perms, nullptr, nullptr, rank, &bl);
+ ldout(cct, 10) << __func__ << " result=" << res << dendl;
+
+ if (res < 0) {
+ return res;
+ }
+
+ std::string buf;
+ auto p = bl.cbegin();
+
+ DECODE_START(1, p);
+ decode(buf, p);
+ DECODE_FINISH(p);
+
+ ssize_t len = buf.length();
+
+ res = len; // refer to man getxattr(2) for output buffer size == 0
+
+ if (size > 0) {
+ if (len > size) {
+ res = -CEPHFS_ERANGE; // insufficient output buffer space
+ } else {
+ memcpy(value, buf.c_str(), len);
+ }
+ }
+ return res;
+ }
+
int Client::_do_setattr(Inode *in, struct ceph_statx *stx, int mask,
- const UserPerm& perms, InodeRef *inp)
+ const UserPerm& perms, InodeRef *inp,
+ std::vector<uint8_t>* aux)
{
int issued = in->caps_issued();
union ceph_mds_request_args args;