diff options
author | Jeff Layton <jlayton@primarydata.com> | 2014-08-27 06:49:41 -0400 |
---|---|---|
committer | Jeff Layton <jlayton@primarydata.com> | 2014-09-09 16:01:36 -0400 |
commit | 1c994a0909a556508c2cc26ab5d9e13c5ce33aa0 (patch) | |
tree | 6bb67db15f5e74c07c793ce3e27165c542f14c95 /fs/nfs | |
parent | 699688a416524c3cea9eafaca69fc6c06c13c02e (diff) |
locks: consolidate "nolease" routines
GFS2 and NFS have setlease routines that always just return -EINVAL.
Turn that into a generic routine that can live in fs/libfs.c.
Cc: <linux-nfs@vger.kernel.org>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: <cluster-devel@redhat.com>
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Acked-by: Trond Myklebust <trond.myklebust@primarydata.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/file.c | 13 | ||||
-rw-r--r-- | fs/nfs/internal.h | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4file.c | 2 |
3 files changed, 2 insertions, 14 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 524dd80d1898..8c4048ecdad1 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -891,17 +891,6 @@ int nfs_flock(struct file *filp, int cmd, struct file_lock *fl) | |||
891 | } | 891 | } |
892 | EXPORT_SYMBOL_GPL(nfs_flock); | 892 | EXPORT_SYMBOL_GPL(nfs_flock); |
893 | 893 | ||
894 | /* | ||
895 | * There is no protocol support for leases, so we have no way to implement | ||
896 | * them correctly in the face of opens by other clients. | ||
897 | */ | ||
898 | int nfs_setlease(struct file *file, long arg, struct file_lock **fl) | ||
899 | { | ||
900 | dprintk("NFS: setlease(%pD2, arg=%ld)\n", file, arg); | ||
901 | return -EINVAL; | ||
902 | } | ||
903 | EXPORT_SYMBOL_GPL(nfs_setlease); | ||
904 | |||
905 | const struct file_operations nfs_file_operations = { | 894 | const struct file_operations nfs_file_operations = { |
906 | .llseek = nfs_file_llseek, | 895 | .llseek = nfs_file_llseek, |
907 | .read = new_sync_read, | 896 | .read = new_sync_read, |
@@ -918,6 +907,6 @@ const struct file_operations nfs_file_operations = { | |||
918 | .splice_read = nfs_file_splice_read, | 907 | .splice_read = nfs_file_splice_read, |
919 | .splice_write = iter_file_splice_write, | 908 | .splice_write = iter_file_splice_write, |
920 | .check_flags = nfs_check_flags, | 909 | .check_flags = nfs_check_flags, |
921 | .setlease = nfs_setlease, | 910 | .setlease = simple_nosetlease, |
922 | }; | 911 | }; |
923 | EXPORT_SYMBOL_GPL(nfs_file_operations); | 912 | EXPORT_SYMBOL_GPL(nfs_file_operations); |
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 9056622d2230..94d922ebb5ac 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -346,7 +346,6 @@ int nfs_file_release(struct inode *, struct file *); | |||
346 | int nfs_lock(struct file *, int, struct file_lock *); | 346 | int nfs_lock(struct file *, int, struct file_lock *); |
347 | int nfs_flock(struct file *, int, struct file_lock *); | 347 | int nfs_flock(struct file *, int, struct file_lock *); |
348 | int nfs_check_flags(int); | 348 | int nfs_check_flags(int); |
349 | int nfs_setlease(struct file *, long, struct file_lock **); | ||
350 | 349 | ||
351 | /* inode.c */ | 350 | /* inode.c */ |
352 | extern struct workqueue_struct *nfsiod_workqueue; | 351 | extern struct workqueue_struct *nfsiod_workqueue; |
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index a816f0627a6c..3e987ad9ae25 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c | |||
@@ -131,5 +131,5 @@ const struct file_operations nfs4_file_operations = { | |||
131 | .splice_read = nfs_file_splice_read, | 131 | .splice_read = nfs_file_splice_read, |
132 | .splice_write = iter_file_splice_write, | 132 | .splice_write = iter_file_splice_write, |
133 | .check_flags = nfs_check_flags, | 133 | .check_flags = nfs_check_flags, |
134 | .setlease = nfs_setlease, | 134 | .setlease = simple_nosetlease, |
135 | }; | 135 | }; |