Lines Matching refs:session
512 struct ceph_mds_session *session, u64 cap_id, in ceph_add_cap() argument
520 int mds = session->s_mds; in ceph_add_cap()
524 session->s_mds, cap_id, ceph_cap_string(issued), seq); in ceph_add_cap()
548 cap->session = session; in ceph_add_cap()
549 spin_lock(&session->s_cap_lock); in ceph_add_cap()
550 list_add_tail(&cap->session_caps, &session->s_caps); in ceph_add_cap()
551 session->s_nr_caps++; in ceph_add_cap()
552 spin_unlock(&session->s_cap_lock); in ceph_add_cap()
632 cap->cap_gen = session->s_cap_gen; in ceph_add_cap()
648 spin_lock(&cap->session->s_gen_ttl_lock); in __cap_is_valid()
649 gen = cap->session->s_cap_gen; in __cap_is_valid()
650 ttl = cap->session->s_cap_ttl; in __cap_is_valid()
651 spin_unlock(&cap->session->s_gen_ttl_lock); in __cap_is_valid()
724 struct ceph_mds_session *s = cap->session; in __touch_cap()
908 struct ceph_mds_session *session = cap->session; in __ceph_remove_cap() local
917 spin_lock(&session->s_cap_lock); in __ceph_remove_cap()
923 (!session->s_cap_reconnect || in __ceph_remove_cap()
924 cap->cap_gen == session->s_cap_gen)) in __ceph_remove_cap()
925 __queue_cap_release(session, ci->i_vino.ino, cap->cap_id, in __ceph_remove_cap()
928 if (session->s_cap_iterator == cap) { in __ceph_remove_cap()
931 cap, cap->session); in __ceph_remove_cap()
934 session->s_nr_caps--; in __ceph_remove_cap()
935 cap->session = NULL; in __ceph_remove_cap()
940 spin_unlock(&session->s_cap_lock); in __ceph_remove_cap()
968 static int send_cap_msg(struct ceph_mds_session *session, in send_cap_msg() argument
1030 ceph_con_send(&session->s_con, msg); in send_cap_msg()
1034 void __queue_cap_release(struct ceph_mds_session *session, in __queue_cap_release() argument
1042 BUG_ON(!session->s_num_cap_releases); in __queue_cap_release()
1043 msg = list_first_entry(&session->s_cap_releases, in __queue_cap_release()
1047 ino, session->s_mds, msg, session->s_num_cap_releases); in __queue_cap_release()
1058 session->s_num_cap_releases--; in __queue_cap_release()
1063 list_move_tail(&msg->list_head, &session->s_cap_releases_done); in __queue_cap_release()
1122 struct ceph_mds_session *session; in __send_cap() local
1136 inode, cap, cap->session, in __send_cap()
1141 session = cap->session; in __send_cap()
1214 ret = send_cap_msg(session, ceph_vino(inode).ino, cap_id, in __send_cap()
1253 struct ceph_mds_session *session = NULL; /* if session != NULL, we hold in __ceph_flush_snaps() local
1260 session = *psession; in __ceph_flush_snaps()
1293 mds = ci->i_auth_cap->session->s_mds; in __ceph_flush_snaps()
1296 if (session && session->s_mds != mds) { in __ceph_flush_snaps()
1297 dout("oops, wrong session %p mutex\n", session); in __ceph_flush_snaps()
1298 mutex_unlock(&session->s_mutex); in __ceph_flush_snaps()
1299 ceph_put_mds_session(session); in __ceph_flush_snaps()
1300 session = NULL; in __ceph_flush_snaps()
1302 if (!session) { in __ceph_flush_snaps()
1305 session = __ceph_lookup_mds_session(mdsc, mds); in __ceph_flush_snaps()
1307 if (session) { in __ceph_flush_snaps()
1309 session); in __ceph_flush_snaps()
1310 mutex_lock(&session->s_mutex); in __ceph_flush_snaps()
1326 &session->s_cap_snaps_flushing); in __ceph_flush_snaps()
1331 send_cap_msg(session, ceph_vino(inode).ino, 0, in __ceph_flush_snaps()
1355 *psession = session; in __ceph_flush_snaps()
1356 else if (session) { in __ceph_flush_snaps()
1357 mutex_unlock(&session->s_mutex); in __ceph_flush_snaps()
1358 ceph_put_mds_session(session); in __ceph_flush_snaps()
1417 struct ceph_mds_session *session) in __mark_caps_flushing() argument
1440 list_add_tail(&ci->i_flushing_item, &session->s_cap_flushing); in __mark_caps_flushing()
1445 list_move_tail(&ci->i_flushing_item, &session->s_cap_flushing); in __mark_caps_flushing()
1490 struct ceph_mds_session *session) in ceph_check_caps() argument
1518 __ceph_flush_snaps(ci, &session, 0); in ceph_check_caps()
1670 if (session && session != cap->session) { in ceph_check_caps()
1671 dout("oops, wrong session %p mutex\n", session); in ceph_check_caps()
1672 mutex_unlock(&session->s_mutex); in ceph_check_caps()
1673 session = NULL; in ceph_check_caps()
1675 if (!session) { in ceph_check_caps()
1676 session = cap->session; in ceph_check_caps()
1677 if (mutex_trylock(&session->s_mutex) == 0) { in ceph_check_caps()
1679 session); in ceph_check_caps()
1685 mutex_lock(&session->s_mutex); in ceph_check_caps()
1703 flushing = __mark_caps_flushing(inode, session); in ceph_check_caps()
1732 if (session) in ceph_check_caps()
1733 mutex_unlock(&session->s_mutex); in ceph_check_caps()
1746 struct ceph_mds_session *session = NULL; in try_flush_caps() local
1760 if (!session || session != cap->session) { in try_flush_caps()
1762 if (session) in try_flush_caps()
1763 mutex_unlock(&session->s_mutex); in try_flush_caps()
1764 session = cap->session; in try_flush_caps()
1765 mutex_lock(&session->s_mutex); in try_flush_caps()
1768 if (cap->session->s_state < CEPH_MDS_SESSION_OPEN) in try_flush_caps()
1771 flushing = __mark_caps_flushing(inode, session); in try_flush_caps()
1786 if (session) in try_flush_caps()
1787 mutex_unlock(&session->s_mutex); in try_flush_caps()
1929 struct ceph_mds_session *session) in kick_flushing_capsnaps() argument
1933 dout("kick_flushing_capsnaps mds%d\n", session->s_mds); in kick_flushing_capsnaps()
1934 list_for_each_entry(capsnap, &session->s_cap_snaps_flushing, in kick_flushing_capsnaps()
1942 if (cap && cap->session == session) { in kick_flushing_capsnaps()
1945 __ceph_flush_snaps(ci, &session, 1); in kick_flushing_capsnaps()
1948 cap, session->s_mds); in kick_flushing_capsnaps()
1955 struct ceph_mds_session *session) in ceph_kick_flushing_caps() argument
1959 kick_flushing_capsnaps(mdsc, session); in ceph_kick_flushing_caps()
1961 dout("kick_flushing_caps mds%d\n", session->s_mds); in ceph_kick_flushing_caps()
1962 list_for_each_entry(ci, &session->s_cap_flushing, i_flushing_item) { in ceph_kick_flushing_caps()
1969 if (cap && cap->session == session) { in ceph_kick_flushing_caps()
1984 cap, session->s_mds); in ceph_kick_flushing_caps()
1991 struct ceph_mds_session *session, in kick_flushing_inode_caps() argument
2003 __ceph_flush_snaps(ci, &session, 1); in kick_flushing_inode_caps()
2008 &cap->session->s_cap_flushing); in kick_flushing_inode_caps()
2387 struct ceph_mds_session *session, in handle_cap_grant() argument
2392 int mds = session->s_mds; in handle_cap_grant()
2449 cap->cap_gen = session->s_cap_gen; in handle_cap_grant()
2586 kick_flushing_inode_caps(mdsc, session, inode); in handle_cap_grant()
2614 session); in handle_cap_grant()
2616 ceph_check_caps(ci, CHECK_CAPS_NODELAY, session); in handle_cap_grant()
2618 mutex_unlock(&session->s_mutex); in handle_cap_grant()
2627 struct ceph_mds_session *session, in handle_cap_flush_ack() argument
2646 inode, session->s_mds, seq, ceph_cap_string(dirty), in handle_cap_flush_ack()
2658 if (!list_empty(&session->s_cap_flushing)) in handle_cap_flush_ack()
2660 session->s_mds, in handle_cap_flush_ack()
2661 &list_entry(session->s_cap_flushing.next, in handle_cap_flush_ack()
2698 struct ceph_mds_session *session) in handle_cap_flushsnap_ack() argument
2706 inode, ci, session->s_mds, follows); in handle_cap_flushsnap_ack()
2743 struct ceph_mds_session *session) in handle_cap_trunc() argument
2747 int mds = session->s_mds; in handle_cap_trunc()
2781 struct ceph_mds_session *session) in handle_cap_export() argument
2791 int mds = session->s_mds; in handle_cap_export()
2841 &tcap->session->s_cap_flushing); in handle_cap_export()
2858 mutex_unlock(&session->s_mutex); in handle_cap_export()
2864 mutex_lock(&session->s_mutex); in handle_cap_export()
2869 mutex_lock_nested(&session->s_mutex, in handle_cap_export()
2883 mutex_unlock(&session->s_mutex); in handle_cap_export()
2900 struct ceph_mds_session *session, in handle_cap_import() argument
2906 int mds = session->s_mds; in handle_cap_import()
2948 ceph_add_cap(inode, session, cap_id, -1, caps, wanted, seq, mseq, in handle_cap_import()
2982 void ceph_handle_caps(struct ceph_mds_session *session, in ceph_handle_caps() argument
2985 struct ceph_mds_client *mdsc = session->s_mdsc; in ceph_handle_caps()
2992 int mds = session->s_mds; in ceph_handle_caps()
3054 mutex_lock(&session->s_mutex); in ceph_handle_caps()
3055 session->s_seq++; in ceph_handle_caps()
3056 dout(" mds%d seq %lld cap seq %u\n", session->s_mds, session->s_seq, in ceph_handle_caps()
3060 ceph_add_cap_releases(mdsc, session); in ceph_handle_caps()
3066 spin_lock(&session->s_cap_lock); in ceph_handle_caps()
3067 __queue_cap_release(session, vino.ino, cap_id, in ceph_handle_caps()
3069 spin_unlock(&session->s_cap_lock); in ceph_handle_caps()
3077 handle_cap_flushsnap_ack(inode, tid, h, session); in ceph_handle_caps()
3081 handle_cap_export(inode, h, peer, session); in ceph_handle_caps()
3085 handle_cap_import(mdsc, inode, h, peer, session, in ceph_handle_caps()
3088 msg->middle, session, cap, issued); in ceph_handle_caps()
3109 session, cap, issued); in ceph_handle_caps()
3113 handle_cap_flush_ack(inode, tid, h, session, cap); in ceph_handle_caps()
3117 handle_cap_trunc(inode, h, session); in ceph_handle_caps()
3134 ceph_add_cap_releases(mdsc, session); in ceph_handle_caps()
3135 ceph_send_cap_releases(mdsc, session); in ceph_handle_caps()
3138 mutex_unlock(&session->s_mutex); in ceph_handle_caps()