mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
config: remove HAVE_KERNEL_(READ|WRITE)_PPOS
Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #16479
This commit is contained in:
@@ -623,26 +623,6 @@ ddi_copyout(const void *from, void *to, size_t len, int flags)
|
||||
}
|
||||
EXPORT_SYMBOL(ddi_copyout);
|
||||
|
||||
static ssize_t
|
||||
spl_kernel_read(struct file *file, void *buf, size_t count, loff_t *pos)
|
||||
{
|
||||
#if defined(HAVE_KERNEL_READ_PPOS)
|
||||
return (kernel_read(file, buf, count, pos));
|
||||
#else
|
||||
mm_segment_t saved_fs;
|
||||
ssize_t ret;
|
||||
|
||||
saved_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
ret = vfs_read(file, (void __user *)buf, count, pos);
|
||||
|
||||
set_fs(saved_fs);
|
||||
|
||||
return (ret);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
spl_getattr(struct file *filp, struct kstat *stat)
|
||||
{
|
||||
@@ -730,7 +710,7 @@ hostid_read(uint32_t *hostid)
|
||||
* Read directly into the variable like eglibc does.
|
||||
* Short reads are okay; native behavior is preserved.
|
||||
*/
|
||||
error = spl_kernel_read(filp, &value, sizeof (value), &off);
|
||||
error = kernel_read(filp, &value, sizeof (value), &off);
|
||||
if (error < 0) {
|
||||
filp_close(filp, 0);
|
||||
return (EIO);
|
||||
|
||||
@@ -69,26 +69,6 @@ zfs_file_close(zfs_file_t *fp)
|
||||
filp_close(fp, 0);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
zfs_file_write_impl(zfs_file_t *fp, const void *buf, size_t count, loff_t *off)
|
||||
{
|
||||
#if defined(HAVE_KERNEL_WRITE_PPOS)
|
||||
return (kernel_write(fp, buf, count, off));
|
||||
#else
|
||||
mm_segment_t saved_fs;
|
||||
ssize_t rc;
|
||||
|
||||
saved_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
rc = vfs_write(fp, (__force const char __user __user *)buf, count, off);
|
||||
|
||||
set_fs(saved_fs);
|
||||
|
||||
return (rc);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Stateful write - use os internal file pointer to determine where to
|
||||
* write and update on successful completion.
|
||||
@@ -106,7 +86,7 @@ zfs_file_write(zfs_file_t *fp, const void *buf, size_t count, ssize_t *resid)
|
||||
loff_t off = fp->f_pos;
|
||||
ssize_t rc;
|
||||
|
||||
rc = zfs_file_write_impl(fp, buf, count, &off);
|
||||
rc = kernel_write(fp, buf, count, &off);
|
||||
if (rc < 0)
|
||||
return (-rc);
|
||||
|
||||
@@ -138,7 +118,7 @@ zfs_file_pwrite(zfs_file_t *fp, const void *buf, size_t count, loff_t off,
|
||||
{
|
||||
ssize_t rc;
|
||||
|
||||
rc = zfs_file_write_impl(fp, buf, count, &off);
|
||||
rc = kernel_write(fp, buf, count, &off);
|
||||
if (rc < 0)
|
||||
return (-rc);
|
||||
|
||||
@@ -151,25 +131,6 @@ zfs_file_pwrite(zfs_file_t *fp, const void *buf, size_t count, loff_t off,
|
||||
return (0);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
zfs_file_read_impl(zfs_file_t *fp, void *buf, size_t count, loff_t *off)
|
||||
{
|
||||
#if defined(HAVE_KERNEL_READ_PPOS)
|
||||
return (kernel_read(fp, buf, count, off));
|
||||
#else
|
||||
mm_segment_t saved_fs;
|
||||
ssize_t rc;
|
||||
|
||||
saved_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
rc = vfs_read(fp, (void __user *)buf, count, off);
|
||||
set_fs(saved_fs);
|
||||
|
||||
return (rc);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Stateful read - use os internal file pointer to determine where to
|
||||
* read and update on successful completion.
|
||||
@@ -187,7 +148,7 @@ zfs_file_read(zfs_file_t *fp, void *buf, size_t count, ssize_t *resid)
|
||||
loff_t off = fp->f_pos;
|
||||
ssize_t rc;
|
||||
|
||||
rc = zfs_file_read_impl(fp, buf, count, &off);
|
||||
rc = kernel_read(fp, buf, count, &off);
|
||||
if (rc < 0)
|
||||
return (-rc);
|
||||
|
||||
@@ -219,7 +180,7 @@ zfs_file_pread(zfs_file_t *fp, void *buf, size_t count, loff_t off,
|
||||
{
|
||||
ssize_t rc;
|
||||
|
||||
rc = zfs_file_read_impl(fp, buf, count, &off);
|
||||
rc = kernel_read(fp, buf, count, &off);
|
||||
if (rc < 0)
|
||||
return (-rc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user