patch-2.3.1 linux/fs/devices.c
Next file: linux/fs/dquot.c
Previous file: linux/fs/coda/upcall.c
Back to the patch index
Back to the overall index
- Lines: 22
- Date:
Tue May 11 23:01:41 1999
- Orig file:
v2.3.0/linux/fs/devices.c
- Orig date:
Wed Dec 23 11:39:49 1998
diff -u --recursive --new-file v2.3.0/linux/fs/devices.c linux/fs/devices.c
@@ -370,3 +370,21 @@
sprintf(buffer, "%s(%d,%d)", name, MAJOR(dev), MINOR(dev));
return buffer;
}
+
+void init_special_inode(struct inode *inode, umode_t mode, int rdev)
+{
+ inode->i_mode = mode;
+ inode->i_op = NULL;
+ if (S_ISCHR(mode)) {
+ inode->i_op = &chrdev_inode_operations;
+ inode->i_rdev = to_kdev_t(rdev);
+ } else if (S_ISBLK(mode)) {
+ inode->i_op = &blkdev_inode_operations;
+ inode->i_rdev = to_kdev_t(rdev);
+ } else if (S_ISFIFO(mode))
+ init_fifo(inode);
+ else if (S_ISSOCK(mode))
+ ;
+ else
+ printk(KERN_DEBUG "init_special_inode: bogus imode (%o)\n", mode);
+}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)