locks: fix fcntl_setlease/getlease return when !CONFIG_FILE_LOCKING
authorJeff Layton <jlayton@primarydata.com>
Wed, 24 Sep 2014 12:38:44 +0000 (08:38 -0400)
committerJeff Layton <jlayton@primarydata.com>
Tue, 7 Oct 2014 18:06:13 +0000 (14:06 -0400)
commit1b2b32dcdb3df28dd103033c73cac2417fa05845
tree3b7644aa3139516c4dbb78605362c15571fbc10f
parent6e129d00689c4d75253d1d428e82047b0aef5891
locks: fix fcntl_setlease/getlease return when !CONFIG_FILE_LOCKING

Currently they both just return 0. Fix them to return more appropriate
values instead.

For better or worse, most places in the kernel return -EINVAL when
leases aren't available. -ENOLCK would probably have been better, but
let's follow suit here in the case of F_SETLEASE.

In the F_GETLEASE case, just return F_UNLCK since we know that no
lease will have been set.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
include/linux/fs.h