Lines Matching refs:dp

1061 	struct nfs4_delegation *dp = delegstateid(stid);
1064 WARN_ON_ONCE(!list_empty(&dp->dl_perfile));
1065 WARN_ON_ONCE(!list_empty(&dp->dl_perclnt));
1066 WARN_ON_ONCE(!list_empty(&dp->dl_recall_lru));
1151 struct nfs4_delegation *dp;
1164 dp = delegstateid(stid);
1171 dp->dl_stid.sc_stateid.si_generation = 1;
1172 INIT_LIST_HEAD(&dp->dl_perfile);
1173 INIT_LIST_HEAD(&dp->dl_perclnt);
1174 INIT_LIST_HEAD(&dp->dl_recall_lru);
1175 dp->dl_clnt_odstate = odstate;
1177 dp->dl_type = dl_type;
1178 dp->dl_retries = 1;
1179 dp->dl_recalled = false;
1180 nfsd4_init_cb(&dp->dl_recall, dp->dl_stid.sc_client,
1182 nfsd4_init_cb(&dp->dl_cb_fattr.ncf_getattr, dp->dl_stid.sc_client,
1184 dp->dl_cb_fattr.ncf_file_modified = false;
1185 dp->dl_cb_fattr.ncf_cb_bmap[0] = FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE;
1187 dp->dl_stid.sc_file = fp;
1188 return dp;
1241 static void nfs4_unlock_deleg_lease(struct nfs4_delegation *dp)
1243 struct nfs4_file *fp = dp->dl_stid.sc_file;
1248 kernel_setlease(nf->nf_file, F_UNLCK, NULL, (void **)&dp);
1252 static void destroy_unhashed_deleg(struct nfs4_delegation *dp)
1254 put_clnt_odstate(dp->dl_clnt_odstate);
1255 nfs4_unlock_deleg_lease(dp);
1256 nfs4_put_stid(&dp->dl_stid);
1288 * @dp: a pointer to the nfs4_delegation we are adding.
1300 hash_delegation_locked(struct nfs4_delegation *dp, struct nfs4_file *fp)
1302 struct nfs4_client *clp = dp->dl_stid.sc_client;
1310 refcount_inc(&dp->dl_stid.sc_count);
1311 dp->dl_stid.sc_type = SC_TYPE_DELEG;
1312 list_add(&dp->dl_perfile, &fp->fi_delegations);
1313 list_add(&dp->dl_perclnt, &clp->cl_delegations);
1317 static bool delegation_hashed(struct nfs4_delegation *dp)
1319 return !(list_empty(&dp->dl_perfile));
1323 unhash_delegation_locked(struct nfs4_delegation *dp, unsigned short statusmask)
1325 struct nfs4_file *fp = dp->dl_stid.sc_file;
1329 if (!delegation_hashed(dp))
1333 dp->dl_stid.sc_client->cl_minorversion == 0)
1335 dp->dl_stid.sc_status |= statusmask;
1337 atomic_inc(&dp->dl_stid.sc_client->cl_admin_revoked);
1340 ++dp->dl_time;
1342 list_del_init(&dp->dl_perclnt);
1343 list_del_init(&dp->dl_recall_lru);
1344 list_del_init(&dp->dl_perfile);
1349 static void destroy_delegation(struct nfs4_delegation *dp)
1354 unhashed = unhash_delegation_locked(dp, SC_STATUS_CLOSED);
1357 destroy_unhashed_deleg(dp);
1360 static void revoke_delegation(struct nfs4_delegation *dp)
1362 struct nfs4_client *clp = dp->dl_stid.sc_client;
1364 WARN_ON(!list_empty(&dp->dl_recall_lru));
1366 trace_nfsd_stid_revoke(&dp->dl_stid);
1368 if (dp->dl_stid.sc_status &
1371 refcount_inc(&dp->dl_stid.sc_count);
1372 list_add(&dp->dl_recall_lru, &clp->cl_revoked);
1375 destroy_unhashed_deleg(dp);
1735 struct nfs4_delegation *dp;
1783 dp = delegstateid(stid);
1786 dp, SC_STATUS_ADMIN_REVOKED))
1787 dp = NULL;
1789 if (dp)
1790 revoke_delegation(dp);
2371 struct nfs4_delegation *dp;
2377 dp = list_entry(clp->cl_delegations.next, struct nfs4_delegation, dl_perclnt);
2378 unhash_delegation_locked(dp, SC_STATUS_CLOSED);
2379 list_add(&dp->dl_recall_lru, &reaplist);
2383 dp = list_entry(reaplist.next, struct nfs4_delegation, dl_recall_lru);
2384 list_del_init(&dp->dl_recall_lru);
2385 destroy_unhashed_deleg(dp);
2388 dp = list_entry(clp->cl_revoked.next, struct nfs4_delegation, dl_recall_lru);
2389 list_del_init(&dp->dl_recall_lru);
2390 nfs4_put_stid(&dp->dl_stid);
3075 struct nfs4_delegation *dp =
3078 nfs4_put_stid(&dp->dl_stid);
3095 struct nfs4_delegation *dp =
3103 refcount_inc(&dp->dl_stid.sc_count);
4786 struct nfs4_delegation *dp;
4805 dp = delegstateid(s);
4806 list_del_init(&dp->dl_recall_lru);
5153 struct nfs4_delegation *dp = cb_to_delegation(cb);
5154 struct nfsd_net *nn = net_generic(dp->dl_stid.sc_client->net,
5157 block_delegations(&dp->dl_stid.sc_file->fi_fhandle);
5167 if (delegation_hashed(dp) && dp->dl_time == 0) {
5168 dp->dl_time = ktime_get_boottime_seconds();
5169 list_add_tail(&dp->dl_recall_lru, &nn->del_recall_lru);
5177 struct nfs4_delegation *dp = cb_to_delegation(cb);
5179 trace_nfsd_cb_recall_done(&dp->dl_stid.sc_stateid, task);
5181 if (dp->dl_stid.sc_status)
5197 if (dp->dl_retries--) {
5209 struct nfs4_delegation *dp = cb_to_delegation(cb);
5211 nfs4_put_stid(&dp->dl_stid);
5220 static void nfsd_break_one_deleg(struct nfs4_delegation *dp)
5229 refcount_inc(&dp->dl_stid.sc_count);
5230 WARN_ON_ONCE(!nfsd4_run_cb(&dp->dl_recall));
5237 struct nfs4_delegation *dp = (struct nfs4_delegation *) fl->c.flc_owner;
5238 struct nfs4_file *fp = dp->dl_stid.sc_file;
5239 struct nfs4_client *clp = dp->dl_stid.sc_client;
5242 trace_nfsd_cb_recall(&dp->dl_stid);
5244 dp->dl_recalled = true;
5259 nfsd_break_one_deleg(dp);
5291 struct nfs4_delegation *dp = (struct nfs4_delegation *) onlist->c.flc_owner;
5292 struct nfs4_client *clp = dp->dl_stid.sc_client;
5295 if (dp->dl_recalled)
5405 nfs4_check_delegmode(struct nfs4_delegation *dp, int flags)
5407 if ((flags & WR_STATE) && (dp->dl_type == NFS4_OPEN_DELEGATE_READ))
5437 struct nfs4_delegation **dp)
5463 *dp = deleg;
5639 static struct file_lease *nfs4_alloc_init_lease(struct nfs4_delegation *dp,
5650 fl->c.flc_owner = (fl_owner_t)dp;
5652 fl->c.flc_file = dp->dl_stid.sc_file->fi_deleg_file->nf_file;
5768 struct nfs4_delegation *dp;
5832 dp = alloc_init_deleg(clp, fp, odstate, dl_type);
5833 if (!dp)
5836 fl = nfs4_alloc_init_lease(dp, dl_type);
5872 status = hash_delegation_locked(dp, fp);
5880 return dp;
5882 kernel_setlease(fp->fi_deleg_file->nf_file, F_UNLCK, NULL, (void **)&dp);
5884 put_clnt_odstate(dp->dl_clnt_odstate);
5885 nfs4_put_stid(&dp->dl_stid);
5940 struct nfs4_delegation *dp;
5976 dp = nfs4_set_delegation(open, stp, parent);
5977 if (IS_ERR(dp))
5980 memcpy(&open->op_delegate_stateid, &dp->dl_stid.sc_stateid, sizeof(dp->dl_stid.sc_stateid));
5984 trace_nfsd_deleg_write(&dp->dl_stid.sc_stateid);
5990 nfs4_put_stid(&dp->dl_stid);
5991 destroy_delegation(dp);
5994 dp->dl_cb_fattr.ncf_cur_fsize = stat.size;
5995 dp->dl_cb_fattr.ncf_initial_cinfo =
5999 trace_nfsd_deleg_read(&dp->dl_stid.sc_stateid);
6001 nfs4_put_stid(&dp->dl_stid);
6018 struct nfs4_delegation *dp)
6021 dp->dl_type == NFS4_OPEN_DELEGATE_WRITE) {
6025 dp->dl_type == NFS4_OPEN_DELEGATE_WRITE) {
6054 struct nfs4_delegation *dp = NULL;
6067 status = nfs4_check_deleg(cl, open, &dp);
6132 if (open->op_delegate_type == NFS4_OPEN_DELEGATE_NONE && dp &&
6134 nfsd4_deleg_xgrade_none_ext(open, dp);
6149 if (dp)
6150 nfs4_put_stid(&dp->dl_stid);
6490 struct nfs4_delegation *dp;
6523 dp = list_entry (pos, struct nfs4_delegation, dl_recall_lru);
6524 if (!state_expired(&lt, dp->dl_time))
6526 unhash_delegation_locked(dp, SC_STATUS_REVOKED);
6527 list_add(&dp->dl_recall_lru, &reaplist);
6531 dp = list_first_entry(&reaplist, struct nfs4_delegation,
6533 list_del_init(&dp->dl_recall_lru);
6534 revoke_delegation(dp);
7123 struct nfs4_delegation *dp;
7141 dp = delegstateid(s);
7142 list_del_init(&dp->dl_recall_lru);
7463 struct nfs4_delegation *dp;
7475 dp = delegstateid(s);
7476 status = nfsd4_stid_check_stateid_generation(stateid, &dp->dl_stid, nfsd4_has_session(cstate));
7482 destroy_delegation(dp);
7484 nfs4_put_stid(&dp->dl_stid);
8662 struct nfs4_delegation *dp = NULL;
8674 dp = list_entry (pos, struct nfs4_delegation, dl_recall_lru);
8675 unhash_delegation_locked(dp, SC_STATUS_CLOSED);
8676 list_add(&dp->dl_recall_lru, &reaplist);
8680 dp = list_entry (pos, struct nfs4_delegation, dl_recall_lru);
8681 list_del_init(&dp->dl_recall_lru);
8682 destroy_unhashed_deleg(dp);
8837 struct nfs4_delegation *dp;
8862 dp = fl->c.flc_owner;
8863 if (dp->dl_recall.cb_clp == *(rqstp->rq_lease_breaker)) {
8869 dp = fl->c.flc_owner;
8870 ncf = &dp->dl_cb_fattr;
8871 nfs4_cb_getattr(&dp->dl_cb_fattr);