Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:frispete:kernel
lime-kmp
lime-fix-5.10.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File lime-fix-5.10.patch of Package lime-kmp
Index: b/src/disk.c =================================================================== --- a/src/disk.c +++ b/src/disk.c @@ -43,12 +43,14 @@ static int dio_write_test(char *path, in } int setup_disk(char *path, int dio) { - mm_segment_t fs; int oflags; int err; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) + mm_segment_t fs; fs = get_fs(); set_fs(KERNEL_DS); +#endif oflags = O_WRONLY | O_CREAT | O_LARGEFILE | O_TRUNC; @@ -62,34 +64,43 @@ int setup_disk(char *path, int dio) { if (!f || IS_ERR(f)) { DBG("Error opening file %ld", PTR_ERR(f)); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) set_fs(fs); +#endif err = (f) ? PTR_ERR(f) : -EIO; f = NULL; return err; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) set_fs(fs); +#endif return 0; } void cleanup_disk(void) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) mm_segment_t fs; fs = get_fs(); set_fs(KERNEL_DS); +#endif if(f) filp_close(f, NULL); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) set_fs(fs); +#endif } ssize_t write_vaddr_disk(void * v, size_t is) { - mm_segment_t fs; - ssize_t s; loff_t pos; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) + mm_segment_t fs; fs = get_fs(); set_fs(KERNEL_DS); +#endif pos = f->f_pos; @@ -103,7 +114,9 @@ ssize_t write_vaddr_disk(void * v, size_ f->f_pos = pos; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) set_fs(fs); +#endif return s; } Index: b/src/tcp.c =================================================================== --- a/src/tcp.c +++ b/src/tcp.c @@ -46,9 +46,13 @@ static struct socket *accept; int setup_tcp() { struct sockaddr_in saddr; - int r, opt; - + int r; +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0) + int opt; +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) mm_segment_t fs; +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) r = sock_create_kern(&init_net, AF_INET, SOCK_STREAM, IPPROTO_TCP, &control); @@ -73,9 +77,10 @@ int setup_tcp() { saddr.sin_addr.s_addr = htonl(INADDR_ANY); } - +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) fs = get_fs(); set_fs(KERNEL_DS); +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) sock_set_reuseaddr(control->sk); @@ -84,12 +89,17 @@ int setup_tcp() { r = kernel_setsockopt(control, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof (opt)); if (r < 0) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) + set_fs(fs); +#endif DBG("Error setting socket options"); return r; } #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) set_fs(fs); +#endif r = kernel_bind(control,(struct sockaddr*) &saddr,sizeof(saddr)); if (r < 0) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor