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

Method _renew_caps

src/client/Client.cc:11099–11135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11097}
11098
11099int Client::_renew_caps(Inode *in)
11100{
11101 int wanted = in->caps_file_wanted();
11102 if (in->is_any_caps() &&
11103 ((wanted & CEPH_CAP_ANY_WR) == 0 || in->auth_cap)) {
11104 check_caps(in, CHECK_CAPS_NODELAY);
11105 return 0;
11106 }
11107
11108 int flags = 0;
11109 if ((wanted & CEPH_CAP_FILE_RD) && (wanted & CEPH_CAP_FILE_WR))
11110 flags = O_RDWR;
11111 else if (wanted & CEPH_CAP_FILE_RD)
11112 flags = O_RDONLY;
11113 else if (wanted & CEPH_CAP_FILE_WR)
11114 flags = O_WRONLY;
11115
11116 MetaRequest *req = new MetaRequest(CEPH_MDS_OP_OPEN);
11117 filepath path;
11118 in->make_nosnap_relative_path(path);
11119 req->set_filepath(path); // why not filepath(ino=in->ino) FIXME ??
11120 req->head.args.open.flags = flags;
11121 req->head.args.open.pool = -1;
11122 if (cct->_conf->client_debug_getattr_caps)
11123 req->head.args.open.mask = DEBUG_GETATTR_CAPS;
11124 else
11125 req->head.args.open.mask = 0;
11126 req->set_inode(in);
11127
11128 // duplicate in case Cap goes away; not sure if that race is a concern?
11129 const UserPerm *pperm = in->get_best_perms();
11130 UserPerm perms;
11131 if (pperm != NULL)
11132 perms = *pperm;
11133 int ret = make_request(req, perms);
11134 return ret;
11135}
11136
11137int Client::_close(int fd)
11138{

Callers

nothing calls this directly

Calls 7

caps_file_wantedMethod · 0.80
set_inodeMethod · 0.80
get_best_permsMethod · 0.80
make_requestFunction · 0.50
is_any_capsMethod · 0.45
set_filepathMethod · 0.45

Tested by

no test coverage detected