return r;
}
-int Client::ll_walk(const char* name, Inode **out, struct stat *attr,
- const UserPerm& perms)
+int Client::ll_walk(const char* name, Inode **out, struct ceph_statx *stx,
+ unsigned int want, unsigned int flags, const UserPerm& perms)
{
Mutex::Locker lock(client_lock);
filepath fp(name, 0);
InodeRef in;
int rc;
+ unsigned mask = statx_to_mask(flags, want);
ldout(cct, 3) << "ll_walk" << name << dendl;
tout(cct) << "ll_walk" << std::endl;
tout(cct) << name << std::endl;
- rc = path_walk(fp, &in, perms, false, CEPH_STAT_CAP_INODE_ALL);
+ rc = path_walk(fp, &in, perms, !(flags & AT_SYMLINK_NOFOLLOW), mask);
if (rc < 0) {
- attr->st_ino = 0;
+ /* zero out mask, just in case... */
+ stx->stx_mask = 0;
+ stx->stx_ino = 0;
*out = NULL;
return rc;
} else {
assert(in);
- fill_stat(in, attr);
+ fill_statx(in, mask, stx);
*out = in.get();
return 0;
}
}
-
void Client::_ll_get(Inode *in)
{
if (in->ll_ref == 0) {
int ll_commit_blocks(Inode *in, uint64_t offset, uint64_t length);
int ll_statfs(Inode *in, struct statvfs *stbuf, const UserPerm& perms);
- int ll_walk(const char* name, Inode **i, struct stat *attr,
- const UserPerm& perms); // XXX in?
+ int ll_walk(const char* name, Inode **i, struct ceph_statx *stx,
+ unsigned int want, unsigned int flags, const UserPerm& perms);
uint32_t ll_stripe_unit(Inode *in);
int ll_file_layout(Inode *in, file_layout_t *layout);
uint64_t ll_snap_seq(Inode *in);
int ceph_ll_put(struct ceph_mount_info *cmount, struct Inode *in);
int ceph_ll_forget(struct ceph_mount_info *cmount, struct Inode *in,
int count);
-int ceph_ll_walk(struct ceph_mount_info *cmount, const char *name,
- struct Inode **i,
- struct stat *attr);
+int ceph_ll_walk(struct ceph_mount_info *cmount, const char* name, Inode **i,
+ struct ceph_statx *stx, unsigned int want, unsigned int flags,
+ const UserPerm *perms);
int ceph_ll_getattr(struct ceph_mount_info *cmount, struct Inode *in,
struct ceph_statx *stx, unsigned int want, unsigned int flags,
const UserPerm *perms);
return (cmount->get_client()->ll_forget(in, count));
}
-extern "C" int ceph_ll_walk(class ceph_mount_info *cmount, const char *name,
- struct Inode **i,
- struct stat *attr)
+int ceph_ll_walk(struct ceph_mount_info *cmount, const char* name, Inode **i,
+ struct ceph_statx *stx, unsigned int want, unsigned int flags,
+ const UserPerm *perms)
{
- return (cmount->get_client()->ll_walk(name, i, attr, cmount->default_perms));
+ return(cmount->get_client()->ll_walk(name, i, stx, want, flags, *perms));
}
extern "C" int ceph_ll_getattr(class ceph_mount_info *cmount,