mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 19:57:43 +03:00
RHEL 7.5 compat: FMODE_KABI_ITERATE
As of RHEL 7.5 the mainline fops.iterate() method was added to the file_operations structure and is correctly detected by the configure script. Normally this is what we want, but in order to maintain KABI compatibility the RHEL change additionally does the following: * Requires that callers intending to use this extended interface set the FMODE_KABI_ITERATE flag on the file structure when opening the directory. * Adds the fops.iterate() method to the end of the structure, without removing fops.readdir(). This change updates the configure check to ignore the RHEL 7.5+ variant of fops.iterate() when detected. Instead fallback to the fops.readdir() interface which will be available. Finally, add the 'zpl_' prefix to the directory context wrappers to avoid colliding with the kernel provided symbols when both the fops.iterate() and fops.readdir() are provided by the kernel. Reviewed-by: Olaf Faaland <faaland1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #7460 Closes #7463
This commit is contained in:
@@ -2273,7 +2273,7 @@ out:
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
zfs_readdir(struct inode *ip, struct dir_context *ctx, cred_t *cr)
|
||||
zfs_readdir(struct inode *ip, zpl_dir_context_t *ctx, cred_t *cr)
|
||||
{
|
||||
znode_t *zp = ITOZ(ip);
|
||||
zfsvfs_t *zfsvfs = ITOZSB(ip);
|
||||
@@ -2378,7 +2378,7 @@ zfs_readdir(struct inode *ip, struct dir_context *ctx, cred_t *cr)
|
||||
type = ZFS_DIRENT_TYPE(zap.za_first_integer);
|
||||
}
|
||||
|
||||
done = !dir_emit(ctx, zap.za_name, strlen(zap.za_name),
|
||||
done = !zpl_dir_emit(ctx, zap.za_name, strlen(zap.za_name),
|
||||
objnum, type);
|
||||
if (done)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user