From 89c8d00226d4222a8b72ccbca6752e09f0de84c7 Mon Sep 17 00:00:00 2001 From: Yoav Zach Date: Thu, 23 Jun 2005 00:09:58 -0700 Subject: [PATCH] --- yaml --- r: 2959 b: refs/heads/master c: ef3daeda7b58f046f94b26637d500354038d39f4 h: refs/heads/master i: 2957: 2c42c5eab6b995c04a9560e4f171fe95f9e99b77 2955: a7084aae28290ae9493796dbd4c11958840297be 2951: eec2f5160859ee0ab41f01b1b197f041c4cae5eb 2943: 08c14786d1ae166367c698e94f22ee9cd5da4a4b v: v3 --- [refs] | 2 +- trunk/fs/open.c | 7 ++++--- trunk/include/asm-ia64/fcntl.h | 2 ++ trunk/include/linux/fcntl.h | 4 ++++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 1d27c4781648..18eb1023c833 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 44e58a6a0bd604f46be9d808408a1cd880cc9b19 +refs/heads/master: ef3daeda7b58f046f94b26637d500354038d39f4 diff --git a/trunk/fs/open.c b/trunk/fs/open.c index 963bd81a44c8..2ebb72c1a876 100644 --- a/trunk/fs/open.c +++ b/trunk/fs/open.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -935,9 +936,9 @@ asmlinkage long sys_open(const char __user * filename, int flags, int mode) char * tmp; int fd, error; -#if BITS_PER_LONG != 32 - flags |= O_LARGEFILE; -#endif + if (force_o_largefile()) + flags |= O_LARGEFILE; + tmp = getname(filename); fd = PTR_ERR(tmp); if (!IS_ERR(tmp)) { diff --git a/trunk/include/asm-ia64/fcntl.h b/trunk/include/asm-ia64/fcntl.h index d193981bb1d8..c9f8d835d0cc 100644 --- a/trunk/include/asm-ia64/fcntl.h +++ b/trunk/include/asm-ia64/fcntl.h @@ -81,4 +81,6 @@ struct flock { #define F_LINUX_SPECIFIC_BASE 1024 +#define force_o_largefile() ( ! (current->personality & PER_LINUX32) ) + #endif /* _ASM_IA64_FCNTL_H */ diff --git a/trunk/include/linux/fcntl.h b/trunk/include/linux/fcntl.h index 704fb76b6334..8a7c82151de9 100644 --- a/trunk/include/linux/fcntl.h +++ b/trunk/include/linux/fcntl.h @@ -25,6 +25,10 @@ #ifdef __KERNEL__ +#ifndef force_o_largefile +#define force_o_largefile() (BITS_PER_LONG != 32) +#endif + #if BITS_PER_LONG == 32 #define IS_GETLK32(cmd) ((cmd) == F_GETLK) #define IS_SETLK32(cmd) ((cmd) == F_SETLK)