• Home
  • Raw
  • Download

Lines Matching refs:sp

161 	struct nfs4_state_owner *sp;  in nfs4_get_renew_cred_server_locked()  local
167 sp = rb_entry(pos, struct nfs4_state_owner, so_server_node); in nfs4_get_renew_cred_server_locked()
168 if (list_empty(&sp->so_states)) in nfs4_get_renew_cred_server_locked()
170 cred = get_rpccred(sp->so_cred); in nfs4_get_renew_cred_server_locked()
360 struct nfs4_state_owner *sp; in nfs4_get_setclientid_cred_server() local
366 sp = rb_entry(pos, struct nfs4_state_owner, so_server_node); in nfs4_get_setclientid_cred_server()
367 cred = get_rpccred(sp->so_cred); in nfs4_get_setclientid_cred_server()
407 struct nfs4_state_owner *sp; in nfs4_find_state_owner_locked() local
411 sp = rb_entry(parent, struct nfs4_state_owner, so_server_node); in nfs4_find_state_owner_locked()
413 if (cred < sp->so_cred) in nfs4_find_state_owner_locked()
415 else if (cred > sp->so_cred) in nfs4_find_state_owner_locked()
418 if (!list_empty(&sp->so_lru)) in nfs4_find_state_owner_locked()
419 list_del_init(&sp->so_lru); in nfs4_find_state_owner_locked()
420 atomic_inc(&sp->so_count); in nfs4_find_state_owner_locked()
421 return sp; in nfs4_find_state_owner_locked()
433 struct nfs4_state_owner *sp; in nfs4_insert_state_owner_locked() local
438 sp = rb_entry(parent, struct nfs4_state_owner, so_server_node); in nfs4_insert_state_owner_locked()
440 if (new->so_cred < sp->so_cred) in nfs4_insert_state_owner_locked()
442 else if (new->so_cred > sp->so_cred) in nfs4_insert_state_owner_locked()
445 if (!list_empty(&sp->so_lru)) in nfs4_insert_state_owner_locked()
446 list_del_init(&sp->so_lru); in nfs4_insert_state_owner_locked()
447 atomic_inc(&sp->so_count); in nfs4_insert_state_owner_locked()
448 return sp; in nfs4_insert_state_owner_locked()
460 nfs4_remove_state_owner_locked(struct nfs4_state_owner *sp) in nfs4_remove_state_owner_locked() argument
462 struct nfs_server *server = sp->so_server; in nfs4_remove_state_owner_locked()
464 if (!RB_EMPTY_NODE(&sp->so_server_node)) in nfs4_remove_state_owner_locked()
465 rb_erase(&sp->so_server_node, &server->state_owners); in nfs4_remove_state_owner_locked()
466 ida_remove(&server->openowner_id, sp->so_seqid.owner_id); in nfs4_remove_state_owner_locked()
496 struct nfs4_state_owner *sp; in nfs4_alloc_state_owner() local
498 sp = kzalloc(sizeof(*sp), gfp_flags); in nfs4_alloc_state_owner()
499 if (!sp) in nfs4_alloc_state_owner()
501 sp->so_server = server; in nfs4_alloc_state_owner()
502 sp->so_cred = get_rpccred(cred); in nfs4_alloc_state_owner()
503 spin_lock_init(&sp->so_lock); in nfs4_alloc_state_owner()
504 INIT_LIST_HEAD(&sp->so_states); in nfs4_alloc_state_owner()
505 nfs4_init_seqid_counter(&sp->so_seqid); in nfs4_alloc_state_owner()
506 atomic_set(&sp->so_count, 1); in nfs4_alloc_state_owner()
507 INIT_LIST_HEAD(&sp->so_lru); in nfs4_alloc_state_owner()
508 seqcount_init(&sp->so_reclaim_seqcount); in nfs4_alloc_state_owner()
509 mutex_init(&sp->so_delegreturn_mutex); in nfs4_alloc_state_owner()
510 return sp; in nfs4_alloc_state_owner()
514 nfs4_drop_state_owner(struct nfs4_state_owner *sp) in nfs4_drop_state_owner() argument
516 struct rb_node *rb_node = &sp->so_server_node; in nfs4_drop_state_owner()
519 struct nfs_server *server = sp->so_server; in nfs4_drop_state_owner()
531 static void nfs4_free_state_owner(struct nfs4_state_owner *sp) in nfs4_free_state_owner() argument
533 nfs4_destroy_seqid_counter(&sp->so_seqid); in nfs4_free_state_owner()
534 put_rpccred(sp->so_cred); in nfs4_free_state_owner()
535 kfree(sp); in nfs4_free_state_owner()
541 struct nfs4_state_owner *sp, *tmp; in nfs4_gc_state_owners() local
548 list_for_each_entry_safe(sp, tmp, &server->state_owners_lru, so_lru) { in nfs4_gc_state_owners()
550 if (time_in_range(sp->so_expires, time_min, time_max)) in nfs4_gc_state_owners()
552 list_move(&sp->so_lru, &doomed); in nfs4_gc_state_owners()
553 nfs4_remove_state_owner_locked(sp); in nfs4_gc_state_owners()
557 list_for_each_entry_safe(sp, tmp, &doomed, so_lru) { in nfs4_gc_state_owners()
558 list_del(&sp->so_lru); in nfs4_gc_state_owners()
559 nfs4_free_state_owner(sp); in nfs4_gc_state_owners()
575 struct nfs4_state_owner *sp, *new; in nfs4_get_state_owner() local
578 sp = nfs4_find_state_owner_locked(server, cred); in nfs4_get_state_owner()
580 if (sp != NULL) in nfs4_get_state_owner()
589 sp = nfs4_insert_state_owner_locked(new); in nfs4_get_state_owner()
591 } while (sp == ERR_PTR(-EAGAIN)); in nfs4_get_state_owner()
592 if (sp != new) in nfs4_get_state_owner()
596 return sp; in nfs4_get_state_owner()
611 void nfs4_put_state_owner(struct nfs4_state_owner *sp) in nfs4_put_state_owner() argument
613 struct nfs_server *server = sp->so_server; in nfs4_put_state_owner()
616 if (!atomic_dec_and_lock(&sp->so_count, &clp->cl_lock)) in nfs4_put_state_owner()
619 sp->so_expires = jiffies; in nfs4_put_state_owner()
620 list_add_tail(&sp->so_lru, &server->state_owners_lru); in nfs4_put_state_owner()
634 struct nfs4_state_owner *sp, *tmp; in nfs4_purge_state_owners() local
638 list_for_each_entry_safe(sp, tmp, &server->state_owners_lru, so_lru) { in nfs4_purge_state_owners()
639 list_move(&sp->so_lru, &doomed); in nfs4_purge_state_owners()
640 nfs4_remove_state_owner_locked(sp); in nfs4_purge_state_owners()
644 list_for_each_entry_safe(sp, tmp, &doomed, so_lru) { in nfs4_purge_state_owners()
645 list_del(&sp->so_lru); in nfs4_purge_state_owners()
646 nfs4_free_state_owner(sp); in nfs4_purge_state_owners()
1128 struct nfs4_state_owner *sp = container_of(seqid->sequence, in nfs_increment_open_seqid() local
1130 struct nfs_server *server = sp->so_server; in nfs_increment_open_seqid()
1133 nfs4_drop_state_owner(sp); in nfs_increment_open_seqid()
1417 static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs4_state_recovery_op… in nfs4_reclaim_open_state() argument
1431 spin_lock(&sp->so_lock); in nfs4_reclaim_open_state()
1432 write_seqcount_begin(&sp->so_reclaim_seqcount); in nfs4_reclaim_open_state()
1434 list_for_each_entry(state, &sp->so_states, open_states) { in nfs4_reclaim_open_state()
1442 spin_unlock(&sp->so_lock); in nfs4_reclaim_open_state()
1443 status = ops->recover_open(sp, state); in nfs4_reclaim_open_state()
1456 spin_lock(&sp->so_lock); in nfs4_reclaim_open_state()
1480 nfs4_state_mark_reclaim_nograce(sp->so_server->nfs_client, state); in nfs4_reclaim_open_state()
1484 nfs4_state_mark_reclaim_nograce(sp->so_server->nfs_client, state); in nfs4_reclaim_open_state()
1493 spin_lock(&sp->so_lock); in nfs4_reclaim_open_state()
1496 write_seqcount_end(&sp->so_reclaim_seqcount); in nfs4_reclaim_open_state()
1497 spin_unlock(&sp->so_lock); in nfs4_reclaim_open_state()
1501 spin_lock(&sp->so_lock); in nfs4_reclaim_open_state()
1502 write_seqcount_end(&sp->so_reclaim_seqcount); in nfs4_reclaim_open_state()
1503 spin_unlock(&sp->so_lock); in nfs4_reclaim_open_state()
1527 struct nfs4_state_owner *sp; in nfs4_reset_seqids() local
1535 sp = rb_entry(pos, struct nfs4_state_owner, so_server_node); in nfs4_reset_seqids()
1536 sp->so_seqid.flags = 0; in nfs4_reset_seqids()
1537 spin_lock(&sp->so_lock); in nfs4_reset_seqids()
1538 list_for_each_entry(state, &sp->so_states, open_states) { in nfs4_reset_seqids()
1542 spin_unlock(&sp->so_lock); in nfs4_reset_seqids()
1576 struct nfs4_state_owner *sp; in nfs4_clear_reclaim_server() local
1584 sp = rb_entry(pos, struct nfs4_state_owner, so_server_node); in nfs4_clear_reclaim_server()
1585 spin_lock(&sp->so_lock); in nfs4_clear_reclaim_server()
1586 list_for_each_entry(state, &sp->so_states, open_states) { in nfs4_clear_reclaim_server()
1592 spin_unlock(&sp->so_lock); in nfs4_clear_reclaim_server()
1677 struct nfs4_state_owner *sp; in nfs4_do_reclaim() local
1690 sp = rb_entry(pos, in nfs4_do_reclaim()
1693 &sp->so_flags)) in nfs4_do_reclaim()
1695 atomic_inc(&sp->so_count); in nfs4_do_reclaim()
1699 status = nfs4_reclaim_open_state(sp, ops); in nfs4_do_reclaim()
1701 set_bit(ops->owner_flag_bit, &sp->so_flags); in nfs4_do_reclaim()
1702 nfs4_put_state_owner(sp); in nfs4_do_reclaim()
1706 nfs4_put_state_owner(sp); in nfs4_do_reclaim()