diff options
Diffstat (limited to 'arch/powerpc/kernel/sys_ppc32.c')
-rw-r--r-- | arch/powerpc/kernel/sys_ppc32.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c index 709f8cb8bfca..d98634c76060 100644 --- a/arch/powerpc/kernel/sys_ppc32.c +++ b/arch/powerpc/kernel/sys_ppc32.c | |||
@@ -52,63 +52,6 @@ | |||
52 | #include <asm/ppc-pci.h> | 52 | #include <asm/ppc-pci.h> |
53 | #include <asm/syscalls.h> | 53 | #include <asm/syscalls.h> |
54 | 54 | ||
55 | struct old_linux_dirent32 { | ||
56 | u32 d_ino; | ||
57 | u32 d_offset; | ||
58 | unsigned short d_namlen; | ||
59 | char d_name[1]; | ||
60 | }; | ||
61 | |||
62 | struct readdir_callback32 { | ||
63 | struct old_linux_dirent32 __user * dirent; | ||
64 | int count; | ||
65 | }; | ||
66 | |||
67 | static int fillonedir(void * __buf, const char * name, int namlen, | ||
68 | off_t offset, u64 ino, unsigned int d_type) | ||
69 | { | ||
70 | struct readdir_callback32 * buf = (struct readdir_callback32 *) __buf; | ||
71 | struct old_linux_dirent32 __user * dirent; | ||
72 | ino_t d_ino; | ||
73 | |||
74 | if (buf->count) | ||
75 | return -EINVAL; | ||
76 | d_ino = ino; | ||
77 | if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) | ||
78 | return -EOVERFLOW; | ||
79 | buf->count++; | ||
80 | dirent = buf->dirent; | ||
81 | put_user(d_ino, &dirent->d_ino); | ||
82 | put_user(offset, &dirent->d_offset); | ||
83 | put_user(namlen, &dirent->d_namlen); | ||
84 | copy_to_user(dirent->d_name, name, namlen); | ||
85 | put_user(0, dirent->d_name + namlen); | ||
86 | return 0; | ||
87 | } | ||
88 | |||
89 | asmlinkage int old32_readdir(unsigned int fd, struct old_linux_dirent32 __user *dirent, unsigned int count) | ||
90 | { | ||
91 | int error = -EBADF; | ||
92 | struct file * file; | ||
93 | struct readdir_callback32 buf; | ||
94 | |||
95 | file = fget(fd); | ||
96 | if (!file) | ||
97 | goto out; | ||
98 | |||
99 | buf.count = 0; | ||
100 | buf.dirent = dirent; | ||
101 | |||
102 | error = vfs_readdir(file, (filldir_t)fillonedir, &buf); | ||
103 | if (error < 0) | ||
104 | goto out_putf; | ||
105 | error = buf.count; | ||
106 | |||
107 | out_putf: | ||
108 | fput(file); | ||
109 | out: | ||
110 | return error; | ||
111 | } | ||
112 | 55 | ||
113 | asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp, | 56 | asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp, |
114 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, | 57 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, |