Lines Matching full:delegation
60 #include "delegation.h"
1370 /* Want no delegation if we're using O_DIRECT */ in nfs4_map_atomic_open_share()
1588 static int can_open_delegated(struct nfs_delegation *delegation, fmode_t fmode, in can_open_delegated() argument
1591 if (delegation == NULL) in can_open_delegated()
1593 if ((delegation->type & fmode) != fmode) in can_open_delegated()
1600 if (!test_bit(NFS_DELEGATION_NEED_RECLAIM, &delegation->flags)) in can_open_delegated()
1606 nfs_mark_delegation_referenced(delegation); in can_open_delegated()
1860 const nfs4_stateid *delegation, in update_open_stateid() argument
1884 if (rcu_dereference(nfsi->delegation) != deleg_cur || in update_open_stateid()
1889 if (delegation == NULL) in update_open_stateid()
1890 delegation = &deleg_cur->stateid; in update_open_stateid()
1891 else if (!nfs4_stateid_match_other(&deleg_cur->stateid, delegation)) in update_open_stateid()
1934 struct nfs_delegation *delegation; in nfs4_return_incompatible_delegation() local
1938 delegation = nfs4_get_valid_delegation(inode); in nfs4_return_incompatible_delegation()
1939 if (delegation == NULL || (delegation->type & fmode) == fmode) { in nfs4_return_incompatible_delegation()
1950 struct nfs_delegation *delegation; in nfs4_try_open_cached() local
1966 delegation = nfs4_get_valid_delegation(state->inode); in nfs4_try_open_cached()
1967 if (!can_open_delegated(delegation, fmode, claim)) { in nfs4_try_open_cached()
1971 /* Save the delegation */ in nfs4_try_open_cached()
1972 nfs4_stateid_copy(&stateid, &delegation->stateid); in nfs4_try_open_cached()
1982 /* Try to update the stateid using the delegation */ in nfs4_try_open_cached()
1996 const struct nfs4_open_delegation *delegation) in nfs4_process_delegation() argument
1998 switch (delegation->open_delegation_type) { in nfs4_process_delegation()
2011 "returning a delegation for " in nfs4_process_delegation()
2016 nfs_inode_reclaim_delegation(inode, cred, delegation->type, in nfs4_process_delegation()
2017 &delegation->stateid, in nfs4_process_delegation()
2018 delegation->pagemod_limit, in nfs4_process_delegation()
2019 delegation->open_delegation_type); in nfs4_process_delegation()
2022 nfs_inode_set_delegation(inode, cred, delegation->type, in nfs4_process_delegation()
2023 &delegation->stateid, in nfs4_process_delegation()
2024 delegation->pagemod_limit, in nfs4_process_delegation()
2025 delegation->open_delegation_type); in nfs4_process_delegation()
2027 if (delegation->do_recall) in nfs4_process_delegation()
2028 nfs_async_inode_return_delegation(inode, &delegation->stateid); in nfs4_process_delegation()
2055 &data->o_res.delegation); in _nfs4_opendata_reclaim_to_nfs4_state()
2128 &data->o_res.delegation); in _nfs4_opendata_to_nfs4_state()
2270 struct nfs_delegation *delegation; in _nfs4_do_open_reclaim() local
2280 delegation = rcu_dereference(NFS_I(state->inode)->delegation); in _nfs4_do_open_reclaim()
2281 if (delegation != NULL && test_bit(NFS_DELEGATION_NEED_RECLAIM, &delegation->flags) != 0) { in _nfs4_do_open_reclaim()
2282 switch(delegation->type) { in _nfs4_do_open_reclaim()
2285 if (test_bit(NFS_DELEGATION_DELEGTIME, &delegation->flags)) in _nfs4_do_open_reclaim()
2291 if (test_bit(NFS_DELEGATION_DELEGTIME, &delegation->flags)) in _nfs4_do_open_reclaim()
2355 /* Don't recall a delegation if it was lost */ in nfs4_handle_delegation_recall_error()
2400 nfs4_stateid_copy(&opendata->o_arg.u.delegation, stateid); in nfs4_open_delegation_recall()
2522 * a delegation instead. in nfs4_open_prepare()
2525 struct nfs_delegation *delegation; in nfs4_open_prepare() local
2531 delegation = nfs4_get_valid_delegation(data->state->inode); in nfs4_open_prepare()
2532 if (can_open_delegated(delegation, data->o_arg.fmode, claim)) in nfs4_open_prepare()
2818 * We're not recovering a delegation, so ask for no delegation. in _nfs4_open_expired()
2820 * delegation return. in _nfs4_open_expired()
2876 if (rcu_access_pointer(NFS_I(state->inode)->delegation) != NULL) in nfs40_clear_delegation_stateid()
2882 /* NFSv4.0 doesn't allow for delegation recovery on open expire */ in nfs40_open_expired()
2931 struct nfs_delegation *delegation; in nfs41_check_delegation_stateid() local
2935 /* Get the delegation credential for use by test/free_stateid */ in nfs41_check_delegation_stateid()
2937 delegation = rcu_dereference(NFS_I(state->inode)->delegation); in nfs41_check_delegation_stateid()
2938 if (delegation == NULL) { in nfs41_check_delegation_stateid()
2944 spin_lock(&delegation->lock); in nfs41_check_delegation_stateid()
2945 nfs4_stateid_copy(&stateid, &delegation->stateid); in nfs41_check_delegation_stateid()
2948 &delegation->flags)) { in nfs41_check_delegation_stateid()
2949 spin_unlock(&delegation->lock); in nfs41_check_delegation_stateid()
2954 if (delegation->cred) in nfs41_check_delegation_stateid()
2955 cred = get_cred(delegation->cred); in nfs41_check_delegation_stateid()
2956 spin_unlock(&delegation->lock); in nfs41_check_delegation_stateid()
3175 if (opendata->o_res.delegation.type != 0) in _nfs4_open_and_get_state()
3364 /* We must have found a delegation */ in nfs4_do_open()
5712 * a delegation in nfs4_write_need_cache_consistency_data()
6826 struct nfs_delegation *delegation, in _nfs4_proc_delegreturn() argument
6879 if (delegation && in _nfs4_proc_delegreturn()
6880 test_bit(NFS_DELEGATION_DELEGTIME, &delegation->flags)) { in _nfs4_proc_delegreturn()
6881 if (delegation->type & FMODE_READ) { in _nfs4_proc_delegreturn()
6885 if (delegation->type & FMODE_WRITE) { in _nfs4_proc_delegreturn()
6919 struct nfs_delegation *delegation, int issync) in nfs4_proc_delegreturn() argument
6926 delegation, issync); in nfs4_proc_delegreturn()
7582 /* ...but avoid races with delegation recall... */ in _nfs4_proc_setlk()
7781 /* No delegation, no lease */ in nfs4_add_lease()
7787 /* We raced with a delegation return */ in nfs4_add_lease()