patch-2.3.46 linux/mm/swapfile.c

Next file: linux/net/ax25/af_ax25.c
Previous file: linux/mm/mremap.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.45/linux/mm/swapfile.c linux/mm/swapfile.c
@@ -634,11 +634,15 @@
 
 	if (S_ISBLK(swap_dentry->d_inode->i_mode)) {
 		kdev_t dev = swap_dentry->d_inode->i_rdev;
+		struct block_device_operations *bdops;
 
 		p->swap_device = dev;
 		set_blocksize(dev, PAGE_SIZE);
 		
 		bdev = swap_dentry->d_inode->i_bdev;
+		bdops = devfs_get_ops ( devfs_get_handle_from_inode
+					(swap_dentry->d_inode) );
+		if (bdops) bdev->bd_op = bdops;
 
 		error = blkdev_get(bdev, FMODE_READ|FMODE_WRITE, 0, BDEV_SWAP);
 		if (error)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)