|
|
1.1 root 1: /* 1.1.1.2 root 2: * linux/fs/minix/chrdev.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 character special file is opened 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: * 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_chr_fops = { 36: NULL, /* lseek */ 37: NULL, /* read */ 38: NULL, /* write */ 39: NULL, /* readdir */ 40: NULL, /* select */ 41: NULL, /* ioctl */ 42: chrdev_open, /* open */ 43: NULL, /* release */ 44: }; 45: 46: struct inode_operations minix_chrdev_inode_operations = { 47: &def_chr_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 */ 59: minix_bmap, /* bmap */ 60: minix_truncate /* truncate */ 61: }; 62:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.