diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-25 02:21:52 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-25 04:20:03 -0500 |
commit | 3255aa2eb636a508fc82a73fabbb8aaf2ff23c0f (patch) | |
tree | 2a602fb8f4fefe666e8daedf1e1f755800bd700a /arch | |
parent | 95f66b3770d6d0755b4a2d818c237574ffd74e4c (diff) |
x86, mm: pass in 'total' to __copy_from_user_*nocache()
Impact: cleanup, enable future change
Add a 'total bytes copied' parameter to __copy_from_user_*nocache(),
and update all the callsites.
The parameter is not used yet - architecture code can use it to
more intelligently decide whether the copy should be cached or
non-temporal.
Cc: Salman Qazi <sqazi@google.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/uaccess_32.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/uaccess_64.h | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h index 5e06259e90e5..a0ba61386972 100644 --- a/arch/x86/include/asm/uaccess_32.h +++ b/arch/x86/include/asm/uaccess_32.h | |||
@@ -157,7 +157,7 @@ __copy_from_user(void *to, const void __user *from, unsigned long n) | |||
157 | } | 157 | } |
158 | 158 | ||
159 | static __always_inline unsigned long __copy_from_user_nocache(void *to, | 159 | static __always_inline unsigned long __copy_from_user_nocache(void *to, |
160 | const void __user *from, unsigned long n) | 160 | const void __user *from, unsigned long n, unsigned long total) |
161 | { | 161 | { |
162 | might_fault(); | 162 | might_fault(); |
163 | if (__builtin_constant_p(n)) { | 163 | if (__builtin_constant_p(n)) { |
@@ -180,7 +180,7 @@ static __always_inline unsigned long __copy_from_user_nocache(void *to, | |||
180 | 180 | ||
181 | static __always_inline unsigned long | 181 | static __always_inline unsigned long |
182 | __copy_from_user_inatomic_nocache(void *to, const void __user *from, | 182 | __copy_from_user_inatomic_nocache(void *to, const void __user *from, |
183 | unsigned long n) | 183 | unsigned long n, unsigned long total) |
184 | { | 184 | { |
185 | return __copy_from_user_ll_nocache_nozero(to, from, n); | 185 | return __copy_from_user_ll_nocache_nozero(to, from, n); |
186 | } | 186 | } |
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h index 987a2c10fe20..a748253db0c9 100644 --- a/arch/x86/include/asm/uaccess_64.h +++ b/arch/x86/include/asm/uaccess_64.h | |||
@@ -189,7 +189,7 @@ extern long __copy_user_nocache(void *dst, const void __user *src, | |||
189 | unsigned size, int zerorest); | 189 | unsigned size, int zerorest); |
190 | 190 | ||
191 | static inline int __copy_from_user_nocache(void *dst, const void __user *src, | 191 | static inline int __copy_from_user_nocache(void *dst, const void __user *src, |
192 | unsigned size) | 192 | unsigned size, unsigned long total) |
193 | { | 193 | { |
194 | might_sleep(); | 194 | might_sleep(); |
195 | /* | 195 | /* |
@@ -205,8 +205,7 @@ static inline int __copy_from_user_nocache(void *dst, const void __user *src, | |||
205 | } | 205 | } |
206 | 206 | ||
207 | static inline int __copy_from_user_inatomic_nocache(void *dst, | 207 | static inline int __copy_from_user_inatomic_nocache(void *dst, |
208 | const void __user *src, | 208 | const void __user *src, unsigned size, unsigned total) |
209 | unsigned size) | ||
210 | { | 209 | { |
211 | if (likely(size >= PAGE_SIZE)) | 210 | if (likely(size >= PAGE_SIZE)) |
212 | return __copy_user_nocache(dst, src, size, 0); | 211 | return __copy_user_nocache(dst, src, size, 0); |