|
|
1.1 root 1: /*
1.1.1.2 root 2: * linux/fs/minix/chrdev.c
1.1 root 3: *
4: * (C) 1991 Linus Torvalds
5: */
6:
1.1.1.3 ! root 7: #include <errno.h>
! 8:
1.1 root 9: #include <linux/sched.h>
10: #include <linux/minix_fs.h>
11: #include <linux/tty.h>
1.1.1.2 root 12: #include <linux/stat.h>
1.1.1.3 ! root 13: #include <linux/fcntl.h>
1.1 root 14:
15: /*
16: * Called every time a minix character special file is opened
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: * Dummy default file-operations: the only thing this does
33: * is contain the open that then fills in the correct operations
34: * depending on the special file...
35: */
36: static struct file_operations def_chr_fops = {
37: NULL, /* lseek */
38: NULL, /* read */
39: NULL, /* write */
40: NULL, /* readdir */
41: NULL, /* select */
42: NULL, /* ioctl */
43: chrdev_open, /* open */
44: NULL, /* release */
45: };
46:
47: struct inode_operations minix_chrdev_inode_operations = {
48: &def_chr_fops, /* default file operations */
49: NULL, /* create */
50: NULL, /* lookup */
51: NULL, /* link */
52: NULL, /* unlink */
53: NULL, /* symlink */
54: NULL, /* mkdir */
55: NULL, /* rmdir */
56: NULL, /* mknod */
57: NULL, /* rename */
58: NULL, /* readlink */
59: NULL, /* follow_link */
60: minix_bmap, /* bmap */
61: minix_truncate /* truncate */
62: };
63:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.