Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] switch ub

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 4099a966 b4d9a442

+12 -14
+12 -14
drivers/block/ub.c
··· 1667 1667 * This is mostly needed to keep refcounting, but also to support 1668 1668 * media checks on removable media drives. 1669 1669 */ 1670 - static int ub_bd_open(struct inode *inode, struct file *filp) 1670 + static int ub_bd_open(struct block_device *bdev, fmode_t mode) 1671 1671 { 1672 - struct gendisk *disk = inode->i_bdev->bd_disk; 1673 - struct ub_lun *lun = disk->private_data; 1672 + struct ub_lun *lun = bdev->bd_disk->private_data; 1674 1673 struct ub_dev *sc = lun->udev; 1675 1674 unsigned long flags; 1676 1675 int rc; ··· 1683 1684 spin_unlock_irqrestore(&ub_lock, flags); 1684 1685 1685 1686 if (lun->removable || lun->readonly) 1686 - check_disk_change(inode->i_bdev); 1687 + check_disk_change(bdev); 1687 1688 1688 1689 /* 1689 1690 * The sd.c considers ->media_present and ->changed not equivalent, 1690 1691 * under some pretty murky conditions (a failure of READ CAPACITY). 1691 1692 * We may need it one day. 1692 1693 */ 1693 - if (lun->removable && lun->changed && !(filp->f_mode & FMODE_NDELAY)) { 1694 + if (lun->removable && lun->changed && !(mode & FMODE_NDELAY)) { 1694 1695 rc = -ENOMEDIUM; 1695 1696 goto err_open; 1696 1697 } 1697 1698 1698 - if (lun->readonly && (filp->f_mode & FMODE_WRITE)) { 1699 + if (lun->readonly && (mode & FMODE_WRITE)) { 1699 1700 rc = -EROFS; 1700 1701 goto err_open; 1701 1702 } ··· 1709 1710 1710 1711 /* 1711 1712 */ 1712 - static int ub_bd_release(struct inode *inode, struct file *filp) 1713 + static int ub_bd_release(struct gendisk *disk, fmode_t mode) 1713 1714 { 1714 - struct gendisk *disk = inode->i_bdev->bd_disk; 1715 1715 struct ub_lun *lun = disk->private_data; 1716 1716 struct ub_dev *sc = lun->udev; 1717 1717 ··· 1721 1723 /* 1722 1724 * The ioctl interface. 1723 1725 */ 1724 - static int ub_bd_ioctl(struct inode *inode, struct file *filp, 1726 + static int ub_bd_ioctl(struct block_device *bdev, fmode_t mode, 1725 1727 unsigned int cmd, unsigned long arg) 1726 1728 { 1727 - struct gendisk *disk = inode->i_bdev->bd_disk; 1729 + struct gendisk *disk = bdev->bd_disk; 1728 1730 void __user *usermem = (void __user *) arg; 1729 1731 1730 - return scsi_cmd_ioctl(disk->queue, disk, filp ? filp->f_mode : 0, cmd, usermem); 1732 + return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, usermem); 1731 1733 } 1732 1734 1733 1735 /* ··· 1789 1791 1790 1792 static struct block_device_operations ub_bd_fops = { 1791 1793 .owner = THIS_MODULE, 1792 - .__open = ub_bd_open, 1793 - .__release = ub_bd_release, 1794 - .__ioctl = ub_bd_ioctl, 1794 + .open = ub_bd_open, 1795 + .release = ub_bd_release, 1796 + .locked_ioctl = ub_bd_ioctl, 1795 1797 .media_changed = ub_bd_media_changed, 1796 1798 .revalidate_disk = ub_bd_revalidate, 1797 1799 };