-static void update_special(struct dentry *special)
-{
- special->d_inode->i_uid = listuid;
- special->d_inode->i_gid = listgid;
- special->d_inode->i_mode = S_IFREG | listmode;
-}
-
-static void update_dev(struct dentry *dev)
-{
- dev->d_inode->i_uid = devuid;
- dev->d_inode->i_gid = devgid;
- dev->d_inode->i_mode = S_IFREG | devmode;
-}
-
-static void update_bus(struct dentry *bus)
-{
- struct dentry *dev = NULL;
-
- bus->d_inode->i_uid = busuid;
- bus->d_inode->i_gid = busgid;
- bus->d_inode->i_mode = S_IFDIR | busmode;
-
- down(&bus->d_inode->i_sem);
-
- list_for_each_entry(dev, &bus->d_subdirs, d_child)
- if (dev->d_inode)
- update_dev(dev);
-
- up(&bus->d_inode->i_sem);
-}
-
-static void update_sb(struct super_block *sb)
-{
- struct dentry *root = sb->s_root;
- struct dentry *bus = NULL;
-
- if (!root)
- return;
-
- down(&root->d_inode->i_sem);
-
- list_for_each_entry(bus, &root->d_subdirs, d_child) {
- if (bus->d_inode) {
- switch (S_IFMT & bus->d_inode->i_mode) {
- case S_IFDIR:
- update_bus(bus);
- break;
- case S_IFREG:
- update_special(bus);
- break;
- default:
- warn("Unknown node %s mode %x found on remount!\n",bus->d_name.name,bus->d_inode->i_mode);
- break;
- }
- }
- }
-
- up(&root->d_inode->i_sem);
-}
-
-static int remount(struct super_block *sb, int *flags, char *data)
-{
- /* If this is not a real mount,
- * i.e. it's a simple_pin_fs from create_special_files,
- * then ignore it.
- */
- if (ignore_mount)
- return 0;
-
- if (parse_options(sb, data)) {
- warn("usbfs: mount parameter error:");
- return -EINVAL;
- }
-
- if (usbfs_mount && usbfs_mount->mnt_sb)
- update_sb(usbfs_mount->mnt_sb);
-
- if (usbdevfs_mount && usbdevfs_mount->mnt_sb)
- update_sb(usbdevfs_mount->mnt_sb);
-
- return 0;
-}
-