| 9037 | } |
| 9038 | |
| 9039 | int Client::lstat(const char *relpath, struct stat *stbuf, |
| 9040 | const UserPerm& perms, frag_info_t *dirstat, int mask) |
| 9041 | { |
| 9042 | RWRef_t mref_reader(mount_state, CLIENT_MOUNTING); |
| 9043 | if (!mref_reader.is_state_satisfied()) |
| 9044 | return -ENOTCONN; |
| 9045 | |
| 9046 | ldout(cct, 3) << __func__ << " enter (relpath " << relpath << " mask " << mask << ")" << dendl; |
| 9047 | tout(cct) << __func__ << std::endl; |
| 9048 | tout(cct) << relpath << std::endl; |
| 9049 | |
| 9050 | filepath path(relpath); |
| 9051 | InodeRef in; |
| 9052 | |
| 9053 | std::scoped_lock lock(client_lock); |
| 9054 | // don't follow symlinks |
| 9055 | if (int rc = path_walk(cwd, path, &in, perms, {.followsym = false, .mask = (unsigned)mask}); rc < 0) { |
| 9056 | return rc; |
| 9057 | } |
| 9058 | if (int rc = _getattr(in, mask, perms); rc < 0) { |
| 9059 | ldout(cct, 3) << __func__ << " exit on error!" << dendl; |
| 9060 | return rc; |
| 9061 | } |
| 9062 | fill_stat(in, stbuf, dirstat); |
| 9063 | ldout(cct, 3) << __func__ << " exit (relpath " << relpath << " mask " << mask << ")" << dendl; |
| 9064 | return 0; |
| 9065 | } |
| 9066 | |
| 9067 | int Client::fill_stat(Inode *in, struct stat *st, frag_info_t *dirstat, nest_info_t *rstat) |
| 9068 | { |