Support symlinks in kernels that expect .readlink

Starting with kernel version 4.10, a NULL value for the ->readlink()
method defaults to generic_readlink(), or to a similar codepath.  For
older kernels this field must be set explicitly, otherwise the readlink
syscall will fail.

Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
This commit is contained in:
Ernesto A. Fernández
2019-03-03 21:49:43 -03:00
parent 72e6425af6
commit 50dba078e8
+3
View File
@@ -64,4 +64,7 @@ const struct inode_operations apfs_symlink_inode_operations = {
.get_link = apfs_get_link, .get_link = apfs_get_link,
.getattr = apfs_getattr, .getattr = apfs_getattr,
.listxattr = apfs_listxattr, .listxattr = apfs_listxattr,
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) /* Now this is the default */
.readlink = generic_readlink,
#endif
}; };