[PATCH][COMPAT] move struct flock32 3/8 sparc64

From: Stephen Rothwell (sfr@canb.auug.org.au)
Date: Fri Jan 03 2003 - 01:21:18 EST


Hi Dave,

Here is the sparc64 specific part. This patch is against Linus' recent
2.5.54 BK plus the previous patch I sent you.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.54-200301031304-32bit.1/arch/sparc64/kernel/sys_sparc32.c 2.5.54-200301031304-32bit.2/arch/sparc64/kernel/sys_sparc32.c --- 2.5.54-200301031304-32bit.1/arch/sparc64/kernel/sys_sparc32.c 2003-01-03 16:24:15.000000000 +1100 +++ 2.5.54-200301031304-32bit.2/arch/sparc64/kernel/sys_sparc32.c 2003-01-03 16:24:56.000000000 +1100 @@ -804,30 +804,6 @@ return err; } -static inline int get_flock(struct flock *kfl, struct flock32 *ufl) -{ - int err; - - err = get_user(kfl->l_type, &ufl->l_type); - err |= __get_user(kfl->l_whence, &ufl->l_whence); - err |= __get_user(kfl->l_start, &ufl->l_start); - err |= __get_user(kfl->l_len, &ufl->l_len); - err |= __get_user(kfl->l_pid, &ufl->l_pid); - return err; -} - -static inline int put_flock(struct flock *kfl, struct flock32 *ufl) -{ - int err; - - err = __put_user(kfl->l_type, &ufl->l_type); - err |= __put_user(kfl->l_whence, &ufl->l_whence); - err |= __put_user(kfl->l_start, &ufl->l_start); - err |= __put_user(kfl->l_len, &ufl->l_len); - err |= __put_user(kfl->l_pid, &ufl->l_pid); - return err; -} - extern asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg); asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg) @@ -841,13 +817,13 @@ mm_segment_t old_fs; long ret; - if (get_flock(&f, (struct flock32 *)arg)) + if (get_compat_flock(&f, (struct compat_flock *)arg)) return -EFAULT; old_fs = get_fs(); set_fs (KERNEL_DS); ret = sys_fcntl(fd, cmd, (unsigned long)&f); set_fs (old_fs); if (ret) return ret; - if (put_flock(&f, (struct flock32 *)arg)) + if (put_compat_flock(&f, (struct compat_flock *)arg)) return -EFAULT; return 0; } diff -ruN 2.5.54-200301031304-32bit.1/include/asm-sparc64/compat.h 2.5.54-200301031304-32bit.2/include/asm-sparc64/compat.h --- 2.5.54-200301031304-32bit.1/include/asm-sparc64/compat.h 2003-01-03 16:24:15.000000000 +1100 +++ 2.5.54-200301031304-32bit.2/include/asm-sparc64/compat.h 2003-01-03 16:24:56.000000000 +1100 @@ -55,4 +55,13 @@ u32 __unused4[2]; }; +struct compat_flock { + short l_type; + short l_whence; + compat_off_t l_start; + compat_off_t l_len; + compat_pid_t l_pid; + short __unused; +}; + #endif /* _ASM_SPARC64_COMPAT_H */ diff -ruN 2.5.54-200301031304-32bit.1/include/asm-sparc64/fcntl.h 2.5.54-200301031304-32bit.2/include/asm-sparc64/fcntl.h --- 2.5.54-200301031304-32bit.1/include/asm-sparc64/fcntl.h 2003-01-03 16:24:15.000000000 +1100 +++ 2.5.54-200301031304-32bit.2/include/asm-sparc64/fcntl.h 2003-01-03 16:24:56.000000000 +1100 @@ -79,19 +79,6 @@ }; #ifdef __KERNEL__ -#include <linux/compat.h> - -struct flock32 { - short l_type; - short l_whence; - compat_off_t l_start; - compat_off_t l_len; - compat_pid_t l_pid; - short __unused; -}; -#endif - -#ifdef __KERNEL__ #define flock64 flock #endif - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jan 07 2003 - 22:00:20 EST