Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d5d5689 authored by Al Viro's avatar Al Viro
Browse files

make new_sync_{read,write}() static



All places outside of core VFS that checked ->read and ->write for being NULL or
called the methods directly are gone now, so NULL {read,write} with non-NULL
{read,write}_iter will do the right thing in all cases.

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 86cc0584
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -471,3 +471,12 @@ in your dentry operations instead.
[mandatory]
	f_dentry is gone; use f_path.dentry, or, better yet, see if you can avoid
	it entirely.
--
[mandatory]
	never call ->read() and ->write() directly; use __vfs_{read,write} or
	wrappers; instead of checking for ->write or ->read being NULL, look for
	FMODE_CAN_{WRITE,READ} in file->f_mode.
--
[mandatory]
	do _not_ use new_sync_{read,write} for ->read/->write; leave it NULL
	instead.
+0 −2
Original line number Diff line number Diff line
@@ -437,8 +437,6 @@ struct dentry *hypfs_create_str(struct dentry *dir,
static const struct file_operations hypfs_file_ops = {
	.open		= hypfs_open,
	.release	= hypfs_release,
	.read		= new_sync_read,
	.write		= new_sync_write,
	.read_iter	= hypfs_read_iter,
	.write_iter	= hypfs_write_iter,
	.llseek		= no_llseek,
+0 −2
Original line number Diff line number Diff line
@@ -764,7 +764,6 @@ static const struct file_operations __maybe_unused port_fops = {

static const struct file_operations zero_fops = {
	.llseek		= zero_lseek,
	.read		= new_sync_read,
	.write		= write_zero,
	.read_iter	= read_iter_zero,
	.aio_write	= aio_write_zero,
@@ -776,7 +775,6 @@ static const struct file_operations zero_fops = {

static const struct file_operations full_fops = {
	.llseek		= full_lseek,
	.read		= new_sync_read,
	.read_iter	= read_iter_zero,
	.write		= write_full,
};
+0 −2
Original line number Diff line number Diff line
@@ -282,9 +282,7 @@ static long raw_ctl_compat_ioctl(struct file *file, unsigned int cmd,
#endif

static const struct file_operations raw_fops = {
	.read		= new_sync_read,
	.read_iter	= blkdev_read_iter,
	.write		= new_sync_write,
	.write_iter	= blkdev_write_iter,
	.fsync		= blkdev_fsync,
	.open		= raw_open,
+0 −2
Original line number Diff line number Diff line
@@ -1118,8 +1118,6 @@ static const struct file_operations macvtap_fops = {
	.owner		= THIS_MODULE,
	.open		= macvtap_open,
	.release	= macvtap_release,
	.read		= new_sync_read,
	.write		= new_sync_write,
	.read_iter	= macvtap_read_iter,
	.write_iter	= macvtap_write_iter,
	.poll		= macvtap_poll,
Loading