| 353 | } |
| 354 | |
| 355 | int Inode::caps_file_wanted() |
| 356 | { |
| 357 | int want = 0; |
| 358 | for (const auto &[mode, cnt] : open_by_mode) |
| 359 | if (cnt) { |
| 360 | want |= ceph_caps_for_mode(mode); |
| 361 | |
| 362 | #if defined(__linux__) |
| 363 | //want Fr cap during fscrypt rmw |
| 364 | if ((mode == CEPH_FILE_MODE_WR) && fscrypt_ctx) { |
| 365 | want |= CEPH_CAP_FILE_RD; |
| 366 | } |
| 367 | #endif |
| 368 | } |
| 369 | return want; |
| 370 | } |
| 371 | |
| 372 | int Inode::caps_wanted() |
| 373 | { |
no test coverage detected