Lines Matching refs:inode
46 nfs_clear_verifier_delegated(delegation->inode);
96 struct nfs_delegation *nfs4_get_valid_delegation(const struct inode *inode)
100 delegation = rcu_dereference(NFS_I(inode)->delegation);
107 nfs4_do_check_delegation(struct inode *inode, fmode_t flags, bool mark)
114 delegation = rcu_dereference(NFS_I(inode)->delegation);
124 * nfs_have_delegation - check if inode has a delegation, mark it
126 * @inode: inode to check
129 * Returns one if inode has the indicated delegation, otherwise zero.
131 int nfs4_have_delegation(struct inode *inode, fmode_t flags)
133 return nfs4_do_check_delegation(inode, flags, true);
137 * nfs4_check_delegation - check if inode has a delegation, do not mark
140 int nfs4_check_delegation(struct inode *inode, fmode_t flags)
142 return nfs4_do_check_delegation(inode, flags, false);
147 struct inode *inode = state->inode;
149 struct file_lock_context *flctx = inode->i_flctx;
177 static int nfs_delegation_claim_opens(struct inode *inode,
180 struct nfs_inode *nfsi = NFS_I(inode);
223 * @inode: inode to process
230 void nfs_inode_reclaim_delegation(struct inode *inode, const struct cred *cred,
238 delegation = rcu_dereference(NFS_I(inode)->delegation);
253 trace_nfs4_reclaim_delegation(inode, type);
256 nfs_inode_set_delegation(inode, cred, type, stateid,
261 static int nfs_do_return_delegation(struct inode *inode, struct nfs_delegation *delegation, int issync)
270 res = nfs4_proc_delegreturn(inode, cred,
278 static struct inode *nfs_delegation_grab_inode(struct nfs_delegation *delegation)
280 struct inode *inode = NULL;
283 if (delegation->inode != NULL)
284 inode = igrab(delegation->inode);
285 if (!inode)
288 return inode;
349 if (!delegation->inode) {
354 delegation->inode = NULL;
373 nfs_inode_detach_delegation(struct inode *inode)
375 struct nfs_inode *nfsi = NFS_I(inode);
376 struct nfs_server *server = NFS_SERVER(inode);
419 * nfs_inode_set_delegation - set up a delegation on an inode
420 * @inode: inode to which delegation applies
428 int nfs_inode_set_delegation(struct inode *inode, const struct cred *cred,
433 struct nfs_server *server = NFS_SERVER(inode);
435 struct nfs_inode *nfsi = NFS_I(inode);
447 delegation->change_attr = inode_peek_iversion_raw(inode);
449 delegation->inode = inode;
497 trace_nfs4_set_delegation(inode, type);
499 spin_lock(&inode->i_lock);
500 if (NFS_I(inode)->cache_validity & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME))
501 NFS_I(inode)->cache_validity |= NFS_INO_REVAL_FORCED;
502 spin_unlock(&inode->i_lock);
508 nfs_do_return_delegation(inode, freeme, 0);
517 static int nfs_end_delegation_return(struct inode *inode, struct nfs_delegation *delegation, int issync)
519 struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;
527 err = nfs_delegation_claim_opens(inode, &delegation->stateid,
542 err = nfs_do_return_delegation(inode, delegation, issync);
556 struct inode *inode;
559 inode = delegation->inode;
560 if (inode && list_empty(&NFS_I(inode)->open_files))
579 struct inode *inode;
580 struct inode *place_holder = NULL;
587 * to an inode place_holder. Each time we restart, we
589 * of that inode.
603 struct inode *to_put = NULL;
614 struct inode *tmp = nfs_delegation_grab_inode(prev);
622 inode = nfs_delegation_grab_inode(delegation);
623 if (inode == NULL) {
628 delegation = nfs_start_delegation_return_locked(NFS_I(inode));
633 err = nfs_end_delegation_return(inode, delegation, 0);
634 iput(inode);
703 * @inode: inode to process
709 void nfs_inode_evict_delegation(struct inode *inode)
713 delegation = nfs_inode_detach_delegation(inode);
717 nfs_do_return_delegation(inode, delegation, 1);
724 * @inode: inode to process
732 int nfs4_inode_return_delegation(struct inode *inode)
734 struct nfs_inode *nfsi = NFS_I(inode);
738 nfs_wb_all(inode);
741 err = nfs_end_delegation_return(inode, delegation, 1);
747 * @inode: inode to process
750 * inode delegation needs to be returned immediately.
752 void nfs4_inode_return_delegation_on_close(struct inode *inode)
757 if (!inode)
760 delegation = nfs4_get_valid_delegation(inode);
766 if (delegation->inode &&
767 list_empty(&NFS_I(inode)->open_files) &&
775 nfs_clear_verifier_delegated(inode);
779 nfs_end_delegation_return(inode, ret, 0);
784 * @inode: pointer to inode
786 * Make the inode writeable by returning the delegation if necessary
790 int nfs4_inode_make_writeable(struct inode *inode)
795 delegation = nfs4_get_valid_delegation(inode);
797 (nfs4_has_session(NFS_SERVER(inode)->nfs_client) &&
803 return nfs4_inode_return_delegation(inode);
899 static void nfs_revoke_delegation(struct inode *inode,
907 delegation = rcu_dereference(NFS_I(inode)->delegation);
931 nfs_inode_find_state_and_recover(inode, stateid);
934 void nfs_remove_bad_delegation(struct inode *inode,
937 nfs_revoke_delegation(inode, stateid);
941 void nfs_delegation_mark_returned(struct inode *inode,
946 if (!inode)
950 delegation = rcu_dereference(NFS_I(inode)->delegation);
974 nfs_inode_find_state_and_recover(inode, stateid);
1019 * @inode: inode to process
1024 int nfs_async_inode_return_delegation(struct inode *inode,
1027 struct nfs_server *server = NFS_SERVER(inode);
1032 delegation = nfs4_get_valid_delegation(inode);
1048 static struct inode *
1054 struct inode *res = NULL;
1058 if (delegation->inode != NULL &&
1060 nfs_compare_fh(fhandle, &NFS_I(delegation->inode)->fh) == 0) {
1063 res = igrab(delegation->inode);
1081 * nfs_delegation_find_inode - retrieve the inode associated with a delegation
1085 * Returns pointer to inode matching "fhandle," or NULL if a matching inode
1088 struct inode *nfs_delegation_find_inode(struct nfs_client *clp,
1092 struct inode *res;
1140 struct inode *inode;
1152 inode = nfs_delegation_grab_inode(delegation);
1153 if (inode == NULL)
1155 delegation = nfs_start_delegation_return_locked(NFS_I(inode));
1158 if (nfs_detach_delegation(NFS_I(inode), delegation,
1164 iput(inode);
1201 struct inode *inode)
1206 delegation = rcu_dereference(NFS_I(inode)->delegation);
1251 nfs_delegation_test_free_expired(struct inode *inode,
1255 struct nfs_server *server = NFS_SERVER(inode);
1263 nfs_remove_bad_delegation(inode, stateid);
1270 struct inode *inode;
1284 inode = nfs_delegation_grab_inode(delegation);
1285 if (inode == NULL)
1293 nfs_delegation_test_free_expired(inode, &stateid, cred);
1296 iput(inode);
1300 nfs_inode_mark_test_expired_delegation(server,inode);
1301 iput(inode);
1323 void nfs_inode_find_delegation_state_and_recover(struct inode *inode,
1326 struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;
1331 delegation = rcu_dereference(NFS_I(inode)->delegation);
1335 nfs_mark_test_expired_delegation(NFS_SERVER(inode), delegation);
1368 * @inode: inode to check
1370 * Returns "true" and updates "dst->seqid" * if inode had a delegation
1373 bool nfs4_refresh_delegation_stateid(nfs4_stateid *dst, struct inode *inode)
1377 if (!inode)
1381 delegation = rcu_dereference(NFS_I(inode)->delegation);
1395 * nfs4_copy_delegation_stateid - Copy inode's state ID information
1396 * @inode: inode to check
1401 * Returns "true" and fills in "dst->data" * if inode had a delegation,
1404 bool nfs4_copy_delegation_stateid(struct inode *inode, fmode_t flags,
1407 struct nfs_inode *nfsi = NFS_I(inode);
1432 * @inode: inode to check
1438 bool nfs4_delegation_flush_on_close(const struct inode *inode)
1440 struct nfs_inode *nfsi = NFS_I(inode);