aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/callback_proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/callback_proc.c')
-rw-r--r--fs/nfs/callback_proc.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 2f41dccea18e..fb5e5b9a97ae 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -241,6 +241,53 @@ static void pnfs_recall_all_layouts(struct nfs_client *clp)
241 do_callback_layoutrecall(clp, &args); 241 do_callback_layoutrecall(clp, &args);
242} 242}
243 243
244__be32 nfs4_callback_devicenotify(struct cb_devicenotifyargs *args,
245 void *dummy, struct cb_process_state *cps)
246{
247 int i;
248 __be32 res = 0;
249 struct nfs_client *clp = cps->clp;
250 struct nfs_server *server = NULL;
251
252 dprintk("%s: -->\n", __func__);
253
254 if (!clp) {
255 res = cpu_to_be32(NFS4ERR_OP_NOT_IN_SESSION);
256 goto out;
257 }
258
259 for (i = 0; i < args->ndevs; i++) {
260 struct cb_devicenotifyitem *dev = &args->devs[i];
261
262 if (!server ||
263 server->pnfs_curr_ld->id != dev->cbd_layout_type) {
264 rcu_read_lock();
265 list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link)
266 if (server->pnfs_curr_ld &&
267 server->pnfs_curr_ld->id == dev->cbd_layout_type) {
268 rcu_read_unlock();
269 goto found;
270 }
271 rcu_read_unlock();
272 dprintk("%s: layout type %u not found\n",
273 __func__, dev->cbd_layout_type);
274 continue;
275 }
276
277 found:
278 if (dev->cbd_notify_type == NOTIFY_DEVICEID4_CHANGE)
279 dprintk("%s: NOTIFY_DEVICEID4_CHANGE not supported, "
280 "deleting instead\n", __func__);
281 nfs4_delete_deviceid(clp, &dev->cbd_dev_id);
282 }
283
284out:
285 kfree(args->devs);
286 dprintk("%s: exit with status = %u\n",
287 __func__, be32_to_cpu(res));
288 return res;
289}
290
244int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation, const nfs4_stateid *stateid) 291int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation, const nfs4_stateid *stateid)
245{ 292{
246 if (delegation == NULL) 293 if (delegation == NULL)