Commit c8eddecf authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

[PATCH] remove devfs_only()

Rationale:  devfs_only does nothing but disabling {un,}register_blkdev
and {un,}register_chrdev.  {un,}register_blkdev already do nothing but
adding it's name argument to a lookup table for the __bdevname and
/proc/device output so this use is already bogus.  The disabling of
the character device per-major arrays can work in practice but is
useless as any driver relying on it can't be used on non-devfs systems.
parent 45004d67
......@@ -91,9 +91,6 @@ int register_blkdev(unsigned int major, const char *name)
struct blk_major_name **n, *p;
int index, ret = 0;
if (devfs_only())
return 0;
/* temporary */
if (major == 0) {
down_read(&block_subsys.rwsem);
......@@ -141,13 +138,9 @@ int register_blkdev(unsigned int major, const char *name)
int unregister_blkdev(unsigned int major, const char *name)
{
struct blk_major_name **n, *p;
int index;
int index = major_to_index(major);
int ret = 0;
if (devfs_only())
return 0;
index = major_to_index(major);
down_write(&block_subsys.rwsem);
for (n = &major_names[index]; *n; n = &(*n)->next)
if ((*n)->major == major)
......
......@@ -191,8 +191,6 @@ static struct file_operations * get_chrfops(unsigned int major, unsigned int min
int register_chrdev(unsigned int major, const char * name, struct file_operations *fops)
{
if (devfs_only())
return 0;
if (major == 0) {
write_lock(&chrdevs_lock);
for (major = MAX_CHRDEV-1; major > 0; major--) {
......@@ -221,8 +219,6 @@ int register_chrdev(unsigned int major, const char * name, struct file_operation
int unregister_chrdev(unsigned int major, const char * name)
{
if (devfs_only())
return 0;
if (major >= MAX_CHRDEV)
return -EINVAL;
write_lock(&chrdevs_lock);
......
......@@ -729,7 +729,6 @@
#define OPTION_NONE 0x00
#define OPTION_MOUNT 0x01
#define OPTION_ONLY 0x02
#define PRINTK(format, args...) \
{printk (KERN_ERR "%s" format, __FUNCTION__ , ## args);}
......@@ -773,7 +772,6 @@ struct bdev_type
{
struct block_device_operations *ops;
dev_t dev;
unsigned char autogen:1;
unsigned char removable:1;
};
......@@ -938,8 +936,6 @@ void devfs_put (devfs_handle_t de)
if ( S_ISLNK (de->mode) ) kfree (de->u.symlink.linkname);
if ( S_ISCHR (de->mode) && de->u.cdev.autogen )
devfs_dealloc_devnum (de->mode, de->u.cdev.dev);
if ( S_ISBLK (de->mode) && de->u.bdev.autogen )
devfs_dealloc_devnum (de->mode, de->u.bdev.dev);
WRITE_ENTRY_MAGIC (de, 0);
#ifdef CONFIG_DEVFS_DEBUG
spin_lock (&stat_lock);
......@@ -1495,17 +1491,6 @@ devfs_handle_t devfs_register (devfs_handle_t dir, const char *name,
PRINTK ("(%s): creating symlinks is not allowed\n", name);
return NULL;
}
if ( ( S_ISCHR (mode) || S_ISBLK (mode) ) &&
(flags & DEVFS_FL_AUTO_DEVNUM) )
{
devnum = devfs_alloc_devnum (mode);
if (!devnum) {
PRINTK ("(%s): exhausted %s device numbers\n",
name, S_ISCHR (mode) ? "char" : "block");
return NULL;
}
dev = devnum;
}
if ( ( de = _devfs_prepare_leaf (&dir, name, mode) ) == NULL )
{
PRINTK ("(%s): could not prepare leaf\n", name);
......@@ -1869,18 +1854,6 @@ int devfs_set_file_size (devfs_handle_t de, unsigned long size)
} /* End Function devfs_set_file_size */
/**
* devfs_only - returns true if "devfs=only" is a boot option
*
* If "devfs=only" this function will return 1, otherwise 0 is returned.
*/
int devfs_only (void)
{
return (boot_options & OPTION_ONLY) ? 1 : 0;
} /* End Function devfs_only */
/**
* devfs_setup - Process kernel boot options.
* @str: The boot options after the "devfs=".
......@@ -1909,7 +1882,6 @@ static int __init devfs_setup (char *str)
{"dilookup", DEBUG_I_LOOKUP, &devfs_debug_init},
{"diunlink", DEBUG_I_UNLINK, &devfs_debug_init},
#endif /* CONFIG_DEVFS_DEBUG */
{"only", OPTION_ONLY, &boot_options},
{"mount", OPTION_MOUNT, &boot_options},
{NULL, 0, NULL}
};
......
......@@ -13,8 +13,6 @@
#define DEVFS_FL_NONE 0x000 /* This helps to make code more readable
*/
#define DEVFS_FL_AUTO_DEVNUM 0x002 /* Automatically generate device number
*/
#define DEVFS_FL_REMOVABLE 0x008 /* This is a removable media device */
#define DEVFS_FL_WAIT 0x010 /* Wait for devfsd to finish */
#define DEVFS_FL_CURRENT_OWNER 0x020 /* Set initial ownership to current */
......@@ -52,7 +50,6 @@ extern devfs_handle_t devfs_mk_dir (devfs_handle_t dir, const char *name,
void *info);
extern int devfs_generate_path (devfs_handle_t de, char *path, int buflen);
extern int devfs_set_file_size (devfs_handle_t de, unsigned long size);
extern int devfs_only (void);
extern int devfs_register_tape (devfs_handle_t de);
extern void devfs_unregister_tape(int num);
extern int devfs_alloc_unique_number (struct unique_numspace *space);
......@@ -111,10 +108,6 @@ static inline int devfs_set_file_size (devfs_handle_t de, unsigned long size)
{
return -ENOSYS;
}
static inline int devfs_only (void)
{
return 0;
}
static inline int devfs_register_tape (devfs_handle_t de)
{
return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment