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>
This commit is contained in:
@@ -912,26 +912,6 @@ out_uninit:
|
||||
|
||||
#ifdef CONFIG_GFS2_FS_LOCKING_DLM
|
||||
|
||||
/**
|
||||
* gfs2_setlease - acquire/release a file lease
|
||||
* @file: the file pointer
|
||||
* @arg: lease type
|
||||
* @fl: file lock
|
||||
*
|
||||
* We don't currently have a way to enforce a lease across the whole
|
||||
* cluster; until we do, disable leases (by just returning -EINVAL),
|
||||
* unless the administrator has requested purely local locking.
|
||||
*
|
||||
* Locking: called under i_lock
|
||||
*
|
||||
* Returns: errno
|
||||
*/
|
||||
|
||||
static int gfs2_setlease(struct file *file, long arg, struct file_lock **fl)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/**
|
||||
* gfs2_lock - acquire/release a posix lock on a file
|
||||
* @file: the file pointer
|
||||
@@ -1069,7 +1049,7 @@ const struct file_operations gfs2_file_fops = {
|
||||
.flock = gfs2_flock,
|
||||
.splice_read = generic_file_splice_read,
|
||||
.splice_write = iter_file_splice_write,
|
||||
.setlease = gfs2_setlease,
|
||||
.setlease = simple_nosetlease,
|
||||
.fallocate = gfs2_fallocate,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user