affs: add mount option to avoid filename truncates
[linux.git] / fs / fcntl.c
index ef6866592a0f68c390f2ecededd785fb21e4a659..9ead1596399a12ef66ecf5f087b59463424ccf5d 100644 (file)
@@ -272,9 +272,19 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
        case F_SETFL:
                err = setfl(fd, filp, arg);
                break;
+#if BITS_PER_LONG != 32
+       /* 32-bit arches must use fcntl64() */
+       case F_GETLKP:
+#endif
        case F_GETLK:
-               err = fcntl_getlk(filp, (struct flock __user *) arg);
+               err = fcntl_getlk(filp, cmd, (struct flock __user *) arg);
                break;
+#if BITS_PER_LONG != 32
+       /* 32-bit arches must use fcntl64() */
+       case F_SETLKP:
+       case F_SETLKPW:
+#endif
+               /* Fallthrough */
        case F_SETLK:
        case F_SETLKW:
                err = fcntl_setlk(fd, filp, cmd, (struct flock __user *) arg);
@@ -388,17 +398,20 @@ SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
                goto out1;
        
        switch (cmd) {
-               case F_GETLK64:
-                       err = fcntl_getlk64(f.file, (struct flock64 __user *) arg);
-                       break;
-               case F_SETLK64:
-               case F_SETLKW64:
-                       err = fcntl_setlk64(fd, f.file, cmd,
-                                       (struct flock64 __user *) arg);
-                       break;
-               default:
-                       err = do_fcntl(fd, cmd, arg, f.file);
-                       break;
+       case F_GETLK64:
+       case F_GETLKP:
+               err = fcntl_getlk64(f.file, cmd, (struct flock64 __user *) arg);
+               break;
+       case F_SETLK64:
+       case F_SETLKW64:
+       case F_SETLKP:
+       case F_SETLKPW:
+               err = fcntl_setlk64(fd, f.file, cmd,
+                               (struct flock64 __user *) arg);
+               break;
+       default:
+               err = do_fcntl(fd, cmd, arg, f.file);
+               break;
        }
 out1:
        fdput(f);