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