This source file includes following definitions.
- chrdev_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 chrdev_open(struct inode * inode, struct file * filp)
18 {
19 int i;
20
21 i = MAJOR(inode->i_rdev);
22 if (i < MAX_CHRDEV) {
23 filp->f_op = chrdev_fops[i];
24 if (filp->f_op && filp->f_op->open)
25 return filp->f_op->open(inode,filp);
26 }
27 return 0;
28 }
29
30
31
32
33
34
35 static struct file_operations def_chr_fops = {
36 NULL,
37 NULL,
38 NULL,
39 NULL,
40 NULL,
41 NULL,
42 chrdev_open,
43 NULL,
44 };
45
46 struct inode_operations minix_chrdev_inode_operations = {
47 &def_chr_fops,
48 NULL,
49 NULL,
50 NULL,
51 NULL,
52 NULL,
53 NULL,
54 NULL,
55 NULL,
56 NULL,
57 NULL,
58 NULL,
59 minix_bmap,
60 minix_truncate
61 };
62