Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please change both vfs_read & vfs_write for recent linux kernels 4.14 >= #35

Open
adamchilcott opened this issue Feb 10, 2018 · 1 comment

Comments

@adamchilcott
Copy link

adamchilcott commented Feb 10, 2018

return vfs_read(osfd, pDataPtr, readLen, &osfd->f_pos);

Swapping out vfs_read & vfs_write for kernel_read & kernel_write respectively solves most of my problems under Arch and the latest LTS kernel Linux 4.14.16-1-MANJARO. Hey, at least I can connect now!

Output from dmesg is positive. Blinking LED lights functional! Always a bonus of course.

I'm not sure, but this change may break compatibility with older kernels, if prior compatibility is an aim for this project.

Best,

Adam.

@adamchilcott adamchilcott changed the title Please change both vfs_read & vfs_write for newer kernels 4.14 >= Please change both vfs_read & vfs_write for recent linux kernels 4.14 >= Feb 10, 2018
@rasdotsu
Copy link

diff --git a/os/linux/rt_linux.c b/os/linux/rt_linux.c
index 581227a..55fc66b 100644
--- a/os/linux/rt_linux.c
+++ b/os/linux/rt_linux.c
@@ -1087,7 +1087,7 @@ int RtmpOSFileRead(RTMP_OS_FD osfd, char *pDataPtr, int readLen)
                return osfd->f_op->read(osfd, pDataPtr, readLen, &osfd->f_pos);
        } else {
                DBGPRINT(RT_DEBUG_ERROR, ("no file read method, using vfs_read\n"));
-               return vfs_read(osfd, pDataPtr, readLen, &osfd->f_pos);
+               return kernel_read(osfd, pDataPtr, readLen, &osfd->f_pos);
        }
 }
 
@@ -1097,7 +1097,7 @@ int RtmpOSFileWrite(RTMP_OS_FD osfd, char *pDataPtr, int writeLen)
                return osfd->f_op->write(osfd, pDataPtr, (size_t) writeLen, &osfd->f_pos);
        } else {
                DBGPRINT(RT_DEBUG_ERROR, ("no file write method, using vfs_write\n"));
-               return vfs_write(osfd, pDataPtr, (size_t) writeLen, &osfd->f_pos);
+               return kernel_write(osfd, pDataPtr, (size_t) writeLen, &osfd->f_pos);
        }
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants