aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/fcntl.c4
-rw-r--r--fs/locks.c4
-rw-r--r--include/linux/fs.h10
3 files changed, 10 insertions, 8 deletions
diff --git a/fs/fcntl.c b/fs/fcntl.c
index ef6866592a0f..7ef7f2d2b608 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -273,7 +273,7 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
273 err = setfl(fd, filp, arg); 273 err = setfl(fd, filp, arg);
274 break; 274 break;
275 case F_GETLK: 275 case F_GETLK:
276 err = fcntl_getlk(filp, (struct flock __user *) arg); 276 err = fcntl_getlk(filp, cmd, (struct flock __user *) arg);
277 break; 277 break;
278 case F_SETLK: 278 case F_SETLK:
279 case F_SETLKW: 279 case F_SETLKW:
@@ -389,7 +389,7 @@ SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
389 389
390 switch (cmd) { 390 switch (cmd) {
391 case F_GETLK64: 391 case F_GETLK64:
392 err = fcntl_getlk64(f.file, (struct flock64 __user *) arg); 392 err = fcntl_getlk64(f.file, cmd, (struct flock64 __user *) arg);
393 break; 393 break;
394 case F_SETLK64: 394 case F_SETLK64:
395 case F_SETLKW64: 395 case F_SETLKW64:
diff --git a/fs/locks.c b/fs/locks.c
index 57f1d5fc876a..442052b413af 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1898,7 +1898,7 @@ static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl)
1898/* Report the first existing lock that would conflict with l. 1898/* Report the first existing lock that would conflict with l.
1899 * This implements the F_GETLK command of fcntl(). 1899 * This implements the F_GETLK command of fcntl().
1900 */ 1900 */
1901int fcntl_getlk(struct file *filp, struct flock __user *l) 1901int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock __user *l)
1902{ 1902{
1903 struct file_lock file_lock; 1903 struct file_lock file_lock;
1904 struct flock flock; 1904 struct flock flock;
@@ -2066,7 +2066,7 @@ out:
2066/* Report the first existing lock that would conflict with l. 2066/* Report the first existing lock that would conflict with l.
2067 * This implements the F_GETLK command of fcntl(). 2067 * This implements the F_GETLK command of fcntl().
2068 */ 2068 */
2069int fcntl_getlk64(struct file *filp, struct flock64 __user *l) 2069int fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 __user *l)
2070{ 2070{
2071 struct file_lock file_lock; 2071 struct file_lock file_lock;
2072 struct flock64 flock; 2072 struct flock64 flock;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5ddeb8de5e77..ae91dce8a547 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -993,12 +993,12 @@ struct file_lock {
993extern void send_sigio(struct fown_struct *fown, int fd, int band); 993extern void send_sigio(struct fown_struct *fown, int fd, int band);
994 994
995#ifdef CONFIG_FILE_LOCKING 995#ifdef CONFIG_FILE_LOCKING
996extern int fcntl_getlk(struct file *, struct flock __user *); 996extern int fcntl_getlk(struct file *, unsigned int, struct flock __user *);
997extern int fcntl_setlk(unsigned int, struct file *, unsigned int, 997extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
998 struct flock __user *); 998 struct flock __user *);
999 999
1000#if BITS_PER_LONG == 32 1000#if BITS_PER_LONG == 32
1001extern int fcntl_getlk64(struct file *, struct flock64 __user *); 1001extern int fcntl_getlk64(struct file *, unsigned int, struct flock64 __user *);
1002extern int fcntl_setlk64(unsigned int, struct file *, unsigned int, 1002extern int fcntl_setlk64(unsigned int, struct file *, unsigned int,
1003 struct flock64 __user *); 1003 struct flock64 __user *);
1004#endif 1004#endif
@@ -1031,7 +1031,8 @@ extern int lease_modify(struct file_lock **, int);
1031extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 1031extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
1032extern int lock_may_write(struct inode *, loff_t start, unsigned long count); 1032extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
1033#else /* !CONFIG_FILE_LOCKING */ 1033#else /* !CONFIG_FILE_LOCKING */
1034static inline int fcntl_getlk(struct file *file, struct flock __user *user) 1034static inline int fcntl_getlk(struct file *file, unsigned int cmd,
1035 struct flock __user *user)
1035{ 1036{
1036 return -EINVAL; 1037 return -EINVAL;
1037} 1038}
@@ -1043,7 +1044,8 @@ static inline int fcntl_setlk(unsigned int fd, struct file *file,
1043} 1044}
1044 1045
1045#if BITS_PER_LONG == 32 1046#if BITS_PER_LONG == 32
1046static inline int fcntl_getlk64(struct file *file, struct flock64 __user *user) 1047static inline int fcntl_getlk64(struct file *file, unsigned int cmd,
1048 struct flock64 __user *user)
1047{ 1049{
1048 return -EINVAL; 1050 return -EINVAL;
1049} 1051}