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