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 * nfs4_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 = locks_inode_context(inode);
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;
496 spin_lock(&inode->i_lock);
497 if (NFS_I(inode)->cache_validity & NFS_INO_INVALID_CHANGE)
498 nfs_set_cache_invalid(inode,
505 spin_unlock(&inode->i_lock);
513 trace_nfs4_set_delegation(inode, type);
519 nfs_do_return_delegation(inode, freeme, 0);
528 static int nfs_end_delegation_return(struct inode *inode, struct nfs_delegation *delegation, int issync)
530 struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;
540 err = break_lease(inode, mode);
545 err = nfs_delegation_claim_opens(inode, &delegation->stateid,
560 err = nfs_do_return_delegation(inode, delegation, issync);
574 struct inode *inode;
577 inode = delegation->inode;
578 if (inode && list_empty(&NFS_I(inode)->open_files))
597 struct inode *inode;
598 struct inode *place_holder = NULL;
605 * to an inode place_holder. Each time we restart, we
607 * of that inode.
621 struct inode *to_put = NULL;
632 struct inode *tmp = nfs_delegation_grab_inode(prev);
640 inode = nfs_delegation_grab_inode(delegation);
641 if (inode == NULL) {
646 delegation = nfs_start_delegation_return_locked(NFS_I(inode));
651 err = nfs_end_delegation_return(inode, delegation, 0);
652 iput(inode);
721 * @inode: inode to process
727 void nfs_inode_evict_delegation(struct inode *inode)
731 delegation = nfs_inode_detach_delegation(inode);
735 nfs_do_return_delegation(inode, delegation, 1);
742 * @inode: inode to process
750 int nfs4_inode_return_delegation(struct inode *inode)
752 struct nfs_inode *nfsi = NFS_I(inode);
758 break_lease(inode, O_WRONLY | O_RDWR);
759 if (S_ISREG(inode->i_mode))
760 nfs_wb_all(inode);
761 return nfs_end_delegation_return(inode, delegation, 1);
768 * @inode: inode to process
771 * inode delegation needs to be returned immediately.
773 void nfs4_inode_return_delegation_on_close(struct inode *inode)
778 if (!inode)
781 delegation = nfs4_get_valid_delegation(inode);
787 if (delegation->inode &&
788 list_empty(&NFS_I(inode)->open_files) &&
796 nfs_clear_verifier_delegated(inode);
800 nfs_end_delegation_return(inode, ret, 0);
805 * @inode: pointer to inode
807 * Make the inode writeable by returning the delegation if necessary
811 int nfs4_inode_make_writeable(struct inode *inode)
816 delegation = nfs4_get_valid_delegation(inode);
818 (nfs4_has_session(NFS_SERVER(inode)->nfs_client) &&
824 return nfs4_inode_return_delegation(inode);
920 static void nfs_revoke_delegation(struct inode *inode,
928 delegation = rcu_dereference(NFS_I(inode)->delegation);
952 nfs_inode_find_state_and_recover(inode, stateid);
955 void nfs_remove_bad_delegation(struct inode *inode,
958 nfs_revoke_delegation(inode, stateid);
962 void nfs_delegation_mark_returned(struct inode *inode,
967 if (!inode)
971 delegation = rcu_dereference(NFS_I(inode)->delegation);
995 nfs_inode_find_state_and_recover(inode, stateid);
1040 * @inode: inode to process
1045 int nfs_async_inode_return_delegation(struct inode *inode,
1048 struct nfs_server *server = NFS_SERVER(inode);
1053 delegation = nfs4_get_valid_delegation(inode);
1063 break_lease(inode, O_WRONLY | O_RDWR | O_NONBLOCK);
1072 static struct inode *
1078 struct inode *res = NULL;
1082 if (delegation->inode != NULL &&
1084 nfs_compare_fh(fhandle, &NFS_I(delegation->inode)->fh) == 0) {
1087 res = igrab(delegation->inode);
1105 * nfs_delegation_find_inode - retrieve the inode associated with a delegation
1109 * Returns pointer to inode matching "fhandle," or NULL if a matching inode
1112 struct inode *nfs_delegation_find_inode(struct nfs_client *clp,
1116 struct inode *res;
1164 struct inode *inode;
1176 inode = nfs_delegation_grab_inode(delegation);
1177 if (inode == NULL)
1179 delegation = nfs_start_delegation_return_locked(NFS_I(inode));
1182 if (nfs_detach_delegation(NFS_I(inode), delegation,
1188 iput(inode);
1225 struct inode *inode)
1230 delegation = rcu_dereference(NFS_I(inode)->delegation);
1275 nfs_delegation_test_free_expired(struct inode *inode,
1279 struct nfs_server *server = NFS_SERVER(inode);
1287 nfs_remove_bad_delegation(inode, stateid);
1294 struct inode *inode;
1308 inode = nfs_delegation_grab_inode(delegation);
1309 if (inode == NULL)
1317 nfs_delegation_test_free_expired(inode, &stateid, cred);
1320 iput(inode);
1324 nfs_inode_mark_test_expired_delegation(server,inode);
1325 iput(inode);
1347 void nfs_inode_find_delegation_state_and_recover(struct inode *inode,
1350 struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;
1355 delegation = rcu_dereference(NFS_I(inode)->delegation);
1359 nfs_mark_test_expired_delegation(NFS_SERVER(inode), delegation);
1392 * @inode: inode to check
1394 * Returns "true" and updates "dst->seqid" * if inode had a delegation
1397 bool nfs4_refresh_delegation_stateid(nfs4_stateid *dst, struct inode *inode)
1401 if (!inode)
1405 delegation = rcu_dereference(NFS_I(inode)->delegation);
1419 * nfs4_copy_delegation_stateid - Copy inode's state ID information
1420 * @inode: inode to check
1425 * Returns "true" and fills in "dst->data" * if inode had a delegation,
1428 bool nfs4_copy_delegation_stateid(struct inode *inode, fmode_t flags,
1431 struct nfs_inode *nfsi = NFS_I(inode);
1456 * @inode: inode to check
1462 bool nfs4_delegation_flush_on_close(const struct inode *inode)
1464 struct nfs_inode *nfsi = NFS_I(inode);