const cref_t<MClientRequest> &req = mdr->client_request;
string name(req->get_path2());
- // magic ceph.* namespace?
- if (name.compare(0, 5, "ceph.") == 0) {
+ // is a ceph virtual xattr?
+ if (is_ceph_vxattr(name)) {
// can't use rdlock_path_pin_ref because we need to xlock snaplock/policylock
CInode *cur = try_get_auth_inode(mdr, req->get_filepath().get_ino());
if (!cur)
const cref_t<MClientRequest> &req = mdr->client_request;
std::string name(req->get_path2());
- if (name.compare(0, 5, "ceph.") == 0) {
+ // is a ceph virtual xattr?
+ if (is_ceph_vxattr(name)) {
// can't use rdlock_path_pin_ref because we need to xlock snaplock/policylock
CInode *cur = try_get_auth_inode(mdr, req->get_filepath().get_ino());
if (!cur)
friend class ServerLogContext;
friend class Batch_Getattr_Lookup;
+ static bool is_ceph_vxattr(std::string_view xattr_name) {
+ return xattr_name.rfind("ceph.dir.layout", 0) == 0 ||
+ xattr_name.rfind("ceph.file.layout", 0) == 0 ||
+ xattr_name.rfind("ceph.quota", 0) == 0 ||
+ xattr_name == "ceph.dir.subvolume"sv ||
+ xattr_name == "ceph.dir.pin"sv ||
+ xattr_name == "ceph.dir.pin.random"sv ||
+ xattr_name == "ceph.dir.pin.distributed"sv;
+ }
+
void reply_client_request(MDRequestRef& mdr, const ref_t<MClientReply> &reply);
void flush_session(Session *session, MDSGatherBuilder& gather);