diff options
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/callback.c | 2 | ||||
-rw-r--r-- | fs/nfs/file.c | 16 | ||||
-rw-r--r-- | fs/nfs/super.c | 10 |
3 files changed, 23 insertions, 5 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index 75f309c874..a796be5051 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/sunrpc/svcsock.h> | 14 | #include <linux/sunrpc/svcsock.h> |
15 | #include <linux/nfs_fs.h> | 15 | #include <linux/nfs_fs.h> |
16 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
17 | #include <linux/freezer.h> | ||
17 | 18 | ||
18 | #include <net/inet_sock.h> | 19 | #include <net/inet_sock.h> |
19 | 20 | ||
@@ -67,6 +68,7 @@ static void nfs_callback_svc(struct svc_rqst *rqstp) | |||
67 | daemonize("nfsv4-svc"); | 68 | daemonize("nfsv4-svc"); |
68 | /* Process request with signals blocked, but allow SIGKILL. */ | 69 | /* Process request with signals blocked, but allow SIGKILL. */ |
69 | allow_signal(SIGKILL); | 70 | allow_signal(SIGKILL); |
71 | set_freezable(); | ||
70 | 72 | ||
71 | complete(&nfs_callback_info.started); | 73 | complete(&nfs_callback_info.started); |
72 | 74 | ||
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 8689b736fd..c87dc713b5 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -53,6 +53,7 @@ static int nfs_fsync(struct file *, struct dentry *dentry, int datasync); | |||
53 | static int nfs_check_flags(int flags); | 53 | static int nfs_check_flags(int flags); |
54 | static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl); | 54 | static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl); |
55 | static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl); | 55 | static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl); |
56 | static int nfs_setlease(struct file *file, long arg, struct file_lock **fl); | ||
56 | 57 | ||
57 | const struct file_operations nfs_file_operations = { | 58 | const struct file_operations nfs_file_operations = { |
58 | .llseek = nfs_file_llseek, | 59 | .llseek = nfs_file_llseek, |
@@ -69,6 +70,7 @@ const struct file_operations nfs_file_operations = { | |||
69 | .flock = nfs_flock, | 70 | .flock = nfs_flock, |
70 | .splice_read = nfs_file_splice_read, | 71 | .splice_read = nfs_file_splice_read, |
71 | .check_flags = nfs_check_flags, | 72 | .check_flags = nfs_check_flags, |
73 | .setlease = nfs_setlease, | ||
72 | }; | 74 | }; |
73 | 75 | ||
74 | const struct inode_operations nfs_file_inode_operations = { | 76 | const struct inode_operations nfs_file_inode_operations = { |
@@ -400,7 +402,9 @@ static int do_getlk(struct file *filp, int cmd, struct file_lock *fl) | |||
400 | 402 | ||
401 | lock_kernel(); | 403 | lock_kernel(); |
402 | /* Try local locking first */ | 404 | /* Try local locking first */ |
403 | if (posix_test_lock(filp, fl)) { | 405 | posix_test_lock(filp, fl); |
406 | if (fl->fl_type != F_UNLCK) { | ||
407 | /* found a conflict */ | ||
404 | goto out; | 408 | goto out; |
405 | } | 409 | } |
406 | 410 | ||
@@ -558,3 +562,13 @@ static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl) | |||
558 | return do_unlk(filp, cmd, fl); | 562 | return do_unlk(filp, cmd, fl); |
559 | return do_setlk(filp, cmd, fl); | 563 | return do_setlk(filp, cmd, fl); |
560 | } | 564 | } |
565 | |||
566 | static int nfs_setlease(struct file *file, long arg, struct file_lock **fl) | ||
567 | { | ||
568 | /* | ||
569 | * There is no protocol support for leases, so we have no way | ||
570 | * to implement them correctly in the face of opens by other | ||
571 | * clients. | ||
572 | */ | ||
573 | return -EINVAL; | ||
574 | } | ||
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index a2b1af89ca..adffe1615c 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -300,7 +300,10 @@ static const struct super_operations nfs4_sops = { | |||
300 | }; | 300 | }; |
301 | #endif | 301 | #endif |
302 | 302 | ||
303 | static struct shrinker *acl_shrinker; | 303 | static struct shrinker acl_shrinker = { |
304 | .shrink = nfs_access_cache_shrinker, | ||
305 | .seeks = DEFAULT_SEEKS, | ||
306 | }; | ||
304 | 307 | ||
305 | /* | 308 | /* |
306 | * Register the NFS filesystems | 309 | * Register the NFS filesystems |
@@ -321,7 +324,7 @@ int __init register_nfs_fs(void) | |||
321 | if (ret < 0) | 324 | if (ret < 0) |
322 | goto error_2; | 325 | goto error_2; |
323 | #endif | 326 | #endif |
324 | acl_shrinker = set_shrinker(DEFAULT_SEEKS, nfs_access_cache_shrinker); | 327 | register_shrinker(&acl_shrinker); |
325 | return 0; | 328 | return 0; |
326 | 329 | ||
327 | #ifdef CONFIG_NFS_V4 | 330 | #ifdef CONFIG_NFS_V4 |
@@ -339,8 +342,7 @@ error_0: | |||
339 | */ | 342 | */ |
340 | void __exit unregister_nfs_fs(void) | 343 | void __exit unregister_nfs_fs(void) |
341 | { | 344 | { |
342 | if (acl_shrinker != NULL) | 345 | unregister_shrinker(&acl_shrinker); |
343 | remove_shrinker(acl_shrinker); | ||
344 | #ifdef CONFIG_NFS_V4 | 346 | #ifdef CONFIG_NFS_V4 |
345 | unregister_filesystem(&nfs4_fs_type); | 347 | unregister_filesystem(&nfs4_fs_type); |
346 | nfs_unregister_sysctl(); | 348 | nfs_unregister_sysctl(); |