diff options
author | Anton Vorontsov <cbouatmailru@gmail.com> | 2008-10-18 20:28:24 +0400 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2008-10-18 20:28:24 +0400 |
commit | ed8c3174dd227031d1f3b9fa4fbb512f8f623434 (patch) | |
tree | bac4953f8899d6600f4716c0bcde1e25e34c2591 /fs/lockd/svclock.c | |
parent | 8aef7e8f8de2d900da892085edbf14ea35fe6881 (diff) | |
parent | 0cfd81031a26717fe14380d18275f8e217571615 (diff) | |
download | kernel-crypto-ed8c3174dd227031d1f3b9fa4fbb512f8f623434.tar.gz kernel-crypto-ed8c3174dd227031d1f3b9fa4fbb512f8f623434.tar.xz kernel-crypto-ed8c3174dd227031d1f3b9fa4fbb512f8f623434.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/power/Makefile
Diffstat (limited to 'fs/lockd/svclock.c')
-rw-r--r-- | fs/lockd/svclock.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index cf0d5c2c318..6063a8e4b9f 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -360,7 +360,7 @@ nlmsvc_defer_lock_rqst(struct svc_rqst *rqstp, struct nlm_block *block) __be32 nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file, struct nlm_host *host, struct nlm_lock *lock, int wait, - struct nlm_cookie *cookie) + struct nlm_cookie *cookie, int reclaim) { struct nlm_block *block = NULL; int error; @@ -406,6 +406,15 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file, goto out; } + if (locks_in_grace() && !reclaim) { + ret = nlm_lck_denied_grace_period; + goto out; + } + if (reclaim && !locks_in_grace()) { + ret = nlm_lck_denied_grace_period; + goto out; + } + if (!wait) lock->fl.fl_flags &= ~FL_SLEEP; error = vfs_lock_file(file->f_file, F_SETLK, &lock->fl, NULL); @@ -502,6 +511,10 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file, goto out; } + if (locks_in_grace()) { + ret = nlm_lck_denied_grace_period; + goto out; + } error = vfs_test_lock(file->f_file, &lock->fl); if (error == FILE_LOCK_DEFERRED) { ret = nlmsvc_defer_lock_rqst(rqstp, block); @@ -582,6 +595,9 @@ nlmsvc_cancel_blocked(struct nlm_file *file, struct nlm_lock *lock) (long long)lock->fl.fl_start, (long long)lock->fl.fl_end); + if (locks_in_grace()) + return nlm_lck_denied_grace_period; + mutex_lock(&file->f_mutex); block = nlmsvc_lookup_block(file, lock); mutex_unlock(&file->f_mutex); |