diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-04-03 19:23:58 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-04-05 17:03:56 -0400 |
commit | b02ba0b66095d2fdcc6b74538aa5a0ae13976745 (patch) | |
tree | 32069c0754f0fe92f3f607fb7cae3d9915be938a /fs/nfs | |
parent | 5c31e2368f39aee062cb697d4b8857c64c7cef7c (diff) |
NFSv4: Clean up nfs_expire_all_delegations
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/delegation.c | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 213f1bbeb828..60e2e6e3e323 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c | |||
@@ -514,6 +514,33 @@ static bool nfs_server_mark_return_all_delegations(struct nfs_server *server) | |||
514 | return ret; | 514 | return ret; |
515 | } | 515 | } |
516 | 516 | ||
517 | static void nfs_client_mark_return_all_delegations(struct nfs_client *clp) | ||
518 | { | ||
519 | struct nfs_server *server; | ||
520 | |||
521 | rcu_read_lock(); | ||
522 | list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) | ||
523 | nfs_server_mark_return_all_delegations(server); | ||
524 | rcu_read_unlock(); | ||
525 | } | ||
526 | |||
527 | static void nfs_delegation_run_state_manager(struct nfs_client *clp) | ||
528 | { | ||
529 | if (test_bit(NFS4CLNT_DELEGRETURN, &clp->cl_state)) | ||
530 | nfs4_schedule_state_manager(clp); | ||
531 | } | ||
532 | |||
533 | /** | ||
534 | * nfs_expire_all_delegations | ||
535 | * @clp: client to process | ||
536 | * | ||
537 | */ | ||
538 | void nfs_expire_all_delegations(struct nfs_client *clp) | ||
539 | { | ||
540 | nfs_client_mark_return_all_delegations(clp); | ||
541 | nfs_delegation_run_state_manager(clp); | ||
542 | } | ||
543 | |||
517 | /** | 544 | /** |
518 | * nfs_super_return_all_delegations - return delegations for one superblock | 545 | * nfs_super_return_all_delegations - return delegations for one superblock |
519 | * @sb: sb to process | 546 | * @sb: sb to process |
@@ -561,12 +588,6 @@ static void nfs_client_mark_return_all_delegation_types(struct nfs_client *clp, | |||
561 | rcu_read_unlock(); | 588 | rcu_read_unlock(); |
562 | } | 589 | } |
563 | 590 | ||
564 | static void nfs_delegation_run_state_manager(struct nfs_client *clp) | ||
565 | { | ||
566 | if (test_bit(NFS4CLNT_DELEGRETURN, &clp->cl_state)) | ||
567 | nfs4_schedule_state_manager(clp); | ||
568 | } | ||
569 | |||
570 | void nfs_remove_bad_delegation(struct inode *inode) | 591 | void nfs_remove_bad_delegation(struct inode *inode) |
571 | { | 592 | { |
572 | struct nfs_delegation *delegation; | 593 | struct nfs_delegation *delegation; |
@@ -591,16 +612,6 @@ void nfs_expire_all_delegation_types(struct nfs_client *clp, fmode_t flags) | |||
591 | nfs_delegation_run_state_manager(clp); | 612 | nfs_delegation_run_state_manager(clp); |
592 | } | 613 | } |
593 | 614 | ||
594 | /** | ||
595 | * nfs_expire_all_delegations | ||
596 | * @clp: client to process | ||
597 | * | ||
598 | */ | ||
599 | void nfs_expire_all_delegations(struct nfs_client *clp) | ||
600 | { | ||
601 | nfs_expire_all_delegation_types(clp, FMODE_READ|FMODE_WRITE); | ||
602 | } | ||
603 | |||
604 | static void nfs_mark_return_unreferenced_delegations(struct nfs_server *server) | 615 | static void nfs_mark_return_unreferenced_delegations(struct nfs_server *server) |
605 | { | 616 | { |
606 | struct nfs_delegation *delegation; | 617 | struct nfs_delegation *delegation; |