| 13346 | } |
| 13347 | |
| 13348 | int Client::fstat(int fd, struct stat *stbuf, const UserPerm& perms, int mask) |
| 13349 | { |
| 13350 | RWRef_t mref_reader(mount_state, CLIENT_MOUNTING); |
| 13351 | if (!mref_reader.is_state_satisfied()) |
| 13352 | return -ENOTCONN; |
| 13353 | |
| 13354 | tout(cct) << "fstat mask " << hex << mask << dec << std::endl; |
| 13355 | tout(cct) << fd << std::endl; |
| 13356 | |
| 13357 | std::scoped_lock lock(client_lock); |
| 13358 | Fh *f = get_filehandle(fd); |
| 13359 | if (!f) |
| 13360 | return -EBADF; |
| 13361 | int r = _getattr(f->inode, mask, perms); |
| 13362 | if (r < 0) |
| 13363 | return r; |
| 13364 | fill_stat(f->inode, stbuf, NULL); |
| 13365 | ldout(cct, 5) << "fstat(" << fd << ", " << stbuf << ") = " << r << dendl; |
| 13366 | return r; |
| 13367 | } |
| 13368 | |
| 13369 | int Client::fstatx(int fd, struct ceph_statx *stx, const UserPerm& perms, |
| 13370 | unsigned int want, unsigned int flags) |