Lines Matching refs:table
39 IN const nfs41_slot_table *table) in slot_table_avail() argument
41 return table->num_used < table->max_slots; in slot_table_avail()
45 static void init_slot_table(nfs41_slot_table *table) in init_slot_table() argument
48 EnterCriticalSection(&table->lock); in init_slot_table()
49 table->max_slots = NFS41_MAX_NUM_SLOTS; in init_slot_table()
51 table->seq_nums[i] = 1; in init_slot_table()
52 table->used_slots[i] = 0; in init_slot_table()
54 table->highest_used = table->num_used = 0; in init_slot_table()
55 table->target_delay = 0; in init_slot_table()
58 if (slot_table_avail(table)) in init_slot_table()
59 WakeAllConditionVariable(&table->cond); in init_slot_table()
60 LeaveCriticalSection(&table->lock); in init_slot_table()
64 IN nfs41_slot_table *table, in resize_slot_table() argument
70 if (table->max_slots != target_highest_slotid + 1) { in resize_slot_table()
72 table->max_slots, target_highest_slotid + 1); in resize_slot_table()
73 table->max_slots = target_highest_slotid + 1; in resize_slot_table()
75 if (slot_table_avail(table)) in resize_slot_table()
76 WakeAllConditionVariable(&table->cond); in resize_slot_table()
85 nfs41_slot_table *table = &session->table; in nfs41_session_bump_seq() local
88 EnterCriticalSection(&table->lock); in nfs41_session_bump_seq()
91 table->seq_nums[slotid]++; in nfs41_session_bump_seq()
95 if (table->target_delay <= GetTickCount64()) in nfs41_session_bump_seq()
96 resize_slot_table(table, target_highest_slotid); in nfs41_session_bump_seq()
98 LeaveCriticalSection(&table->lock); in nfs41_session_bump_seq()
106 nfs41_slot_table *table = &session->table; in nfs41_session_free_slot() local
109 EnterCriticalSection(&table->lock); in nfs41_session_free_slot()
112 if (slotid < NFS41_MAX_NUM_SLOTS && table->used_slots[slotid]) { in nfs41_session_free_slot()
113 table->used_slots[slotid] = 0; in nfs41_session_free_slot()
114 table->num_used--; in nfs41_session_free_slot()
117 if (slotid == table->highest_used) { in nfs41_session_free_slot()
118 while (table->highest_used && !table->used_slots[table->highest_used]) in nfs41_session_free_slot()
119 table->highest_used--; in nfs41_session_free_slot()
122 slotid, table->num_used, table->highest_used); in nfs41_session_free_slot()
125 if (slot_table_avail(table)) in nfs41_session_free_slot()
126 WakeAllConditionVariable(&table->cond); in nfs41_session_free_slot()
128 LeaveCriticalSection(&table->lock); in nfs41_session_free_slot()
138 nfs41_slot_table *table = &session->table; in nfs41_session_get_slot() local
142 EnterCriticalSection(&table->lock); in nfs41_session_get_slot()
145 while (!slot_table_avail(table)) in nfs41_session_get_slot()
146 SleepConditionVariableCS(&table->cond, &table->lock, INFINITE); in nfs41_session_get_slot()
148 for (i = 0; i < table->max_slots; i++) { in nfs41_session_get_slot()
149 if (table->used_slots[i]) in nfs41_session_get_slot()
152 table->used_slots[i] = 1; in nfs41_session_get_slot()
153 table->num_used++; in nfs41_session_get_slot()
154 if (i > table->highest_used) in nfs41_session_get_slot()
155 table->highest_used = i; in nfs41_session_get_slot()
158 *seqid = table->seq_nums[i]; in nfs41_session_get_slot()
159 *highest = table->highest_used; in nfs41_session_get_slot()
162 LeaveCriticalSection(&table->lock); in nfs41_session_get_slot()
173 nfs41_slot_table *table = &session->table; in nfs41_session_recall_slot() local
176 EnterCriticalSection(&table->lock); in nfs41_session_recall_slot()
177 resize_slot_table(table, target_highest_slotid); in nfs41_session_recall_slot()
178 table->target_delay = GetTickCount64() + MAX_SLOTS_DELAY; in nfs41_session_recall_slot()
179 LeaveCriticalSection(&table->lock); in nfs41_session_recall_slot()
189 nfs41_slot_table *table = &session->table; in nfs41_session_bad_slot() local
198 EnterCriticalSection(&table->lock); in nfs41_session_bad_slot()
199 if (table->max_slots > args->sa_slotid) { in nfs41_session_bad_slot()
200 resize_slot_table(table, args->sa_slotid); in nfs41_session_bad_slot()
201 table->target_delay = GetTickCount64() + MAX_SLOTS_DELAY; in nfs41_session_bad_slot()
203 LeaveCriticalSection(&table->lock); in nfs41_session_bad_slot()
262 InitializeCriticalSection(&session->table.lock); in session_alloc()
263 InitializeConditionVariable(&session->table.cond); in session_alloc()
265 init_slot_table(&session->table); in session_alloc()
325 init_slot_table(&session->table); in nfs41_session_renew()
378 DeleteCriticalSection(&session->table.lock); in nfs41_session_free()