mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-15 06:55:13 +08:00
08ee3a009f
Added __get/__put_kernel_nofault as preparation for removing get/set_fs. Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Reviewed-by: Christoph Hellwig <hch@lst.de>
11 lines
275 B
C
11 lines
275 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
#include <linux/uaccess.h>
|
|
#include <linux/kernel.h>
|
|
|
|
bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
|
|
{
|
|
/* highest bit set means kernel space */
|
|
return (unsigned long)unsafe_src >> (BITS_PER_LONG - 1);
|
|
}
|