diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-04-03 19:27:52 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-04-05 17:03:57 -0400 |
commit | 826e0013082a86fb16f2e414314a5268f744fb96 (patch) | |
tree | 0e99a0f165cc4057dcb372da8bbf19f6c2b98c49 /fs | |
parent | b02ba0b66095d2fdcc6b74538aa5a0ae13976745 (diff) |
NFSv4: Fix CB_RECALL_ANY to only return delegations that are not in use
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/callback_proc.c | 2 | ||||
-rw-r--r-- | fs/nfs/delegation.c | 14 | ||||
-rw-r--r-- | fs/nfs/delegation.h | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 2960512792c2..a13d26ede254 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c | |||
@@ -500,7 +500,7 @@ __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, | |||
500 | &args->craa_type_mask)) | 500 | &args->craa_type_mask)) |
501 | pnfs_recall_all_layouts(cps->clp); | 501 | pnfs_recall_all_layouts(cps->clp); |
502 | if (flags) | 502 | if (flags) |
503 | nfs_expire_all_delegation_types(cps->clp, flags); | 503 | nfs_expire_unused_delegation_types(cps->clp, flags); |
504 | out: | 504 | out: |
505 | dprintk("%s: exit with status = %d\n", __func__, ntohl(status)); | 505 | dprintk("%s: exit with status = %d\n", __func__, ntohl(status)); |
506 | return status; | 506 | return status; |
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 60e2e6e3e323..f30bd1ec63b9 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c | |||
@@ -564,7 +564,7 @@ void nfs_server_return_all_delegations(struct nfs_server *server) | |||
564 | } | 564 | } |
565 | } | 565 | } |
566 | 566 | ||
567 | static void nfs_mark_return_all_delegation_types(struct nfs_server *server, | 567 | static void nfs_mark_return_unused_delegation_types(struct nfs_server *server, |
568 | fmode_t flags) | 568 | fmode_t flags) |
569 | { | 569 | { |
570 | struct nfs_delegation *delegation; | 570 | struct nfs_delegation *delegation; |
@@ -573,18 +573,18 @@ static void nfs_mark_return_all_delegation_types(struct nfs_server *server, | |||
573 | if ((delegation->type == (FMODE_READ|FMODE_WRITE)) && !(flags & FMODE_WRITE)) | 573 | if ((delegation->type == (FMODE_READ|FMODE_WRITE)) && !(flags & FMODE_WRITE)) |
574 | continue; | 574 | continue; |
575 | if (delegation->type & flags) | 575 | if (delegation->type & flags) |
576 | nfs_mark_return_delegation(server, delegation); | 576 | nfs_mark_return_if_closed_delegation(server, delegation); |
577 | } | 577 | } |
578 | } | 578 | } |
579 | 579 | ||
580 | static void nfs_client_mark_return_all_delegation_types(struct nfs_client *clp, | 580 | static void nfs_client_mark_return_unused_delegation_types(struct nfs_client *clp, |
581 | fmode_t flags) | 581 | fmode_t flags) |
582 | { | 582 | { |
583 | struct nfs_server *server; | 583 | struct nfs_server *server; |
584 | 584 | ||
585 | rcu_read_lock(); | 585 | rcu_read_lock(); |
586 | list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) | 586 | list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) |
587 | nfs_mark_return_all_delegation_types(server, flags); | 587 | nfs_mark_return_unused_delegation_types(server, flags); |
588 | rcu_read_unlock(); | 588 | rcu_read_unlock(); |
589 | } | 589 | } |
590 | 590 | ||
@@ -601,14 +601,14 @@ void nfs_remove_bad_delegation(struct inode *inode) | |||
601 | EXPORT_SYMBOL_GPL(nfs_remove_bad_delegation); | 601 | EXPORT_SYMBOL_GPL(nfs_remove_bad_delegation); |
602 | 602 | ||
603 | /** | 603 | /** |
604 | * nfs_expire_all_delegation_types | 604 | * nfs_expire_unused_delegation_types |
605 | * @clp: client to process | 605 | * @clp: client to process |
606 | * @flags: delegation types to expire | 606 | * @flags: delegation types to expire |
607 | * | 607 | * |
608 | */ | 608 | */ |
609 | void nfs_expire_all_delegation_types(struct nfs_client *clp, fmode_t flags) | 609 | void nfs_expire_unused_delegation_types(struct nfs_client *clp, fmode_t flags) |
610 | { | 610 | { |
611 | nfs_client_mark_return_all_delegation_types(clp, flags); | 611 | nfs_client_mark_return_unused_delegation_types(clp, flags); |
612 | nfs_delegation_run_state_manager(clp); | 612 | nfs_delegation_run_state_manager(clp); |
613 | } | 613 | } |
614 | 614 | ||
diff --git a/fs/nfs/delegation.h b/fs/nfs/delegation.h index 22f0a138e551..9a79c7a99d6d 100644 --- a/fs/nfs/delegation.h +++ b/fs/nfs/delegation.h | |||
@@ -42,7 +42,7 @@ void nfs_inode_return_delegation_noreclaim(struct inode *inode); | |||
42 | struct inode *nfs_delegation_find_inode(struct nfs_client *clp, const struct nfs_fh *fhandle); | 42 | struct inode *nfs_delegation_find_inode(struct nfs_client *clp, const struct nfs_fh *fhandle); |
43 | void nfs_server_return_all_delegations(struct nfs_server *); | 43 | void nfs_server_return_all_delegations(struct nfs_server *); |
44 | void nfs_expire_all_delegations(struct nfs_client *clp); | 44 | void nfs_expire_all_delegations(struct nfs_client *clp); |
45 | void nfs_expire_all_delegation_types(struct nfs_client *clp, fmode_t flags); | 45 | void nfs_expire_unused_delegation_types(struct nfs_client *clp, fmode_t flags); |
46 | void nfs_expire_unreferenced_delegations(struct nfs_client *clp); | 46 | void nfs_expire_unreferenced_delegations(struct nfs_client *clp); |
47 | int nfs_client_return_marked_delegations(struct nfs_client *clp); | 47 | int nfs_client_return_marked_delegations(struct nfs_client *clp); |
48 | int nfs_delegations_present(struct nfs_client *clp); | 48 | int nfs_delegations_present(struct nfs_client *clp); |