This source file includes following definitions.
- blkdev_open
1
2
3
4
5
6
7 #include <linux/errno.h>
8 #include <linux/sched.h>
9 #include <linux/minix_fs.h>
10 #include <linux/tty.h>
11 #include <linux/stat.h>
12 #include <linux/fcntl.h>
13
14
15
16
17 static int blkdev_open(struct inode * inode, struct file * filp)
18 {
19 int i;
20
21 i = MAJOR(inode->i_rdev);
22 if (i >= MAX_BLKDEV || !blkdev_fops[i])
23 return -ENODEV;
24 filp->f_op = blkdev_fops[i];
25 if (filp->f_op->open)
26 return filp->f_op->open(inode,filp);
27 return 0;
28 }
29
30
31
32
33
34
35 static struct file_operations def_blk_fops = {
36 NULL,
37 NULL,
38 NULL,
39 NULL,
40 NULL,
41 NULL,
42 NULL,
43 blkdev_open,
44 NULL,
45 };
46
47 struct inode_operations minix_blkdev_inode_operations = {
48 &def_blk_fops,
49 NULL,
50 NULL,
51 NULL,
52 NULL,
53 NULL,
54 NULL,
55 NULL,
56 NULL,
57 NULL,
58 NULL,
59 NULL,
60 NULL,
61 NULL,
62 NULL
63 };