aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2005-09-06 18:18:25 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-07 19:57:43 -0400
commite922efc342d565a38eed3af377ff403f52148864 (patch)
treeb9996a96ed1bbb6e387f7ba8216f8e43ca640398 /fs
parentab8d11beb46f0bd0617e04205c01f5c1fe845b61 (diff)
[PATCH] remove duplicated sys_open32() code from 64bit archs
64 bit architectures all implement their own compatibility sys_open(), when in fact the difference is simply not forcing the O_LARGEFILE flag. So use the a common function instead. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Cc: <viro@parcelfarce.linux.theplanet.co.uk> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/compat.c10
-rw-r--r--fs/open.c19
2 files changed, 21 insertions, 8 deletions
diff --git a/fs/compat.c b/fs/compat.c
index 2eb03c49b07c..8c665705c6a0 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1275,6 +1275,16 @@ out:
1275} 1275}
1276 1276
1277/* 1277/*
1278 * Exactly like fs/open.c:sys_open(), except that it doesn't set the
1279 * O_LARGEFILE flag.
1280 */
1281asmlinkage long
1282compat_sys_open(const char __user *filename, int flags, int mode)
1283{
1284 return do_sys_open(filename, flags, mode);
1285}
1286
1287/*
1278 * compat_count() counts the number of arguments/envelopes. It is basically 1288 * compat_count() counts the number of arguments/envelopes. It is basically
1279 * a copy of count() from fs/exec.c, except that it works with 32 bit argv 1289 * a copy of count() from fs/exec.c, except that it works with 32 bit argv
1280 * and envp pointers. 1290 * and envp pointers.
diff --git a/fs/open.c b/fs/open.c
index 32bf05e2996d..4ee2dcc31c28 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -933,16 +933,11 @@ void fastcall fd_install(unsigned int fd, struct file * file)
933 933
934EXPORT_SYMBOL(fd_install); 934EXPORT_SYMBOL(fd_install);
935 935
936asmlinkage long sys_open(const char __user * filename, int flags, int mode) 936long do_sys_open(const char __user *filename, int flags, int mode)
937{ 937{
938 char * tmp; 938 char *tmp = getname(filename);
939 int fd; 939 int fd = PTR_ERR(tmp);
940 940
941 if (force_o_largefile())
942 flags |= O_LARGEFILE;
943
944 tmp = getname(filename);
945 fd = PTR_ERR(tmp);
946 if (!IS_ERR(tmp)) { 941 if (!IS_ERR(tmp)) {
947 fd = get_unused_fd(); 942 fd = get_unused_fd();
948 if (fd >= 0) { 943 if (fd >= 0) {
@@ -959,6 +954,14 @@ asmlinkage long sys_open(const char __user * filename, int flags, int mode)
959 } 954 }
960 return fd; 955 return fd;
961} 956}
957
958asmlinkage long sys_open(const char __user *filename, int flags, int mode)
959{
960 if (force_o_largefile())
961 flags |= O_LARGEFILE;
962
963 return do_sys_open(filename, flags, mode);
964}
962EXPORT_SYMBOL_GPL(sys_open); 965EXPORT_SYMBOL_GPL(sys_open);
963 966
964#ifndef __alpha__ 967#ifndef __alpha__