Lines Matching refs:cursor
979 q2cursor_check(struct ulfsq2_cursor *cursor) in q2cursor_check() argument
981 if (cursor->q2c_magic != Q2C_MAGIC) { in q2cursor_check()
984 if (cursor->q2c_hashsize < 0) { in q2cursor_check()
988 if (cursor->q2c_users_done != 0 && cursor->q2c_users_done != 1) { in q2cursor_check()
991 if (cursor->q2c_groups_done != 0 && cursor->q2c_groups_done != 1) { in q2cursor_check()
994 if (cursor->q2c_defaults_done != 0 && cursor->q2c_defaults_done != 1) { in q2cursor_check()
997 if (cursor->q2c_hashpos < 0 || cursor->q2c_uidpos < 0) { in q2cursor_check()
1000 if (cursor->q2c_blocks_done != 0 && cursor->q2c_blocks_done != 1) { in q2cursor_check()
1051 q2cursor_pickidtype(struct ulfsq2_cursor *cursor, int *idtype_ret) in q2cursor_pickidtype() argument
1053 if (cursor->q2c_users_done == 0) { in q2cursor_pickidtype()
1055 } else if (cursor->q2c_groups_done == 0) { in q2cursor_pickidtype()
1122 q2cursor_getkeys(struct ulfsmount *ump, int idtype, struct ulfsq2_cursor *cursor, in q2cursor_getkeys() argument
1148 if (cursor->q2c_hashsize == 0) { in q2cursor_getkeys()
1149 cursor->q2c_hashsize = quota2_hash_size; in q2cursor_getkeys()
1150 } else if (cursor->q2c_hashsize != quota2_hash_size) { in q2cursor_getkeys()
1159 if (cursor->q2c_defaults_done == 0) { in q2cursor_getkeys()
1163 cursor->q2c_defaults_done = 1; in q2cursor_getkeys()
1171 if (cursor->q2c_hashpos >= quota2_hash_size) { in q2cursor_getkeys()
1177 gi.skip = cursor->q2c_uidpos; in q2cursor_getkeys()
1181 offset = q2h->q2h_entries[cursor->q2c_hashpos]; in q2cursor_getkeys()
1191 cursor->q2c_uidpos = gi.new_skip; in q2cursor_getkeys()
1194 KASSERT(cursor->q2c_uidpos > 0); in q2cursor_getkeys()
1195 cursor->q2c_uidpos--; in q2cursor_getkeys()
1201 cursor->q2c_uidpos = 0; in q2cursor_getkeys()
1202 cursor->q2c_hashpos++; in q2cursor_getkeys()
1278 struct ulfsq2_cursor *cursor; in lfsquota2_handle_cmd_cursorget() local
1288 cursor = Q2CURSOR(qkc); in lfsquota2_handle_cmd_cursorget()
1289 error = q2cursor_check(cursor); in lfsquota2_handle_cmd_cursorget()
1309 if (cursor->q2c_users_done == 0 && in lfsquota2_handle_cmd_cursorget()
1311 cursor->q2c_users_done = 1; in lfsquota2_handle_cmd_cursorget()
1313 if (cursor->q2c_groups_done == 0 && in lfsquota2_handle_cmd_cursorget()
1315 cursor->q2c_groups_done = 1; in lfsquota2_handle_cmd_cursorget()
1322 error = q2cursor_pickidtype(cursor, &idtype); in lfsquota2_handle_cmd_cursorget()
1336 cursor->q2c_blocks_done); in lfsquota2_handle_cmd_cursorget()
1337 newcursor = *cursor; in lfsquota2_handle_cmd_cursorget()
1359 cursor->q2c_users_done = 1; in lfsquota2_handle_cmd_cursorget()
1361 cursor->q2c_groups_done = 1; in lfsquota2_handle_cmd_cursorget()
1364 cursor->q2c_hashsize = 0; in lfsquota2_handle_cmd_cursorget()
1365 cursor->q2c_defaults_done = 0; in lfsquota2_handle_cmd_cursorget()
1366 cursor->q2c_hashpos = 0; in lfsquota2_handle_cmd_cursorget()
1367 cursor->q2c_uidpos = 0; in lfsquota2_handle_cmd_cursorget()
1368 cursor->q2c_blocks_done = 0; in lfsquota2_handle_cmd_cursorget()
1370 *cursor = newcursor; in lfsquota2_handle_cmd_cursorget()
1371 cursor->q2c_blocks_done = state.skiplast; in lfsquota2_handle_cmd_cursorget()
1391 struct ulfsq2_cursor *cursor; in lfsquota2_handle_cmd_cursoropen() local
1393 CTASSERT(sizeof(*cursor) <= sizeof(qkc->u.qkc_space)); in lfsquota2_handle_cmd_cursoropen()
1394 cursor = Q2CURSOR(qkc); in lfsquota2_handle_cmd_cursoropen()
1396 cursor->q2c_magic = Q2C_MAGIC; in lfsquota2_handle_cmd_cursoropen()
1397 cursor->q2c_hashsize = 0; in lfsquota2_handle_cmd_cursoropen()
1399 cursor->q2c_users_done = 0; in lfsquota2_handle_cmd_cursoropen()
1400 cursor->q2c_groups_done = 0; in lfsquota2_handle_cmd_cursoropen()
1401 cursor->q2c_defaults_done = 0; in lfsquota2_handle_cmd_cursoropen()
1402 cursor->q2c_hashpos = 0; in lfsquota2_handle_cmd_cursoropen()
1403 cursor->q2c_uidpos = 0; in lfsquota2_handle_cmd_cursoropen()
1404 cursor->q2c_blocks_done = 0; in lfsquota2_handle_cmd_cursoropen()
1411 struct ulfsq2_cursor *cursor; in lfsquota2_handle_cmd_cursorclose() local
1414 cursor = Q2CURSOR(qkc); in lfsquota2_handle_cmd_cursorclose()
1415 error = q2cursor_check(cursor); in lfsquota2_handle_cmd_cursorclose()
1429 struct ulfsq2_cursor *cursor; in lfsquota2_handle_cmd_cursorskipidtype() local
1432 cursor = Q2CURSOR(qkc); in lfsquota2_handle_cmd_cursorskipidtype()
1433 error = q2cursor_check(cursor); in lfsquota2_handle_cmd_cursorskipidtype()
1440 cursor->q2c_users_done = 1; in lfsquota2_handle_cmd_cursorskipidtype()
1443 cursor->q2c_groups_done = 1; in lfsquota2_handle_cmd_cursorskipidtype()
1456 struct ulfsq2_cursor *cursor; in lfsquota2_handle_cmd_cursoratend() local
1459 cursor = Q2CURSOR(qkc); in lfsquota2_handle_cmd_cursoratend()
1460 error = q2cursor_check(cursor); in lfsquota2_handle_cmd_cursoratend()
1465 *ret = (cursor->q2c_users_done && cursor->q2c_groups_done); in lfsquota2_handle_cmd_cursoratend()
1472 struct ulfsq2_cursor *cursor; in lfsquota2_handle_cmd_cursorrewind() local
1475 cursor = Q2CURSOR(qkc); in lfsquota2_handle_cmd_cursorrewind()
1476 error = q2cursor_check(cursor); in lfsquota2_handle_cmd_cursorrewind()
1481 cursor->q2c_hashsize = 0; in lfsquota2_handle_cmd_cursorrewind()
1483 cursor->q2c_users_done = 0; in lfsquota2_handle_cmd_cursorrewind()
1484 cursor->q2c_groups_done = 0; in lfsquota2_handle_cmd_cursorrewind()
1485 cursor->q2c_defaults_done = 0; in lfsquota2_handle_cmd_cursorrewind()
1486 cursor->q2c_hashpos = 0; in lfsquota2_handle_cmd_cursorrewind()
1487 cursor->q2c_uidpos = 0; in lfsquota2_handle_cmd_cursorrewind()
1488 cursor->q2c_blocks_done = 0; in lfsquota2_handle_cmd_cursorrewind()