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

Method lstat

src/client/Client.cc:9039–9065  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9037}
9038
9039int 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
9067int Client::fill_stat(Inode *in, struct stat *st, frag_info_t *dirstat, nest_info_t *rstat)
9068{

Callers 15

ceph_lstatFunction · 0.45
runMethod · 0.45
play_traceMethod · 0.45
clean_dirMethod · 0.45
full_walkMethod · 0.45
dump_placementMethod · 0.45
stat_dirsMethod · 0.45
read_dirsMethod · 0.45
make_filesMethod · 0.45
random_walkMethod · 0.45

Calls 1

is_state_satisfiedMethod · 0.80

Tested by 3

test_lchownMethod · 0.36