diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-06-17 13:25:08 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-06-17 13:25:08 +0000 |
commit | 59223edaa18759982db0a8aced0e77457d10c68e (patch) | |
tree | 89354903b01fa0a447bffeefe00df3044495db2e /fs/devices.c | |
parent | db7d4daea91e105e3859cf461d7e53b9b77454b2 (diff) |
Merge with Linux 2.3.6. Sorry, this isn't tested on silicon, I don't
have a MIPS box at hand.
Diffstat (limited to 'fs/devices.c')
-rw-r--r-- | fs/devices.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/fs/devices.c b/fs/devices.c index 2ff69850a..8d9200f87 100644 --- a/fs/devices.c +++ b/fs/devices.c @@ -193,7 +193,7 @@ int unregister_blkdev(unsigned int major, const char * name) * it. Thus it is called only upon a 'mount' or 'open'. This * is the best way of combining speed and utility, I think. * People changing diskettes in the middle of an operation deserve - * to loose :-) + * to lose :-) */ int check_disk_change(kdev_t dev) { @@ -370,3 +370,21 @@ char * cdevname(kdev_t dev) 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); +} |