Lines Matching refs:dp
807 struct nfs4_delegation *dp; in alloc_init_deleg() local
816 dp = delegstateid(nfs4_alloc_stid(clp, deleg_slab, nfs4_free_deleg)); in alloc_init_deleg()
817 if (dp == NULL) in alloc_init_deleg()
825 dp->dl_stid.sc_stateid.si_generation = 1; in alloc_init_deleg()
826 INIT_LIST_HEAD(&dp->dl_perfile); in alloc_init_deleg()
827 INIT_LIST_HEAD(&dp->dl_perclnt); in alloc_init_deleg()
828 INIT_LIST_HEAD(&dp->dl_recall_lru); in alloc_init_deleg()
829 dp->dl_clnt_odstate = odstate; in alloc_init_deleg()
831 dp->dl_type = NFS4_OPEN_DELEGATE_READ; in alloc_init_deleg()
832 dp->dl_retries = 1; in alloc_init_deleg()
833 nfsd4_init_cb(&dp->dl_recall, dp->dl_stid.sc_client, in alloc_init_deleg()
835 return dp; in alloc_init_deleg()
937 hash_delegation_locked(struct nfs4_delegation *dp, struct nfs4_file *fp) in hash_delegation_locked() argument
940 struct nfs4_client *clp = dp->dl_stid.sc_client; in hash_delegation_locked()
949 atomic_inc(&dp->dl_stid.sc_count); in hash_delegation_locked()
950 dp->dl_stid.sc_type = NFS4_DELEG_STID; in hash_delegation_locked()
951 list_add(&dp->dl_perfile, &fp->fi_delegations); in hash_delegation_locked()
952 list_add(&dp->dl_perclnt, &clp->cl_delegations); in hash_delegation_locked()
957 unhash_delegation_locked(struct nfs4_delegation *dp) in unhash_delegation_locked() argument
959 struct nfs4_file *fp = dp->dl_stid.sc_file; in unhash_delegation_locked()
963 if (list_empty(&dp->dl_perfile)) in unhash_delegation_locked()
966 dp->dl_stid.sc_type = NFS4_CLOSED_DELEG_STID; in unhash_delegation_locked()
968 ++dp->dl_time; in unhash_delegation_locked()
970 list_del_init(&dp->dl_perclnt); in unhash_delegation_locked()
971 list_del_init(&dp->dl_recall_lru); in unhash_delegation_locked()
972 list_del_init(&dp->dl_perfile); in unhash_delegation_locked()
977 static void destroy_delegation(struct nfs4_delegation *dp) in destroy_delegation() argument
982 unhashed = unhash_delegation_locked(dp); in destroy_delegation()
985 put_clnt_odstate(dp->dl_clnt_odstate); in destroy_delegation()
986 nfs4_put_deleg_lease(dp->dl_stid.sc_file); in destroy_delegation()
987 nfs4_put_stid(&dp->dl_stid); in destroy_delegation()
991 static void revoke_delegation(struct nfs4_delegation *dp) in revoke_delegation() argument
993 struct nfs4_client *clp = dp->dl_stid.sc_client; in revoke_delegation()
995 WARN_ON(!list_empty(&dp->dl_recall_lru)); in revoke_delegation()
997 put_clnt_odstate(dp->dl_clnt_odstate); in revoke_delegation()
998 nfs4_put_deleg_lease(dp->dl_stid.sc_file); in revoke_delegation()
1001 nfs4_put_stid(&dp->dl_stid); in revoke_delegation()
1003 dp->dl_stid.sc_type = NFS4_REVOKED_DELEG_STID; in revoke_delegation()
1005 list_add(&dp->dl_recall_lru, &clp->cl_revoked); in revoke_delegation()
1895 struct nfs4_delegation *dp; in __destroy_client() local
1901 dp = list_entry(clp->cl_delegations.next, struct nfs4_delegation, dl_perclnt); in __destroy_client()
1902 WARN_ON(!unhash_delegation_locked(dp)); in __destroy_client()
1903 list_add(&dp->dl_recall_lru, &reaplist); in __destroy_client()
1907 dp = list_entry(reaplist.next, struct nfs4_delegation, dl_recall_lru); in __destroy_client()
1908 list_del_init(&dp->dl_recall_lru); in __destroy_client()
1909 put_clnt_odstate(dp->dl_clnt_odstate); in __destroy_client()
1910 nfs4_put_deleg_lease(dp->dl_stid.sc_file); in __destroy_client()
1911 nfs4_put_stid(&dp->dl_stid); in __destroy_client()
1914 dp = list_entry(clp->cl_revoked.next, struct nfs4_delegation, dl_recall_lru); in __destroy_client()
1915 list_del_init(&dp->dl_recall_lru); in __destroy_client()
1916 nfs4_put_stid(&dp->dl_stid); in __destroy_client()
3868 struct nfs4_delegation *dp = cb_to_delegation(cb); in nfsd4_cb_recall_prepare() local
3869 struct nfsd_net *nn = net_generic(dp->dl_stid.sc_client->net, in nfsd4_cb_recall_prepare()
3872 block_delegations(&dp->dl_stid.sc_file->fi_fhandle); in nfsd4_cb_recall_prepare()
3882 if (dp->dl_time == 0) { in nfsd4_cb_recall_prepare()
3883 dp->dl_time = get_seconds(); in nfsd4_cb_recall_prepare()
3884 list_add_tail(&dp->dl_recall_lru, &nn->del_recall_lru); in nfsd4_cb_recall_prepare()
3892 struct nfs4_delegation *dp = cb_to_delegation(cb); in nfsd4_cb_recall_done() local
3894 if (dp->dl_stid.sc_type == NFS4_CLOSED_DELEG_STID) in nfsd4_cb_recall_done()
3906 if (dp->dl_retries--) { in nfsd4_cb_recall_done()
3918 struct nfs4_delegation *dp = cb_to_delegation(cb); in nfsd4_cb_recall_release() local
3920 nfs4_put_stid(&dp->dl_stid); in nfsd4_cb_recall_release()
3929 static void nfsd_break_one_deleg(struct nfs4_delegation *dp) in nfsd_break_one_deleg() argument
3938 atomic_inc(&dp->dl_stid.sc_count); in nfsd_break_one_deleg()
3939 nfsd4_run_cb(&dp->dl_recall); in nfsd_break_one_deleg()
3948 struct nfs4_delegation *dp; in nfsd_break_deleg_cb() local
3974 list_for_each_entry(dp, &fp->fi_delegations, dl_perfile) in nfsd_break_deleg_cb()
3975 nfsd_break_one_deleg(dp); in nfsd_break_deleg_cb()
4104 nfs4_check_delegmode(struct nfs4_delegation *dp, int flags) in nfs4_check_delegmode() argument
4106 if ((flags & WR_STATE) && (dp->dl_type == NFS4_OPEN_DELEGATE_READ)) in nfs4_check_delegmode()
4136 struct nfs4_delegation **dp) in nfs4_check_deleg() argument
4157 *dp = deleg; in nfs4_check_deleg()
4327 static int nfs4_setlease(struct nfs4_delegation *dp) in nfs4_setlease() argument
4329 struct nfs4_file *fp = dp->dl_stid.sc_file; in nfs4_setlease()
4358 status = hash_delegation_locked(dp, fp); in nfs4_setlease()
4363 status = hash_delegation_locked(dp, fp); in nfs4_setlease()
4385 struct nfs4_delegation *dp; in nfs4_set_delegation() local
4399 dp = alloc_init_deleg(clp, fh, odstate); in nfs4_set_delegation()
4400 if (!dp) in nfs4_set_delegation()
4406 dp->dl_stid.sc_file = fp; in nfs4_set_delegation()
4410 status = nfs4_setlease(dp); in nfs4_set_delegation()
4417 status = hash_delegation_locked(dp, fp); in nfs4_set_delegation()
4423 put_clnt_odstate(dp->dl_clnt_odstate); in nfs4_set_delegation()
4424 nfs4_put_stid(&dp->dl_stid); in nfs4_set_delegation()
4427 return dp; in nfs4_set_delegation()
4461 struct nfs4_delegation *dp; in nfs4_open_delegation() local
4502 dp = nfs4_set_delegation(clp, fh, stp->st_stid.sc_file, stp->st_clnt_odstate); in nfs4_open_delegation()
4503 if (IS_ERR(dp)) in nfs4_open_delegation()
4506 memcpy(&open->op_delegate_stateid, &dp->dl_stid.sc_stateid, sizeof(dp->dl_stid.sc_stateid)); in nfs4_open_delegation()
4509 STATEID_VAL(&dp->dl_stid.sc_stateid)); in nfs4_open_delegation()
4511 nfs4_put_stid(&dp->dl_stid); in nfs4_open_delegation()
4528 struct nfs4_delegation *dp) in nfsd4_deleg_xgrade_none_ext() argument
4531 dp->dl_type == NFS4_OPEN_DELEGATE_WRITE) { in nfsd4_deleg_xgrade_none_ext()
4535 dp->dl_type == NFS4_OPEN_DELEGATE_WRITE) { in nfsd4_deleg_xgrade_none_ext()
4552 struct nfs4_delegation *dp = NULL; in nfsd4_process_open2() local
4563 status = nfs4_check_deleg(cl, open, &dp); in nfsd4_process_open2()
4631 if (open->op_delegate_type == NFS4_OPEN_DELEGATE_NONE && dp && in nfsd4_process_open2()
4633 nfsd4_deleg_xgrade_none_ext(open, dp); in nfsd4_process_open2()
4648 if (dp) in nfsd4_process_open2()
4649 nfs4_put_stid(&dp->dl_stid); in nfsd4_process_open2()
4735 struct nfs4_delegation *dp; in nfs4_laundromat() local
4770 dp = list_entry (pos, struct nfs4_delegation, dl_recall_lru); in nfs4_laundromat()
4771 if (time_after((unsigned long)dp->dl_time, (unsigned long)cutoff)) { in nfs4_laundromat()
4772 t = dp->dl_time - cutoff; in nfs4_laundromat()
4776 WARN_ON(!unhash_delegation_locked(dp)); in nfs4_laundromat()
4777 list_add(&dp->dl_recall_lru, &reaplist); in nfs4_laundromat()
4781 dp = list_first_entry(&reaplist, struct nfs4_delegation, in nfs4_laundromat()
4783 list_del_init(&dp->dl_recall_lru); in nfs4_laundromat()
4784 revoke_delegation(dp); in nfs4_laundromat()
5227 struct nfs4_delegation *dp; in nfsd4_free_stateid() local
5251 dp = delegstateid(s); in nfsd4_free_stateid()
5252 list_del_init(&dp->dl_recall_lru); in nfsd4_free_stateid()
5525 struct nfs4_delegation *dp; in nfsd4_delegreturn() local
5537 dp = delegstateid(s); in nfsd4_delegreturn()
5538 status = check_stateid_generation(stateid, &dp->dl_stid.sc_stateid, nfsd4_has_session(cstate)); in nfsd4_delegreturn()
5542 destroy_delegation(dp); in nfsd4_delegreturn()
5544 nfs4_put_stid(&dp->dl_stid); in nfsd4_delegreturn()
6877 struct nfs4_delegation *dp, *next; in nfsd_find_all_delegations() local
6885 list_for_each_entry_safe(dp, next, &clp->cl_delegations, dl_perclnt) { in nfsd_find_all_delegations()
6893 if (dp->dl_time != 0) in nfsd_find_all_delegations()
6897 WARN_ON(!unhash_delegation_locked(dp)); in nfsd_find_all_delegations()
6898 list_add(&dp->dl_recall_lru, victims); in nfsd_find_all_delegations()
6947 struct nfs4_delegation *dp, *next; in nfsd_forget_delegations() local
6949 list_for_each_entry_safe(dp, next, reaplist, dl_recall_lru) { in nfsd_forget_delegations()
6950 list_del_init(&dp->dl_recall_lru); in nfsd_forget_delegations()
6951 clp = dp->dl_stid.sc_client; in nfsd_forget_delegations()
6952 revoke_delegation(dp); in nfsd_forget_delegations()
7007 struct nfs4_delegation *dp, *next; in nfsd_recall_delegations() local
7009 list_for_each_entry_safe(dp, next, reaplist, dl_recall_lru) { in nfsd_recall_delegations()
7010 list_del_init(&dp->dl_recall_lru); in nfsd_recall_delegations()
7011 clp = dp->dl_stid.sc_client; in nfsd_recall_delegations()
7019 dp->dl_time = 0; in nfsd_recall_delegations()
7021 nfsd_break_one_deleg(dp); in nfsd_recall_delegations()
7224 struct nfs4_delegation *dp = NULL; in nfs4_state_shutdown_net() local
7234 dp = list_entry (pos, struct nfs4_delegation, dl_recall_lru); in nfs4_state_shutdown_net()
7235 WARN_ON(!unhash_delegation_locked(dp)); in nfs4_state_shutdown_net()
7236 list_add(&dp->dl_recall_lru, &reaplist); in nfs4_state_shutdown_net()
7240 dp = list_entry (pos, struct nfs4_delegation, dl_recall_lru); in nfs4_state_shutdown_net()
7241 list_del_init(&dp->dl_recall_lru); in nfs4_state_shutdown_net()
7242 put_clnt_odstate(dp->dl_clnt_odstate); in nfs4_state_shutdown_net()
7243 nfs4_put_deleg_lease(dp->dl_stid.sc_file); in nfs4_state_shutdown_net()
7244 nfs4_put_stid(&dp->dl_stid); in nfs4_state_shutdown_net()