diff mbox series

linux-user: implement OFD locks

Message ID mvm7dx0cun3.fsf@suse.de
State New
Headers show
Series linux-user: implement OFD locks | expand

Commit Message

Andreas Schwab May 25, 2020, 7:59 a.m. UTC
Signed-off-by: Andreas Schwab <schwab@suse.de>
---
 linux-user/generic/fcntl.h | 4 ++++
 linux-user/syscall.c       | 6 ++++++
 2 files changed, 10 insertions(+)

Comments

Laurent Vivier May 28, 2020, 10:58 a.m. UTC | #1
Le 25/05/2020 à 09:59, Andreas Schwab a écrit :
> Signed-off-by: Andreas Schwab <schwab@suse.de>
> ---
>  linux-user/generic/fcntl.h | 4 ++++
>  linux-user/syscall.c       | 6 ++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/linux-user/generic/fcntl.h b/linux-user/generic/fcntl.h
> index 9f727d4df2..c85c5b9fed 100644
> --- a/linux-user/generic/fcntl.h
> +++ b/linux-user/generic/fcntl.h
> @@ -99,6 +99,10 @@
>  #define TARGET_F_SETLKW64      14
>  #endif
>  
> +#define TARGET_F_OFD_GETLK     36
> +#define TARGET_F_OFD_SETLK     37
> +#define TARGET_F_OFD_SETLKW    38
> +
>  #ifndef TARGET_F_SETOWN_EX
>  #define TARGET_F_SETOWN_EX     15
>  #define TARGET_F_GETOWN_EX     16
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 7eac6b7d47..492450e77d 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -6097,6 +6097,9 @@ static int target_to_host_fcntl_cmd(int cmd)
>      case TARGET_F_SETFD:
>      case TARGET_F_GETFL:
>      case TARGET_F_SETFL:
> +    case TARGET_F_OFD_GETLK:
> +    case TARGET_F_OFD_SETLK:
> +    case TARGET_F_OFD_SETLKW:
>          ret = cmd;
>          break;
>      case TARGET_F_GETLK:
> @@ -6382,6 +6385,7 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
>          break;
>  
>      case TARGET_F_GETLK64:
> +    case TARGET_F_OFD_GETLK:
>          ret = copy_from_user_flock64(&fl64, arg);
>          if (ret) {
>              return ret;
> @@ -6393,6 +6397,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
>          break;
>      case TARGET_F_SETLK64:
>      case TARGET_F_SETLKW64:
> +    case TARGET_F_OFD_SETLK:
> +    case TARGET_F_OFD_SETLKW:
>          ret = copy_from_user_flock64(&fl64, arg);
>          if (ret) {
>              return ret;
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Laurent Vivier May 28, 2020, 11 a.m. UTC | #2
Le 25/05/2020 à 09:59, Andreas Schwab a écrit :
> Signed-off-by: Andreas Schwab <schwab@suse.de>
> ---
>  linux-user/generic/fcntl.h | 4 ++++
>  linux-user/syscall.c       | 6 ++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/linux-user/generic/fcntl.h b/linux-user/generic/fcntl.h
> index 9f727d4df2..c85c5b9fed 100644
> --- a/linux-user/generic/fcntl.h
> +++ b/linux-user/generic/fcntl.h
> @@ -99,6 +99,10 @@
>  #define TARGET_F_SETLKW64      14
>  #endif
>  
> +#define TARGET_F_OFD_GETLK     36
> +#define TARGET_F_OFD_SETLK     37
> +#define TARGET_F_OFD_SETLKW    38
> +
>  #ifndef TARGET_F_SETOWN_EX
>  #define TARGET_F_SETOWN_EX     15
>  #define TARGET_F_GETOWN_EX     16
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 7eac6b7d47..492450e77d 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -6097,6 +6097,9 @@ static int target_to_host_fcntl_cmd(int cmd)
>      case TARGET_F_SETFD:
>      case TARGET_F_GETFL:
>      case TARGET_F_SETFL:
> +    case TARGET_F_OFD_GETLK:
> +    case TARGET_F_OFD_SETLK:
> +    case TARGET_F_OFD_SETLKW:
>          ret = cmd;
>          break;
>      case TARGET_F_GETLK:
> @@ -6382,6 +6385,7 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
>          break;
>  
>      case TARGET_F_GETLK64:
> +    case TARGET_F_OFD_GETLK:
>          ret = copy_from_user_flock64(&fl64, arg);
>          if (ret) {
>              return ret;
> @@ -6393,6 +6397,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
>          break;
>      case TARGET_F_SETLK64:
>      case TARGET_F_SETLKW64:
> +    case TARGET_F_OFD_SETLK:
> +    case TARGET_F_OFD_SETLKW:
>          ret = copy_from_user_flock64(&fl64, arg);
>          if (ret) {
>              return ret;
> 

Applied to my linux-user branch.

Thanks,
Laurent
diff mbox series

Patch

diff --git a/linux-user/generic/fcntl.h b/linux-user/generic/fcntl.h
index 9f727d4df2..c85c5b9fed 100644
--- a/linux-user/generic/fcntl.h
+++ b/linux-user/generic/fcntl.h
@@ -99,6 +99,10 @@ 
 #define TARGET_F_SETLKW64      14
 #endif
 
+#define TARGET_F_OFD_GETLK     36
+#define TARGET_F_OFD_SETLK     37
+#define TARGET_F_OFD_SETLKW    38
+
 #ifndef TARGET_F_SETOWN_EX
 #define TARGET_F_SETOWN_EX     15
 #define TARGET_F_GETOWN_EX     16
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 7eac6b7d47..492450e77d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6097,6 +6097,9 @@  static int target_to_host_fcntl_cmd(int cmd)
     case TARGET_F_SETFD:
     case TARGET_F_GETFL:
     case TARGET_F_SETFL:
+    case TARGET_F_OFD_GETLK:
+    case TARGET_F_OFD_SETLK:
+    case TARGET_F_OFD_SETLKW:
         ret = cmd;
         break;
     case TARGET_F_GETLK:
@@ -6382,6 +6385,7 @@  static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
         break;
 
     case TARGET_F_GETLK64:
+    case TARGET_F_OFD_GETLK:
         ret = copy_from_user_flock64(&fl64, arg);
         if (ret) {
             return ret;
@@ -6393,6 +6397,8 @@  static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
         break;
     case TARGET_F_SETLK64:
     case TARGET_F_SETLKW64:
+    case TARGET_F_OFD_SETLK:
+    case TARGET_F_OFD_SETLKW:
         ret = copy_from_user_flock64(&fl64, arg);
         if (ret) {
             return ret;