return res;
}
+bool Client::make_absolute_path_string(Inode *in, std::string& path)
+{
+ if (!metadata.count("root") || !in)
+ return false;
+
+ path = metadata["root"].data();
+ if (!in->make_path_string(path)) {
+ path.clear();
+ return false;
+ }
+
+ return true;
+}
+
int Client::_do_setattr(Inode *in, struct ceph_statx *stx, int mask,
const UserPerm& perms, InodeRef *inp,
std::vector<uint8_t>* aux)
int res;
{
std::string path;
- res = in->make_path_string(path);
- if (res) {
+ if (make_absolute_path_string(in, path)) {
ldout(cct, 20) << " absolute path: " << path << dendl;
if (path.length())
path = path.substr(1); // drop leading /
}
std::string path;
- int result = in->make_path_string(path);
- if (result) {
+ if (make_absolute_path_string(in, path)) {
ldout(cct, 20) << __func__ << " absolute path: " << path << dendl;
if (path.length())
path = path.substr(1); // drop leading /
const UserPerm& perms, std::string alternate_name, InodeRef *inp = 0);
int _mknod(Inode *dir, const char *name, mode_t mode, dev_t rdev,
const UserPerm& perms, InodeRef *inp = 0);
+ bool make_absolute_path_string(Inode *in, std::string& path);
int _do_setattr(Inode *in, struct ceph_statx *stx, int mask,
const UserPerm& perms, InodeRef *inp,
std::vector<uint8_t>* aux=nullptr);