mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
fix compat truncate/ftruncate
Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
561c673197
commit
3f6d078d4a
11 changed files with 29 additions and 35 deletions
15
fs/open.c
15
fs/open.c
|
|
@ -30,6 +30,7 @@
|
|||
#include <linux/fs_struct.h>
|
||||
#include <linux/ima.h>
|
||||
#include <linux/dnotify.h>
|
||||
#include <linux/compat.h>
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
|
|
@ -140,6 +141,13 @@ SYSCALL_DEFINE2(truncate, const char __user *, path, long, length)
|
|||
return do_sys_truncate(path, length);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
COMPAT_SYSCALL_DEFINE2(truncate, const char __user *, path, compat_off_t, length)
|
||||
{
|
||||
return do_sys_truncate(path, length);
|
||||
}
|
||||
#endif
|
||||
|
||||
static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
|
||||
{
|
||||
struct inode *inode;
|
||||
|
|
@ -195,6 +203,13 @@ SYSCALL_DEFINE2(ftruncate, unsigned int, fd, unsigned long, length)
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
COMPAT_SYSCALL_DEFINE2(ftruncate, unsigned int, fd, compat_ulong_t, length)
|
||||
{
|
||||
return do_sys_ftruncate(fd, length, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* LFS versions of truncate are only needed on 32 bit machines */
|
||||
#if BITS_PER_LONG == 32
|
||||
SYSCALL_DEFINE(truncate64)(const char __user * path, loff_t length)
|
||||
|
|
|
|||
Loading…
Reference in a new issue