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