mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Kernel 4.9 compat: file_operations->aio_fsync removal
Linux kernel commit 723c038475b78 removed this field. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: DHE <git@dehacked.net> Closes #5393
This commit is contained in:
committed by
Brian Behlendorf
parent
6146e17ebe
commit
7ca25051b6
@@ -130,12 +130,15 @@ zpl_fsync(struct file *filp, struct dentry *dentry, int datasync)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifdef HAVE_FILE_AIO_FSYNC
|
||||
static int
|
||||
zpl_aio_fsync(struct kiocb *kiocb, int datasync)
|
||||
{
|
||||
struct file *filp = kiocb->ki_filp;
|
||||
return (zpl_fsync(filp, file_dentry(filp), datasync));
|
||||
}
|
||||
#endif
|
||||
|
||||
#elif defined(HAVE_FSYNC_WITHOUT_DENTRY)
|
||||
/*
|
||||
* Linux 2.6.35 - 3.0 API,
|
||||
@@ -161,11 +164,14 @@ zpl_fsync(struct file *filp, int datasync)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifdef HAVE_FILE_AIO_FSYNC
|
||||
static int
|
||||
zpl_aio_fsync(struct kiocb *kiocb, int datasync)
|
||||
{
|
||||
return (zpl_fsync(kiocb->ki_filp, datasync));
|
||||
}
|
||||
#endif
|
||||
|
||||
#elif defined(HAVE_FSYNC_RANGE)
|
||||
/*
|
||||
* Linux 3.1 - 3.x API,
|
||||
@@ -196,11 +202,14 @@ zpl_fsync(struct file *filp, loff_t start, loff_t end, int datasync)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifdef HAVE_FILE_AIO_FSYNC
|
||||
static int
|
||||
zpl_aio_fsync(struct kiocb *kiocb, int datasync)
|
||||
{
|
||||
return (zpl_fsync(kiocb->ki_filp, kiocb->ki_pos, -1, datasync));
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
#error "Unsupported fops->fsync() implementation"
|
||||
#endif
|
||||
@@ -838,7 +847,9 @@ const struct file_operations zpl_file_operations = {
|
||||
#endif
|
||||
.mmap = zpl_mmap,
|
||||
.fsync = zpl_fsync,
|
||||
#ifdef HAVE_FILE_AIO_FSYNC
|
||||
.aio_fsync = zpl_aio_fsync,
|
||||
#endif
|
||||
#ifdef HAVE_FILE_FALLOCATE
|
||||
.fallocate = zpl_fallocate,
|
||||
#endif /* HAVE_FILE_FALLOCATE */
|
||||
|
||||
Reference in New Issue
Block a user