diff -NurpP linux-2.6.16-rc1-vs2.1.0.9.1/block/ioctl.c linux-2.6.16-rc1-vs2.1.0.9.2/block/ioctl.c --- linux-2.6.16-rc1-vs2.1.0.9.1/block/ioctl.c 2006-01-18 06:07:58 +0100 +++ linux-2.6.16-rc1-vs2.1.0.9.2/block/ioctl.c 2006-01-29 15:57:21 +0100 @@ -246,6 +246,13 @@ int blkdev_ioctl(struct inode *inode, st set_device_ro(bdev, n); unlock_kernel(); return 0; + + case BLKHOLDER: + printk("bdev[%p]: holder=%p[%d]\n", bdev, bdev->bd_holder, bdev->bd_holders); + if (bdev->bd_holder && bdev->bd_holders) + return -EBUSY; + return 0; + case HDIO_GETGEO: { struct hd_geometry geo; diff -NurpP linux-2.6.16-rc1-vs2.1.0.9.1/include/linux/fs.h linux-2.6.16-rc1-vs2.1.0.9.2/include/linux/fs.h --- linux-2.6.16-rc1-vs2.1.0.9.1/include/linux/fs.h 2006-01-25 05:34:51 +0100 +++ linux-2.6.16-rc1-vs2.1.0.9.2/include/linux/fs.h 2006-01-29 16:01:52 +0100 @@ -207,6 +207,7 @@ extern int dir_notify_enable; #define BLKBSZGET _IOR(0x12,112,size_t) #define BLKBSZSET _IOW(0x12,113,size_t) #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */ +#define BLKHOLDER _IO(0x12,115)/* check for bdev holders */ #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ #define FIBMAP _IO(0x00,1) /* bmap access */