Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 158811
Collapse All | Expand All

(-)linux-2.6.19/fs/bad_inode.c (-39 / +71 lines)
Lines 15-72 Link Here
15
#include <linux/smp_lock.h>
15
#include <linux/smp_lock.h>
16
#include <linux/namei.h>
16
#include <linux/namei.h>
17
17
18
static int return_EIO(void)
18
static int return_EIO_int(void)
19
{
19
{
20
	return -EIO;
20
	return -EIO;
21
}
21
}
22
#define EIO_ERROR_INT ((void *) (return_EIO_int))
22
23
23
#define EIO_ERROR ((void *) (return_EIO))
24
static ssize_t return_EIO_ssize(void)
25
{
26
	return -EIO;
27
}
28
#define EIO_ERROR_SSIZE ((void *) (return_EIO_ssize))
29
30
static long return_EIO_long(void)
31
{
32
	return -EIO;
33
}
34
#define EIO_ERROR_LOFF ((void *) (return_EIO_loff))
35
36
static loff_t return_EIO_loff(void)
37
{
38
	return -EIO;
39
}
40
#define EIO_ERROR_LONG ((void *) (return_EIO_long))
41
42
static long * return_EIO_ptr(void)
43
{
44
	return ERR_PTR(-EIO);
45
}
46
#define EIO_ERROR_PTR ((void *) (return_EIO_ptr))
24
47
25
static const struct file_operations bad_file_ops =
48
static const struct file_operations bad_file_ops =
26
{
49
{
27
	.llseek		= EIO_ERROR,
50
	.llseek		= EIO_ERROR_LOFF,
28
	.aio_read	= EIO_ERROR,
51
	.read		= EIO_ERROR_SSIZE,
29
	.read		= EIO_ERROR,
52
	.write		= EIO_ERROR_SSIZE,
30
	.write		= EIO_ERROR,
53
	.aio_read	= EIO_ERROR_SSIZE,
31
	.aio_write	= EIO_ERROR,
54
	.aio_write	= EIO_ERROR_SSIZE,
32
	.readdir	= EIO_ERROR,
55
	.readdir	= EIO_ERROR_INT,
33
	.poll		= EIO_ERROR,
56
	.poll		= EIO_ERROR_INT,
34
	.ioctl		= EIO_ERROR,
57
	.ioctl		= EIO_ERROR_INT,
35
	.mmap		= EIO_ERROR,
58
	.unlocked_ioctl	= EIO_ERROR_LONG,
36
	.open		= EIO_ERROR,
59
	.compat_ioctl	= EIO_ERROR_LONG,
37
	.flush		= EIO_ERROR,
60
	.mmap		= EIO_ERROR_INT,
38
	.release	= EIO_ERROR,
61
	.open		= EIO_ERROR_INT,
39
	.fsync		= EIO_ERROR,
62
	.flush		= EIO_ERROR_INT,
40
	.aio_fsync	= EIO_ERROR,
63
	.release	= EIO_ERROR_INT,
41
	.fasync		= EIO_ERROR,
64
	.fsync		= EIO_ERROR_INT,
42
	.lock		= EIO_ERROR,
65
	.aio_fsync	= EIO_ERROR_INT,
43
	.sendfile	= EIO_ERROR,
66
	.fasync		= EIO_ERROR_INT,
44
	.sendpage	= EIO_ERROR,
67
	.lock		= EIO_ERROR_INT,
45
	.get_unmapped_area = EIO_ERROR,
68
	.sendfile	= EIO_ERROR_SSIZE,
69
	.sendpage	= EIO_ERROR_SSIZE,
70
	.get_unmapped_area = EIO_ERROR_LONG,
71
	.check_flags	= EIO_ERROR_INT,
72
	.dir_notify	= EIO_ERROR_INT,
73
	.flock		= EIO_ERROR_INT,
74
	.splice_write	= EIO_ERROR_SSIZE,
75
	.splice_read	= EIO_ERROR_SSIZE,
46
};
76
};
47
77
48
static struct inode_operations bad_inode_ops =
78
static struct inode_operations bad_inode_ops =
49
{
79
{
50
	.create		= EIO_ERROR,
80
	.create		= EIO_ERROR_INT,
51
	.lookup		= EIO_ERROR,
81
	.lookup		= EIO_ERROR_PTR,
52
	.link		= EIO_ERROR,
82
	.link		= EIO_ERROR_INT,
53
	.unlink		= EIO_ERROR,
83
	.unlink		= EIO_ERROR_INT,
54
	.symlink	= EIO_ERROR,
84
	.symlink	= EIO_ERROR_INT,
55
	.mkdir		= EIO_ERROR,
85
	.mkdir		= EIO_ERROR_INT,
56
	.rmdir		= EIO_ERROR,
86
	.rmdir		= EIO_ERROR_INT,
57
	.mknod		= EIO_ERROR,
87
	.mknod		= EIO_ERROR_INT,
58
	.rename		= EIO_ERROR,
88
	.rename		= EIO_ERROR_INT,
59
	.readlink	= EIO_ERROR,
89
	.readlink	= EIO_ERROR_INT,
60
	/* follow_link must be no-op, otherwise unmounting this inode
90
	/* follow_link must be no-op, otherwise unmounting this inode
61
	   won't work */
91
	   won't work */
62
	.truncate	= EIO_ERROR,
92
	/* put_link is a void function */
63
	.permission	= EIO_ERROR,
93
	/* truncate is a void function */
64
	.getattr	= EIO_ERROR,
94
	.permission	= EIO_ERROR_INT,
65
	.setattr	= EIO_ERROR,
95
	.getattr	= EIO_ERROR_INT,
66
	.setxattr	= EIO_ERROR,
96
	.setattr	= EIO_ERROR_INT,
67
	.getxattr	= EIO_ERROR,
97
	.setxattr	= EIO_ERROR_INT,
68
	.listxattr	= EIO_ERROR,
98
	.getxattr	= EIO_ERROR_SSIZE,
69
	.removexattr	= EIO_ERROR,
99
	.listxattr	= EIO_ERROR_SSIZE,
100
	.removexattr	= EIO_ERROR_INT,
101
	/* truncate_range is a void function */
70
};
102
};
71
103
72
104

Return to bug 158811