Commit 8a5b5f30 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] Allow for architectures to override

From:  Stephen Rothwell <sfr@canb.auug.org.au>

  This allows some architecture to override the generic implementations
  on {get,put}_compat_flock64 as some of them (ia64 and maybe x86_64)
  will take alignment faults when accessing the loff_t members of struct
  compat_flock64.

  Requested by David Mosberger, modified by Dave Miller.
parent 35b43769
...@@ -378,6 +378,7 @@ static int put_compat_flock(struct flock *kfl, struct compat_flock *ufl) ...@@ -378,6 +378,7 @@ static int put_compat_flock(struct flock *kfl, struct compat_flock *ufl)
return 0; return 0;
} }
#ifndef HAVE_ARCH_GET_COMPAT_FLOCK64
static int get_compat_flock64(struct flock *kfl, struct compat_flock64 *ufl) static int get_compat_flock64(struct flock *kfl, struct compat_flock64 *ufl)
{ {
if (!access_ok(VERIFY_READ, ufl, sizeof(*ufl)) || if (!access_ok(VERIFY_READ, ufl, sizeof(*ufl)) ||
...@@ -389,7 +390,9 @@ static int get_compat_flock64(struct flock *kfl, struct compat_flock64 *ufl) ...@@ -389,7 +390,9 @@ static int get_compat_flock64(struct flock *kfl, struct compat_flock64 *ufl)
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
#endif
#ifndef HAVE_ARCH_PUT_COMPAT_FLOCK64
static int put_compat_flock64(struct flock *kfl, struct compat_flock64 *ufl) static int put_compat_flock64(struct flock *kfl, struct compat_flock64 *ufl)
{ {
if (!access_ok(VERIFY_WRITE, ufl, sizeof(*ufl)) || if (!access_ok(VERIFY_WRITE, ufl, sizeof(*ufl)) ||
...@@ -401,6 +404,7 @@ static int put_compat_flock64(struct flock *kfl, struct compat_flock64 *ufl) ...@@ -401,6 +404,7 @@ static int put_compat_flock64(struct flock *kfl, struct compat_flock64 *ufl)
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
#endif
extern asmlinkage long sys_fcntl(unsigned int, unsigned int, unsigned long); extern asmlinkage long sys_fcntl(unsigned int, unsigned int, unsigned long);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment