mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 04:20:53 +07:00
->aio_read and ->aio_write removed
no remaining users Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
1c65d98672
commit
8436318205
@ -429,8 +429,6 @@ prototypes:
|
|||||||
loff_t (*llseek) (struct file *, loff_t, int);
|
loff_t (*llseek) (struct file *, loff_t, int);
|
||||||
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
|
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
|
||||||
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
|
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
|
||||||
ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
|
|
||||||
ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
|
|
||||||
ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
|
ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
|
||||||
ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
|
ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
|
||||||
int (*iterate) (struct file *, struct dir_context *);
|
int (*iterate) (struct file *, struct dir_context *);
|
||||||
|
@ -480,3 +480,6 @@ in your dentry operations instead.
|
|||||||
[mandatory]
|
[mandatory]
|
||||||
do _not_ use new_sync_{read,write} for ->read/->write; leave it NULL
|
do _not_ use new_sync_{read,write} for ->read/->write; leave it NULL
|
||||||
instead.
|
instead.
|
||||||
|
--
|
||||||
|
[mandatory]
|
||||||
|
->aio_read/->aio_write are gone. Use ->read_iter/->write_iter.
|
||||||
|
@ -804,8 +804,6 @@ struct file_operations {
|
|||||||
loff_t (*llseek) (struct file *, loff_t, int);
|
loff_t (*llseek) (struct file *, loff_t, int);
|
||||||
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
|
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
|
||||||
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
|
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
|
||||||
ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
|
|
||||||
ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
|
|
||||||
ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
|
ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
|
||||||
ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
|
ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
|
||||||
int (*iterate) (struct file *, struct dir_context *);
|
int (*iterate) (struct file *, struct dir_context *);
|
||||||
@ -838,14 +836,10 @@ otherwise noted.
|
|||||||
|
|
||||||
read: called by read(2) and related system calls
|
read: called by read(2) and related system calls
|
||||||
|
|
||||||
aio_read: vectored, possibly asynchronous read
|
|
||||||
|
|
||||||
read_iter: possibly asynchronous read with iov_iter as destination
|
read_iter: possibly asynchronous read with iov_iter as destination
|
||||||
|
|
||||||
write: called by write(2) and related system calls
|
write: called by write(2) and related system calls
|
||||||
|
|
||||||
aio_write: vectored, possibly asynchronous write
|
|
||||||
|
|
||||||
write_iter: possibly asynchronous write with iov_iter as source
|
write_iter: possibly asynchronous write with iov_iter as source
|
||||||
|
|
||||||
iterate: called when the VFS needs to read the directory contents
|
iterate: called when the VFS needs to read the directory contents
|
||||||
|
13
fs/aio.c
13
fs/aio.c
@ -1347,8 +1347,6 @@ SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef ssize_t (aio_rw_op)(struct kiocb *, const struct iovec *,
|
|
||||||
unsigned long, loff_t);
|
|
||||||
typedef ssize_t (rw_iter_op)(struct kiocb *, struct iov_iter *);
|
typedef ssize_t (rw_iter_op)(struct kiocb *, struct iov_iter *);
|
||||||
|
|
||||||
static int aio_setup_vectored_rw(int rw, char __user *buf, size_t len,
|
static int aio_setup_vectored_rw(int rw, char __user *buf, size_t len,
|
||||||
@ -1377,7 +1375,6 @@ static ssize_t aio_run_iocb(struct kiocb *req, unsigned opcode,
|
|||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
int rw;
|
int rw;
|
||||||
fmode_t mode;
|
fmode_t mode;
|
||||||
aio_rw_op *rw_op;
|
|
||||||
rw_iter_op *iter_op;
|
rw_iter_op *iter_op;
|
||||||
struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs;
|
struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs;
|
||||||
struct iov_iter iter;
|
struct iov_iter iter;
|
||||||
@ -1387,7 +1384,6 @@ static ssize_t aio_run_iocb(struct kiocb *req, unsigned opcode,
|
|||||||
case IOCB_CMD_PREADV:
|
case IOCB_CMD_PREADV:
|
||||||
mode = FMODE_READ;
|
mode = FMODE_READ;
|
||||||
rw = READ;
|
rw = READ;
|
||||||
rw_op = file->f_op->aio_read;
|
|
||||||
iter_op = file->f_op->read_iter;
|
iter_op = file->f_op->read_iter;
|
||||||
goto rw_common;
|
goto rw_common;
|
||||||
|
|
||||||
@ -1395,14 +1391,13 @@ static ssize_t aio_run_iocb(struct kiocb *req, unsigned opcode,
|
|||||||
case IOCB_CMD_PWRITEV:
|
case IOCB_CMD_PWRITEV:
|
||||||
mode = FMODE_WRITE;
|
mode = FMODE_WRITE;
|
||||||
rw = WRITE;
|
rw = WRITE;
|
||||||
rw_op = file->f_op->aio_write;
|
|
||||||
iter_op = file->f_op->write_iter;
|
iter_op = file->f_op->write_iter;
|
||||||
goto rw_common;
|
goto rw_common;
|
||||||
rw_common:
|
rw_common:
|
||||||
if (unlikely(!(file->f_mode & mode)))
|
if (unlikely(!(file->f_mode & mode)))
|
||||||
return -EBADF;
|
return -EBADF;
|
||||||
|
|
||||||
if (!rw_op && !iter_op)
|
if (!iter_op)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (opcode == IOCB_CMD_PREADV || opcode == IOCB_CMD_PWRITEV)
|
if (opcode == IOCB_CMD_PREADV || opcode == IOCB_CMD_PWRITEV)
|
||||||
@ -1425,11 +1420,7 @@ static ssize_t aio_run_iocb(struct kiocb *req, unsigned opcode,
|
|||||||
if (rw == WRITE)
|
if (rw == WRITE)
|
||||||
file_start_write(file);
|
file_start_write(file);
|
||||||
|
|
||||||
if (iter_op) {
|
ret = iter_op(req, &iter);
|
||||||
ret = iter_op(req, &iter);
|
|
||||||
} else {
|
|
||||||
ret = rw_op(req, iter.iov, iter.nr_segs, req->ki_pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rw == WRITE)
|
if (rw == WRITE)
|
||||||
file_end_write(file);
|
file_end_write(file);
|
||||||
|
@ -168,10 +168,10 @@ struct file *alloc_file(struct path *path, fmode_t mode,
|
|||||||
file->f_inode = path->dentry->d_inode;
|
file->f_inode = path->dentry->d_inode;
|
||||||
file->f_mapping = path->dentry->d_inode->i_mapping;
|
file->f_mapping = path->dentry->d_inode->i_mapping;
|
||||||
if ((mode & FMODE_READ) &&
|
if ((mode & FMODE_READ) &&
|
||||||
likely(fop->read || fop->aio_read || fop->read_iter))
|
likely(fop->read || fop->read_iter))
|
||||||
mode |= FMODE_CAN_READ;
|
mode |= FMODE_CAN_READ;
|
||||||
if ((mode & FMODE_WRITE) &&
|
if ((mode & FMODE_WRITE) &&
|
||||||
likely(fop->write || fop->aio_write || fop->write_iter))
|
likely(fop->write || fop->write_iter))
|
||||||
mode |= FMODE_CAN_WRITE;
|
mode |= FMODE_CAN_WRITE;
|
||||||
file->f_mode = mode;
|
file->f_mode = mode;
|
||||||
file->f_op = fop;
|
file->f_op = fop;
|
||||||
|
@ -734,10 +734,10 @@ static int do_dentry_open(struct file *f,
|
|||||||
if ((f->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ)
|
if ((f->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ)
|
||||||
i_readcount_inc(inode);
|
i_readcount_inc(inode);
|
||||||
if ((f->f_mode & FMODE_READ) &&
|
if ((f->f_mode & FMODE_READ) &&
|
||||||
likely(f->f_op->read || f->f_op->aio_read || f->f_op->read_iter))
|
likely(f->f_op->read || f->f_op->read_iter))
|
||||||
f->f_mode |= FMODE_CAN_READ;
|
f->f_mode |= FMODE_CAN_READ;
|
||||||
if ((f->f_mode & FMODE_WRITE) &&
|
if ((f->f_mode & FMODE_WRITE) &&
|
||||||
likely(f->f_op->write || f->f_op->aio_write || f->f_op->write_iter))
|
likely(f->f_op->write || f->f_op->write_iter))
|
||||||
f->f_mode |= FMODE_CAN_WRITE;
|
f->f_mode |= FMODE_CAN_WRITE;
|
||||||
|
|
||||||
f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
|
f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
|
||||||
|
@ -22,8 +22,6 @@
|
|||||||
#include <asm/unistd.h>
|
#include <asm/unistd.h>
|
||||||
|
|
||||||
typedef ssize_t (*io_fn_t)(struct file *, char __user *, size_t, loff_t *);
|
typedef ssize_t (*io_fn_t)(struct file *, char __user *, size_t, loff_t *);
|
||||||
typedef ssize_t (*iov_fn_t)(struct kiocb *, const struct iovec *,
|
|
||||||
unsigned long, loff_t);
|
|
||||||
typedef ssize_t (*iter_fn_t)(struct kiocb *, struct iov_iter *);
|
typedef ssize_t (*iter_fn_t)(struct kiocb *, struct iov_iter *);
|
||||||
|
|
||||||
const struct file_operations generic_ro_fops = {
|
const struct file_operations generic_ro_fops = {
|
||||||
@ -668,21 +666,6 @@ static ssize_t do_iter_readv_writev(struct file *filp, struct iov_iter *iter,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t do_sync_readv_writev(struct file *filp, struct iov_iter *iter,
|
|
||||||
loff_t *ppos, iov_fn_t fn)
|
|
||||||
{
|
|
||||||
struct kiocb kiocb;
|
|
||||||
ssize_t ret;
|
|
||||||
|
|
||||||
init_sync_kiocb(&kiocb, filp);
|
|
||||||
kiocb.ki_pos = *ppos;
|
|
||||||
|
|
||||||
ret = fn(&kiocb, iter->iov, iter->nr_segs, kiocb.ki_pos);
|
|
||||||
BUG_ON(ret == -EIOCBQUEUED);
|
|
||||||
*ppos = kiocb.ki_pos;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Do it by hand, with file-ops */
|
/* Do it by hand, with file-ops */
|
||||||
static ssize_t do_loop_readv_writev(struct file *filp, struct iov_iter *iter,
|
static ssize_t do_loop_readv_writev(struct file *filp, struct iov_iter *iter,
|
||||||
loff_t *ppos, io_fn_t fn)
|
loff_t *ppos, io_fn_t fn)
|
||||||
@ -797,7 +780,6 @@ static ssize_t do_readv_writev(int type, struct file *file,
|
|||||||
struct iov_iter iter;
|
struct iov_iter iter;
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
io_fn_t fn;
|
io_fn_t fn;
|
||||||
iov_fn_t fnv;
|
|
||||||
iter_fn_t iter_fn;
|
iter_fn_t iter_fn;
|
||||||
|
|
||||||
ret = import_iovec(type, uvector, nr_segs,
|
ret = import_iovec(type, uvector, nr_segs,
|
||||||
@ -812,22 +794,17 @@ static ssize_t do_readv_writev(int type, struct file *file,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
fnv = NULL;
|
|
||||||
if (type == READ) {
|
if (type == READ) {
|
||||||
fn = file->f_op->read;
|
fn = file->f_op->read;
|
||||||
fnv = file->f_op->aio_read;
|
|
||||||
iter_fn = file->f_op->read_iter;
|
iter_fn = file->f_op->read_iter;
|
||||||
} else {
|
} else {
|
||||||
fn = (io_fn_t)file->f_op->write;
|
fn = (io_fn_t)file->f_op->write;
|
||||||
fnv = file->f_op->aio_write;
|
|
||||||
iter_fn = file->f_op->write_iter;
|
iter_fn = file->f_op->write_iter;
|
||||||
file_start_write(file);
|
file_start_write(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iter_fn)
|
if (iter_fn)
|
||||||
ret = do_iter_readv_writev(file, &iter, pos, iter_fn);
|
ret = do_iter_readv_writev(file, &iter, pos, iter_fn);
|
||||||
else if (fnv)
|
|
||||||
ret = do_sync_readv_writev(file, &iter, pos, fnv);
|
|
||||||
else
|
else
|
||||||
ret = do_loop_readv_writev(file, &iter, pos, fn);
|
ret = do_loop_readv_writev(file, &iter, pos, fn);
|
||||||
|
|
||||||
@ -977,7 +954,6 @@ static ssize_t compat_do_readv_writev(int type, struct file *file,
|
|||||||
struct iov_iter iter;
|
struct iov_iter iter;
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
io_fn_t fn;
|
io_fn_t fn;
|
||||||
iov_fn_t fnv;
|
|
||||||
iter_fn_t iter_fn;
|
iter_fn_t iter_fn;
|
||||||
|
|
||||||
ret = compat_import_iovec(type, uvector, nr_segs,
|
ret = compat_import_iovec(type, uvector, nr_segs,
|
||||||
@ -992,22 +968,17 @@ static ssize_t compat_do_readv_writev(int type, struct file *file,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
fnv = NULL;
|
|
||||||
if (type == READ) {
|
if (type == READ) {
|
||||||
fn = file->f_op->read;
|
fn = file->f_op->read;
|
||||||
fnv = file->f_op->aio_read;
|
|
||||||
iter_fn = file->f_op->read_iter;
|
iter_fn = file->f_op->read_iter;
|
||||||
} else {
|
} else {
|
||||||
fn = (io_fn_t)file->f_op->write;
|
fn = (io_fn_t)file->f_op->write;
|
||||||
fnv = file->f_op->aio_write;
|
|
||||||
iter_fn = file->f_op->write_iter;
|
iter_fn = file->f_op->write_iter;
|
||||||
file_start_write(file);
|
file_start_write(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iter_fn)
|
if (iter_fn)
|
||||||
ret = do_iter_readv_writev(file, &iter, pos, iter_fn);
|
ret = do_iter_readv_writev(file, &iter, pos, iter_fn);
|
||||||
else if (fnv)
|
|
||||||
ret = do_sync_readv_writev(file, &iter, pos, fnv);
|
|
||||||
else
|
else
|
||||||
ret = do_loop_readv_writev(file, &iter, pos, fn);
|
ret = do_loop_readv_writev(file, &iter, pos, fn);
|
||||||
|
|
||||||
|
@ -1562,8 +1562,6 @@ struct file_operations {
|
|||||||
loff_t (*llseek) (struct file *, loff_t, int);
|
loff_t (*llseek) (struct file *, loff_t, int);
|
||||||
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
|
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
|
||||||
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
|
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
|
||||||
ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
|
|
||||||
ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
|
|
||||||
ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
|
ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
|
||||||
ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
|
ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
|
||||||
int (*iterate) (struct file *, struct dir_context *);
|
int (*iterate) (struct file *, struct dir_context *);
|
||||||
|
Loading…
Reference in New Issue
Block a user