MCPcopy Create free account
hub / github.com/ceph/ceph / fstat

Method fstat

src/client/Client.cc:13348–13367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13346}
13347
13348int 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
13369int Client::fstatx(int fd, struct ceph_statx *stx, const UserPerm& perms,
13370 unsigned int want, unsigned int flags)

Callers 15

mainFunction · 0.45
ceph_fstatFunction · 0.45
parseMethod · 0.45
chunk_fileMethod · 0.45
test_write_ower_modeMethod · 0.45
fnMethod · 0.45
test_fstatFunction · 0.45

Calls 1

is_state_satisfiedMethod · 0.80

Tested by 12

test_write_ower_modeMethod · 0.36
test_fstatFunction · 0.36
test_ftruncateFunction · 0.36
test_fallocateFunction · 0.36
test_lazyioFunction · 0.36
test_fstatFunction · 0.36
test_renameFunction · 0.36