callback_proc.c (4911096f1a5df73c12c287a42ece4e7b5d9c19ec) callback_proc.c (b9efa1b27e25b1286504973c0a6bf0f24106faa8)
1/*
2 * linux/fs/nfs/callback_proc.c
3 *
4 * Copyright (C) 2004 Trond Myklebust
5 *
6 * NFSv4 callback procedures
7 */
8#include <linux/nfs4.h>

--- 347 unchanged lines hidden (view full) ---

356
357 if (flags)
358 nfs_expire_all_delegation_types(clp, flags);
359 status = htonl(NFS4_OK);
360out:
361 dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
362 return status;
363}
1/*
2 * linux/fs/nfs/callback_proc.c
3 *
4 * Copyright (C) 2004 Trond Myklebust
5 *
6 * NFSv4 callback procedures
7 */
8#include <linux/nfs4.h>

--- 347 unchanged lines hidden (view full) ---

356
357 if (flags)
358 nfs_expire_all_delegation_types(clp, flags);
359 status = htonl(NFS4_OK);
360out:
361 dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
362 return status;
363}
364
365/* Reduce the fore channel's max_slots to the target value */
366unsigned nfs4_callback_recallslot(struct cb_recallslotargs *args, void *dummy)
367{
368 struct nfs_client *clp;
369 struct nfs4_slot_table *fc_tbl;
370 int status;
371
372 status = htonl(NFS4ERR_OP_NOT_IN_SESSION);
373 clp = nfs_find_client(args->crsa_addr, 4);
374 if (clp == NULL)
375 goto out;
376
377 dprintk("NFS: CB_RECALL_SLOT request from %s target max slots %d\n",
378 rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR),
379 args->crsa_target_max_slots);
380
381 fc_tbl = &clp->cl_session->fc_slot_table;
382
383 status = htonl(NFS4ERR_BAD_HIGH_SLOT);
384 if (args->crsa_target_max_slots >= fc_tbl->max_slots ||
385 args->crsa_target_max_slots < 1)
386 goto out;
387
388 fc_tbl->target_max_slots = args->crsa_target_max_slots;
389 nfs41_handle_recall_slot(clp);
390 status = htonl(NFS4_OK);
391 nfs_put_client(clp); /* balance nfs_find_client */
392out:
393 dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
394 return status;
395}
364#endif /* CONFIG_NFS_V4_1 */
396#endif /* CONFIG_NFS_V4_1 */