[PATCH 285/437] fs/nfsd: convert to read/write iterators

Jens Axboe
2024-04-11T15:39:32Z

fs/nfsd/nfs4state.c | 5 +++--
fs/nfsd/nfsctl.c | 10 ++++++----
2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 84d4093ca713..cbe82431633a 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2958,7 +2958,7 @@ static int client_opens_release(struct inode *inode, struct file *file)

static const struct file_operations client_states_fops = {
.open = client_states_open,
- .read = seq_read,
+ .read_iter = seq_read_iter,
.llseek = seq_lseek,
.release = client_opens_release,
};
@@ -3011,9 +3011,10 @@ static ssize_t client_ctl_write(struct file *file, const char __user *buf,
drop_client(clp);
return 7;
}
+FOPS_WRITE_ITER_HELPER(client_ctl_write);

static const struct file_operations client_ctl_fops = {
- .write = client_ctl_write,
+ .write_iter = client_ctl_write_iter,
.release = simple_transaction_release,
};

diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index ecd18bffeebc..788194ac663d 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -118,6 +118,7 @@ static ssize_t nfsctl_transaction_write(struct file *file, const char __user *bu
simple_transaction_set(file, rv);
return size;
}
+FOPS_WRITE_ITER_HELPER(nfsctl_transaction_write);

static ssize_t nfsctl_transaction_read(struct file *file, char __user *buf, size_t size, loff_t *pos)
{
@@ -132,10 +133,11 @@ static ssize_t nfsctl_transaction_read(struct file *file, char __user *buf, size
}
return simple_transaction_read(file, buf, size, pos);
}
+FOPS_READ_ITER_HELPER(nfsctl_transaction_read);

static const struct file_operations transaction_ops = {
- .write = nfsctl_transaction_write,
- .read = nfsctl_transaction_read,
+ .write_iter = nfsctl_transaction_write_iter,
+ .read_iter = nfsctl_transaction_read_iter,
.release = simple_transaction_release,
.llseek = default_llseek,
};
@@ -162,7 +164,7 @@ static int exports_nfsd_open(struct inode *inode, struct file *file)

static const struct file_operations exports_nfsd_operations = {
.open = exports_nfsd_open,
- .read = seq_read,
+ .read_iter = seq_read_iter,
.llseek = seq_lseek,
.release = seq_release,
};
@@ -177,7 +179,7 @@ DEFINE_SHOW_ATTRIBUTE(export_features);

static const struct file_operations pool_stats_operations = {
.open = nfsd_pool_stats_open,
- .read = seq_read,
+ .read_iter = seq_read_iter,
.llseek = seq_lseek,
.release = seq_release,
};
--
2.43.0