aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-02-04 16:02:09 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-02-20 04:03:58 -0500
commitdb671a8ecd764baf76a698b8366603a147880734 (patch)
tree6cc43ff5997fc9c9382b6bc1ebb35d4c95a04838 /fs
parent28444a2bde8d1695447eb51362b46cf1e49b9c21 (diff)
don't bother with most of the bad_file_ops methods
Only ->open() should be there (always failing, of course). We never replace ->f_op of an already opened struct file, so there's no way for any of those methods to be called. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/bad_inode.c147
1 files changed, 0 insertions, 147 deletions
diff --git a/fs/bad_inode.c b/fs/bad_inode.c
index afd2b4408adf..861b1e1c4777 100644
--- a/fs/bad_inode.c
+++ b/fs/bad_inode.c
@@ -15,161 +15,14 @@
15#include <linux/namei.h> 15#include <linux/namei.h>
16#include <linux/poll.h> 16#include <linux/poll.h>
17 17
18
19static loff_t bad_file_llseek(struct file *file, loff_t offset, int whence)
20{
21 return -EIO;
22}
23
24static ssize_t bad_file_read(struct file *filp, char __user *buf,
25 size_t size, loff_t *ppos)
26{
27 return -EIO;
28}
29
30static ssize_t bad_file_write(struct file *filp, const char __user *buf,
31 size_t siz, loff_t *ppos)
32{
33 return -EIO;
34}
35
36static ssize_t bad_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
37 unsigned long nr_segs, loff_t pos)
38{
39 return -EIO;
40}
41
42static ssize_t bad_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
43 unsigned long nr_segs, loff_t pos)
44{
45 return -EIO;
46}
47
48static int bad_file_readdir(struct file *file, struct dir_context *ctx)
49{
50 return -EIO;
51}
52
53static unsigned int bad_file_poll(struct file *filp, poll_table *wait)
54{
55 return POLLERR;
56}
57
58static long bad_file_unlocked_ioctl(struct file *file, unsigned cmd,
59 unsigned long arg)
60{
61 return -EIO;
62}
63
64static long bad_file_compat_ioctl(struct file *file, unsigned int cmd,
65 unsigned long arg)
66{
67 return -EIO;
68}
69
70static int bad_file_mmap(struct file *file, struct vm_area_struct *vma)
71{
72 return -EIO;
73}
74
75static int bad_file_open(struct inode *inode, struct file *filp) 18static int bad_file_open(struct inode *inode, struct file *filp)
76{ 19{
77 return -EIO; 20 return -EIO;
78} 21}
79 22
80static int bad_file_flush(struct file *file, fl_owner_t id)
81{
82 return -EIO;
83}
84
85static int bad_file_release(struct inode *inode, struct file *filp)
86{
87 return -EIO;
88}
89
90static int bad_file_fsync(struct file *file, loff_t start, loff_t end,
91 int datasync)
92{
93 return -EIO;
94}
95
96static int bad_file_aio_fsync(struct kiocb *iocb, int datasync)
97{
98 return -EIO;
99}
100
101static int bad_file_fasync(int fd, struct file *filp, int on)
102{
103 return -EIO;
104}
105
106static int bad_file_lock(struct file *file, int cmd, struct file_lock *fl)
107{
108 return -EIO;
109}
110
111static ssize_t bad_file_sendpage(struct file *file, struct page *page,
112 int off, size_t len, loff_t *pos, int more)
113{
114 return -EIO;
115}
116
117static unsigned long bad_file_get_unmapped_area(struct file *file,
118 unsigned long addr, unsigned long len,
119 unsigned long pgoff, unsigned long flags)
120{
121 return -EIO;
122}
123
124static int bad_file_check_flags(int flags)
125{
126 return -EIO;
127}
128
129static int bad_file_flock(struct file *filp, int cmd, struct file_lock *fl)
130{
131 return -EIO;
132}
133
134static ssize_t bad_file_splice_write(struct pipe_inode_info *pipe,
135 struct file *out, loff_t *ppos, size_t len,
136 unsigned int flags)
137{
138 return -EIO;
139}
140
141static ssize_t bad_file_splice_read(struct file *in, loff_t *ppos,
142 struct pipe_inode_info *pipe, size_t len,
143 unsigned int flags)
144{
145 return -EIO;
146}
147
148static const struct file_operations bad_file_ops = 23static const struct file_operations bad_file_ops =
149{ 24{
150 .llseek = bad_file_llseek,
151 .read = bad_file_read,
152 .write = bad_file_write,
153 .aio_read = bad_file_aio_read,
154 .aio_write = bad_file_aio_write,
155 .iterate = bad_file_readdir,
156 .poll = bad_file_poll,
157 .unlocked_ioctl = bad_file_unlocked_ioctl,
158 .compat_ioctl = bad_file_compat_ioctl,
159 .mmap = bad_file_mmap,
160 .open = bad_file_open, 25 .open = bad_file_open,
161 .flush = bad_file_flush,
162 .release = bad_file_release,
163 .fsync = bad_file_fsync,
164 .aio_fsync = bad_file_aio_fsync,
165 .fasync = bad_file_fasync,
166 .lock = bad_file_lock,
167 .sendpage = bad_file_sendpage,
168 .get_unmapped_area = bad_file_get_unmapped_area,
169 .check_flags = bad_file_check_flags,
170 .flock = bad_file_flock,
171 .splice_write = bad_file_splice_write,
172 .splice_read = bad_file_splice_read,
173}; 26};
174 27
175static int bad_inode_create (struct inode *dir, struct dentry *dentry, 28static int bad_inode_create (struct inode *dir, struct dentry *dentry,