| 10916 | } |
| 10917 | |
| 10918 | int Client::_release_fh(Fh *f) |
| 10919 | { |
| 10920 | //ldout(cct, 3) << "op: client->close(open_files[ " << fh << " ]);" << dendl; |
| 10921 | //ldout(cct, 3) << "op: open_files.erase( " << fh << " );" << dendl; |
| 10922 | Inode *in = f->inode.get(); |
| 10923 | ldout(cct, 8) << __func__ << " " << f << " mode " << f->mode << " on " << *in << dendl; |
| 10924 | |
| 10925 | in->unset_deleg(f); |
| 10926 | |
| 10927 | if (in->snapid == CEPH_NOSNAP) { |
| 10928 | #if defined(__linux__) |
| 10929 | FSCryptKeyHandlerRef kh; |
| 10930 | get_keyhandler(in->fscrypt_ctx, kh); |
| 10931 | if (kh) { |
| 10932 | auto& di = kh->get_di(); |
| 10933 | if (di) { |
| 10934 | di->del_inode(in->ino); |
| 10935 | } |
| 10936 | } |
| 10937 | #endif |
| 10938 | if (in->put_open_ref(f->mode)) { |
| 10939 | _flush(in, new C_Client_FlushComplete(this, in)); |
| 10940 | check_caps(in, 0); |
| 10941 | } |
| 10942 | } else { |
| 10943 | ceph_assert(in->snap_cap_refs > 0); |
| 10944 | in->snap_cap_refs--; |
| 10945 | } |
| 10946 | |
| 10947 | _release_filelocks(f); |
| 10948 | |
| 10949 | // Finally, read any async err (i.e. from flushes) |
| 10950 | int err = f->take_async_err(); |
| 10951 | if (err != 0) { |
| 10952 | ldout(cct, 1) << __func__ << " " << f << " on inode " << *in << " caught async_err = " |
| 10953 | << cpp_strerror(err) << dendl; |
| 10954 | } else { |
| 10955 | ldout(cct, 10) << __func__ << " " << f << " on inode " << *in << " no async_err state" << dendl; |
| 10956 | } |
| 10957 | |
| 10958 | _put_fh(f); |
| 10959 | |
| 10960 | return err; |
| 10961 | } |
| 10962 | |
| 10963 | void Client::_put_fh(Fh *f) |
| 10964 | { |
nothing calls this directly
no test coverage detected