--- rxdsk.c.orig	2011-11-26 14:24:52.000000000 -0600
+++ rxdsk.c	2011-11-26 14:40:25.000000000 -0600
@@ -91,7 +91,11 @@
 static int read_proc(char *, char **, off_t, int, int *, void *);
 static int write_proc(struct file *, const char __user *, unsigned long, void *);
 static int rxdsk_do_bvec(struct rxdsk_device *, struct page *, unsigned int, unsigned int, int, sector_t);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
 static int rxdsk_ioctl(struct block_device *, fmode_t, unsigned int, unsigned long);
+#else
+static int rxdsk_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
+#endif
 static int rxdsk_make_request(struct request_queue *, struct bio *);
 static int attach_device(int, int); /* disk num, disk size */
 static int detach_device(int);      /* disk num */
@@ -443,14 +447,23 @@
 
 out:
     set_bit(BIO_UPTODATE, &bio->bi_flags);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
     bio_endio(bio, err);
+#else
+    bio_endio(bio, bio->bi_size, err);
+#endif
 
     return 0;
 } // rxdsk_make_request //
 
 
 static int
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
 rxdsk_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg){
+#else
+rxdsk_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg){
+    struct block_device *bdev = inode->i_bdev;
+#endif
     loff_t size;
     struct rxdsk_device *rxdsk = bdev->bd_disk->private_data;
 
@@ -468,7 +481,9 @@
         case BLKGETSIZE64: {
             return copy_to_user ((void __user *)arg, &bdev->bd_inode->i_size, sizeof(bdev->bd_inode->i_size)) ? -EFAULT : 0;
         }
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
         case BLKPBSZGET: 
+#endif
         case BLKBSZGET: 
         case BLKSSZGET: {
             size = BYTES_PER_SECTOR;
@@ -488,7 +503,11 @@
 } // rxdsk_ioctl //
 
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
 static const struct block_device_operations rxdsk_fops = {
+#else
+static struct block_device_operations rxdsk_fops = {
+#endif
     .owner = THIS_MODULE,
     .ioctl = rxdsk_ioctl,
 };
@@ -522,7 +541,12 @@
     if(!rxdsk->rxdsk_queue)
         goto out_free_dev;
     blk_queue_make_request(rxdsk->rxdsk_queue, rxdsk_make_request);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
     blk_queue_logical_block_size (rxdsk->rxdsk_queue, BYTES_PER_SECTOR);
+#else
+    blk_queue_hardsect_size (rxdsk->rxdsk_queue, BYTES_PER_SECTOR);
+#endif
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)
     blk_queue_flush(rxdsk->rxdsk_queue, REQ_FLUSH);
 #else
