summaryrefslogtreecommitdiff
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-09-24 16:38:44 +0400
committerJeff Layton <jlayton@primarydata.com>2014-10-07 22:06:13 +0400
commit1b2b32dcdb3df28dd103033c73cac2417fa05845 (patch)
tree3b7644aa3139516c4dbb78605362c15571fbc10f /include/linux/fs.h
parent6e129d00689c4d75253d1d428e82047b0aef5891 (diff)
downloadlinux-1b2b32dcdb3df28dd103033c73cac2417fa05845.tar.xz
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>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index bb9484ae1eef..2023306c620e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1008,12 +1008,12 @@ static inline int fcntl_setlk64(unsigned int fd, struct file *file,
#endif
static inline int fcntl_setlease(unsigned int fd, struct file *filp, long arg)
{
- return 0;
+ return -EINVAL;
}
static inline int fcntl_getlease(struct file *filp)
{
- return 0;
+ return F_UNLCK;
}
static inline void locks_init_lock(struct file_lock *fl)