aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/svclock.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 17:42:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 17:42:28 -0400
commit08843b79fb35d33859e0f8f11a7318341076e4d1 (patch)
treee56e122146985b359d50787e3d1df640c4582dfa /fs/lockd/svclock.c
parentcc8362b1f6d724e46f515121d442779924b19fec (diff)
parent2c142baa7b237584bae7dc28630851701497e1ef (diff)
Merge branch 'nfsd-next' of git://linux-nfs.org/~bfields/linux
Pull nfsd changes from J. Bruce Fields: "This has been an unusually quiet cycle--mostly bugfixes and cleanup. The one large piece is Stanislav's work to containerize the server's grace period--but that in itself is just one more step in a not-yet-complete project to allow fully containerized nfs service. There are a number of outstanding delegation, container, v4 state, and gss patches that aren't quite ready yet; 3.7 may be wilder." * 'nfsd-next' of git://linux-nfs.org/~bfields/linux: (35 commits) NFSd: make boot_time variable per network namespace NFSd: make grace end flag per network namespace Lockd: move grace period management from lockd() to per-net functions LockD: pass actual network namespace to grace period management functions LockD: manage grace list per network namespace SUNRPC: service request network namespace helper introduced NFSd: make nfsd4_manager allocated per network namespace context. LockD: make lockd manager allocated per network namespace LockD: manage grace period per network namespace Lockd: add more debug to host shutdown functions Lockd: host complaining function introduced LockD: manage used host count per networks namespace LockD: manage garbage collection timeout per networks namespace LockD: make garbage collector network namespace aware. LockD: mark host per network namespace on garbage collect nfsd4: fix missing fault_inject.h include locks: move lease-specific code out of locks_delete_lock locks: prevent side-effects of locks_release_private before file_lock is initialized NFSd: set nfsd_serv to NULL after service destruction NFSd: introduce nfsd_destroy() helper ...
Diffstat (limited to 'fs/lockd/svclock.c')
-rw-r--r--fs/lockd/svclock.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index e46353f41a42..afe4488c33d8 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -26,7 +26,7 @@
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/sched.h> 27#include <linux/sched.h>
28#include <linux/sunrpc/clnt.h> 28#include <linux/sunrpc/clnt.h>
29#include <linux/sunrpc/svc.h> 29#include <linux/sunrpc/svc_xprt.h>
30#include <linux/lockd/nlm.h> 30#include <linux/lockd/nlm.h>
31#include <linux/lockd/lockd.h> 31#include <linux/lockd/lockd.h>
32#include <linux/kthread.h> 32#include <linux/kthread.h>
@@ -447,11 +447,11 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
447 goto out; 447 goto out;
448 } 448 }
449 449
450 if (locks_in_grace() && !reclaim) { 450 if (locks_in_grace(SVC_NET(rqstp)) && !reclaim) {
451 ret = nlm_lck_denied_grace_period; 451 ret = nlm_lck_denied_grace_period;
452 goto out; 452 goto out;
453 } 453 }
454 if (reclaim && !locks_in_grace()) { 454 if (reclaim && !locks_in_grace(SVC_NET(rqstp))) {
455 ret = nlm_lck_denied_grace_period; 455 ret = nlm_lck_denied_grace_period;
456 goto out; 456 goto out;
457 } 457 }
@@ -559,7 +559,7 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
559 goto out; 559 goto out;
560 } 560 }
561 561
562 if (locks_in_grace()) { 562 if (locks_in_grace(SVC_NET(rqstp))) {
563 ret = nlm_lck_denied_grace_period; 563 ret = nlm_lck_denied_grace_period;
564 goto out; 564 goto out;
565 } 565 }
@@ -603,7 +603,7 @@ out:
603 * must be removed. 603 * must be removed.
604 */ 604 */
605__be32 605__be32
606nlmsvc_unlock(struct nlm_file *file, struct nlm_lock *lock) 606nlmsvc_unlock(struct net *net, struct nlm_file *file, struct nlm_lock *lock)
607{ 607{
608 int error; 608 int error;
609 609
@@ -615,7 +615,7 @@ nlmsvc_unlock(struct nlm_file *file, struct nlm_lock *lock)
615 (long long)lock->fl.fl_end); 615 (long long)lock->fl.fl_end);
616 616
617 /* First, cancel any lock that might be there */ 617 /* First, cancel any lock that might be there */
618 nlmsvc_cancel_blocked(file, lock); 618 nlmsvc_cancel_blocked(net, file, lock);
619 619
620 lock->fl.fl_type = F_UNLCK; 620 lock->fl.fl_type = F_UNLCK;
621 error = vfs_lock_file(file->f_file, F_SETLK, &lock->fl, NULL); 621 error = vfs_lock_file(file->f_file, F_SETLK, &lock->fl, NULL);
@@ -631,7 +631,7 @@ nlmsvc_unlock(struct nlm_file *file, struct nlm_lock *lock)
631 * The calling procedure must check whether the file can be closed. 631 * The calling procedure must check whether the file can be closed.
632 */ 632 */
633__be32 633__be32
634nlmsvc_cancel_blocked(struct nlm_file *file, struct nlm_lock *lock) 634nlmsvc_cancel_blocked(struct net *net, struct nlm_file *file, struct nlm_lock *lock)
635{ 635{
636 struct nlm_block *block; 636 struct nlm_block *block;
637 int status = 0; 637 int status = 0;
@@ -643,7 +643,7 @@ nlmsvc_cancel_blocked(struct nlm_file *file, struct nlm_lock *lock)
643 (long long)lock->fl.fl_start, 643 (long long)lock->fl.fl_start,
644 (long long)lock->fl.fl_end); 644 (long long)lock->fl.fl_end);
645 645
646 if (locks_in_grace()) 646 if (locks_in_grace(net))
647 return nlm_lck_denied_grace_period; 647 return nlm_lck_denied_grace_period;
648 648
649 mutex_lock(&file->f_mutex); 649 mutex_lock(&file->f_mutex);