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