| 8981 | } |
| 8982 | |
| 8983 | int Client::stat(const char *relpath, struct stat *stbuf, const UserPerm& perms, |
| 8984 | frag_info_t *dirstat, int mask) |
| 8985 | { |
| 8986 | RWRef_t mref_reader(mount_state, CLIENT_MOUNTING); |
| 8987 | if (!mref_reader.is_state_satisfied()) |
| 8988 | return -ENOTCONN; |
| 8989 | |
| 8990 | ldout(cct, 3) << __func__ << " enter (relpath " << relpath << " mask " << mask << ")" << dendl; |
| 8991 | tout(cct) << "stat" << std::endl; |
| 8992 | tout(cct) << relpath << std::endl; |
| 8993 | |
| 8994 | filepath path(relpath); |
| 8995 | InodeRef in; |
| 8996 | |
| 8997 | std::scoped_lock lock(client_lock); |
| 8998 | if (int rc = path_walk(cwd, relpath, &in, perms, {.mask = (unsigned)mask}); rc < 0) { |
| 8999 | return rc; |
| 9000 | } |
| 9001 | if (int rc = _getattr(in, mask, perms); rc < 0) { |
| 9002 | ldout(cct, 3) << __func__ << " exit on error!" << dendl; |
| 9003 | return rc; |
| 9004 | } |
| 9005 | fill_stat(in, stbuf, dirstat); |
| 9006 | ldout(cct, 3) << __func__ << " exit (relpath " << relpath << " mask " << mask << ")" << dendl; |
| 9007 | return 0; |
| 9008 | } |
| 9009 | |
| 9010 | unsigned Client::statx_to_mask(unsigned int flags, unsigned int want) |
| 9011 | { |