Lines Matching full:delegation

60 #include "delegation.h"
1361 /* Want no delegation if we're using O_DIRECT */ in nfs4_map_atomic_open_share()
1579 static int can_open_delegated(struct nfs_delegation *delegation, fmode_t fmode, in can_open_delegated() argument
1582 if (delegation == NULL) in can_open_delegated()
1584 if ((delegation->type & fmode) != fmode) in can_open_delegated()
1591 if (!test_bit(NFS_DELEGATION_NEED_RECLAIM, &delegation->flags)) in can_open_delegated()
1597 nfs_mark_delegation_referenced(delegation); in can_open_delegated()
1851 const nfs4_stateid *delegation, in update_open_stateid() argument
1875 if (rcu_dereference(nfsi->delegation) != deleg_cur || in update_open_stateid()
1880 if (delegation == NULL) in update_open_stateid()
1881 delegation = &deleg_cur->stateid; in update_open_stateid()
1882 else if (!nfs4_stateid_match_other(&deleg_cur->stateid, delegation)) in update_open_stateid()
1925 struct nfs_delegation *delegation; in nfs4_return_incompatible_delegation() local
1929 delegation = nfs4_get_valid_delegation(inode); in nfs4_return_incompatible_delegation()
1930 if (delegation == NULL || (delegation->type & fmode) == fmode) { in nfs4_return_incompatible_delegation()
1941 struct nfs_delegation *delegation; in nfs4_try_open_cached() local
1957 delegation = nfs4_get_valid_delegation(state->inode); in nfs4_try_open_cached()
1958 if (!can_open_delegated(delegation, fmode, claim)) { in nfs4_try_open_cached()
1962 /* Save the delegation */ in nfs4_try_open_cached()
1963 nfs4_stateid_copy(&stateid, &delegation->stateid); in nfs4_try_open_cached()
1973 /* Try to update the stateid using the delegation */ in nfs4_try_open_cached()
1987 const struct nfs4_open_delegation *delegation) in nfs4_process_delegation() argument
1989 switch (delegation->open_delegation_type) { in nfs4_process_delegation()
2002 "returning a delegation for " in nfs4_process_delegation()
2007 nfs_inode_reclaim_delegation(inode, cred, delegation->type, in nfs4_process_delegation()
2008 &delegation->stateid, in nfs4_process_delegation()
2009 delegation->pagemod_limit, in nfs4_process_delegation()
2010 delegation->open_delegation_type); in nfs4_process_delegation()
2013 nfs_inode_set_delegation(inode, cred, delegation->type, in nfs4_process_delegation()
2014 &delegation->stateid, in nfs4_process_delegation()
2015 delegation->pagemod_limit, in nfs4_process_delegation()
2016 delegation->open_delegation_type); in nfs4_process_delegation()
2018 if (delegation->do_recall) in nfs4_process_delegation()
2019 nfs_async_inode_return_delegation(inode, &delegation->stateid); in nfs4_process_delegation()
2046 &data->o_res.delegation); in _nfs4_opendata_reclaim_to_nfs4_state()
2119 &data->o_res.delegation); in _nfs4_opendata_to_nfs4_state()
2261 struct nfs_delegation *delegation; in _nfs4_do_open_reclaim() local
2271 delegation = rcu_dereference(NFS_I(state->inode)->delegation); in _nfs4_do_open_reclaim()
2272 if (delegation != NULL && test_bit(NFS_DELEGATION_NEED_RECLAIM, &delegation->flags) != 0) { in _nfs4_do_open_reclaim()
2273 switch(delegation->type) { in _nfs4_do_open_reclaim()
2276 if (test_bit(NFS_DELEGATION_DELEGTIME, &delegation->flags)) in _nfs4_do_open_reclaim()
2282 if (test_bit(NFS_DELEGATION_DELEGTIME, &delegation->flags)) in _nfs4_do_open_reclaim()
2346 /* Don't recall a delegation if it was lost */ in nfs4_handle_delegation_recall_error()
2391 nfs4_stateid_copy(&opendata->o_arg.u.delegation, stateid); in nfs4_open_delegation_recall()
2513 * a delegation instead. in nfs4_open_prepare()
2516 struct nfs_delegation *delegation; in nfs4_open_prepare() local
2522 delegation = nfs4_get_valid_delegation(data->state->inode); in nfs4_open_prepare()
2523 if (can_open_delegated(delegation, data->o_arg.fmode, claim)) in nfs4_open_prepare()
2807 * We're not recovering a delegation, so ask for no delegation. in _nfs4_open_expired()
2809 * delegation return. in _nfs4_open_expired()
2865 if (rcu_access_pointer(NFS_I(state->inode)->delegation) != NULL) in nfs40_clear_delegation_stateid()
2871 /* NFSv4.0 doesn't allow for delegation recovery on open expire */ in nfs40_open_expired()
2920 struct nfs_delegation *delegation; in nfs41_check_delegation_stateid() local
2924 /* Get the delegation credential for use by test/free_stateid */ in nfs41_check_delegation_stateid()
2926 delegation = rcu_dereference(NFS_I(state->inode)->delegation); in nfs41_check_delegation_stateid()
2927 if (delegation == NULL) { in nfs41_check_delegation_stateid()
2933 spin_lock(&delegation->lock); in nfs41_check_delegation_stateid()
2934 nfs4_stateid_copy(&stateid, &delegation->stateid); in nfs41_check_delegation_stateid()
2937 &delegation->flags)) { in nfs41_check_delegation_stateid()
2938 spin_unlock(&delegation->lock); in nfs41_check_delegation_stateid()
2943 if (delegation->cred) in nfs41_check_delegation_stateid()
2944 cred = get_cred(delegation->cred); in nfs41_check_delegation_stateid()
2945 spin_unlock(&delegation->lock); in nfs41_check_delegation_stateid()
3164 if (opendata->o_res.delegation.type != 0) in _nfs4_open_and_get_state()
3353 /* We must have found a delegation */ in nfs4_do_open()
5698 * a delegation in nfs4_write_need_cache_consistency_data()
6812 struct nfs_delegation *delegation, in _nfs4_proc_delegreturn() argument
6865 if (delegation && in _nfs4_proc_delegreturn()
6866 test_bit(NFS_DELEGATION_DELEGTIME, &delegation->flags)) { in _nfs4_proc_delegreturn()
6867 if (delegation->type & FMODE_READ) { in _nfs4_proc_delegreturn()
6871 if (delegation->type & FMODE_WRITE) { in _nfs4_proc_delegreturn()
6905 struct nfs_delegation *delegation, int issync) in nfs4_proc_delegreturn() argument
6912 delegation, issync); in nfs4_proc_delegreturn()
7568 /* ...but avoid races with delegation recall... */ in _nfs4_proc_setlk()
7767 /* No delegation, no lease */ in nfs4_add_lease()
7773 /* We raced with a delegation return */ in nfs4_add_lease()