Lines Matching refs:cap
885 struct ceph_cap *cap; in __choose_mds() local
999 cap = NULL; in __choose_mds()
1001 cap = ci->i_auth_cap; in __choose_mds()
1002 if (!cap && !RB_EMPTY_ROOT(&ci->i_caps)) in __choose_mds()
1003 cap = rb_entry(rb_first(&ci->i_caps), struct ceph_cap, ci_node); in __choose_mds()
1004 if (!cap) { in __choose_mds()
1009 mds = cap->session->s_mds; in __choose_mds()
1012 cap == ci->i_auth_cap ? "auth " : "", cap); in __choose_mds()
1262 struct ceph_cap *cap; in dispose_cap_releases() local
1264 cap = list_first_entry(dispose, struct ceph_cap, session_caps); in dispose_cap_releases()
1265 list_del(&cap->session_caps); in dispose_cap_releases()
1266 ceph_put_cap(mdsc, cap); in dispose_cap_releases()
1319 struct ceph_cap *cap; in ceph_iterate_session_caps() local
1328 cap = list_entry(p, struct ceph_cap, session_caps); in ceph_iterate_session_caps()
1329 inode = igrab(&cap->ci->vfs_inode); in ceph_iterate_session_caps()
1334 session->s_cap_iterator = cap; in ceph_iterate_session_caps()
1348 ret = cb(inode, cap, arg); in ceph_iterate_session_caps()
1353 if (!cap->ci) { in ceph_iterate_session_caps()
1355 cap); in ceph_iterate_session_caps()
1356 BUG_ON(cap->session != session); in ceph_iterate_session_caps()
1357 cap->session = NULL; in ceph_iterate_session_caps()
1358 list_del_init(&cap->session_caps); in ceph_iterate_session_caps()
1360 if (cap->queue_release) in ceph_iterate_session_caps()
1361 __ceph_queue_cap_release(session, cap); in ceph_iterate_session_caps()
1363 old_cap = cap; /* put_cap it w/o locks held */ in ceph_iterate_session_caps()
1380 static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap, in remove_session_caps_cb() argument
1390 cap, ci, &ci->vfs_inode); in remove_session_caps_cb()
1392 if (cap->mds_wanted | cap->issued) in remove_session_caps_cb()
1394 __ceph_remove_cap(cap, false); in remove_session_caps_cb()
1496 struct ceph_cap *cap, *prev = NULL; in remove_session_caps() local
1506 cap = list_entry(session->s_caps.next, in remove_session_caps()
1508 if (cap == prev) in remove_session_caps()
1510 prev = cap; in remove_session_caps()
1511 vino = cap->ci->i_vino; in remove_session_caps()
1543 static int wake_up_session_cb(struct inode *inode, struct ceph_cap *cap, in wake_up_session_cb() argument
1555 if (cap->cap_gen < cap->session->s_cap_gen) { in wake_up_session_cb()
1558 cap->issued = cap->implemented = CEPH_CAP_PIN; in wake_up_session_cb()
1560 if (__ceph_caps_file_wanted(ci) & ~cap->mds_wanted) in wake_up_session_cb()
1725 static int trim_caps_cb(struct inode *inode, struct ceph_cap *cap, void *arg) in trim_caps_cb() argument
1735 mine = cap->issued | cap->implemented; in trim_caps_cb()
1738 oissued = __ceph_caps_issued_other(ci, cap); in trim_caps_cb()
1741 inode, cap, ceph_cap_string(mine), ceph_cap_string(oissued), in trim_caps_cb()
1743 if (cap == ci->i_auth_cap) { in trim_caps_cb()
1767 __ceph_remove_cap(cap, true); in trim_caps_cb()
1782 inode, cap, count); in trim_caps_cb()
1864 struct ceph_cap *cap; in ceph_send_cap_releases() local
1894 cap = list_first_entry(&tmp_list, struct ceph_cap, in ceph_send_cap_releases()
1896 list_del(&cap->session_caps); in ceph_send_cap_releases()
1903 item->ino = cpu_to_le64(cap->cap_ino); in ceph_send_cap_releases()
1904 item->cap_id = cpu_to_le64(cap->cap_id); in ceph_send_cap_releases()
1905 item->migrate_seq = cpu_to_le32(cap->mseq); in ceph_send_cap_releases()
1906 item->seq = cpu_to_le32(cap->issue_seq); in ceph_send_cap_releases()
1909 ceph_put_cap(mdsc, cap); in ceph_send_cap_releases()
1984 struct ceph_cap *cap) in __ceph_queue_cap_release() argument
1986 list_add_tail(&cap->session_caps, &session->s_cap_releases); in __ceph_queue_cap_release()
2441 struct ceph_cap *cap = in __prepare_send_request() local
2444 if (cap) in __prepare_send_request()
2445 req->r_sent_on_mseq = cap->mseq; in __prepare_send_request()
3334 static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap, in encode_caps_cb() argument
3341 struct ceph_inode_info *ci = cap->ci; in encode_caps_cb()
3348 inode, ceph_vinop(inode), cap, cap->cap_id, in encode_caps_cb()
3349 ceph_cap_string(cap->issued)); in encode_caps_cb()
3352 cap->seq = 0; /* reset cap seq */ in encode_caps_cb()
3353 cap->issue_seq = 0; /* and issue_seq */ in encode_caps_cb()
3354 cap->mseq = 0; /* and migrate_seq */ in encode_caps_cb()
3355 cap->cap_gen = cap->session->s_cap_gen; in encode_caps_cb()
3358 rec.v2.cap_id = cpu_to_le64(cap->cap_id); in encode_caps_cb()
3360 rec.v2.issued = cpu_to_le32(cap->issued); in encode_caps_cb()
3366 rec.v1.cap_id = cpu_to_le64(cap->cap_id); in encode_caps_cb()
3368 rec.v1.issued = cpu_to_le32(cap->issued); in encode_caps_cb()