From: cl349@firebug.cl.cam.ac.uk Date: Tue, 23 Aug 2005 17:51:57 +0000 (+0000) Subject: Remove blkback 2.4 support since we don't support 2.4 dom0 anymore. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16871^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9623f30227753e8c8a1514092dfdd557d8403c39;p=xen.git Remove blkback 2.4 support since we don't support 2.4 dom0 anymore. Signed-off-by: Christian Limpach --- diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c index 1f460f91ef..f2352d7158 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c @@ -65,9 +65,6 @@ typedef unsigned int PEND_RING_IDX; static PEND_RING_IDX pending_prod, pending_cons; #define NR_PENDING_REQS (MAX_PENDING_REQS - pending_prod + pending_cons) -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) -static kmem_cache_t *buffer_head_cachep; -#else static request_queue_t *plugged_queue; static inline void flush_plugged_queue(void) { @@ -80,7 +77,6 @@ static inline void flush_plugged_queue(void) plugged_queue = NULL; } } -#endif /* When using grant tables to map a frame for device access then the * handle returned must be used to unmap the frame. This is needed to @@ -184,11 +180,7 @@ static int blkio_schedule(void *arg) blkif_t *blkif; struct list_head *ent; - daemonize( -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - "xenblkd" -#endif - ); + daemonize("xenblkd"); for ( ; ; ) { @@ -215,11 +207,7 @@ static int blkio_schedule(void *arg) } /* Push the batch through to disc. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) - run_task_queue(&tq_disk); -#else flush_plugged_queue(); -#endif } } @@ -268,13 +256,6 @@ static void __end_block_io_op(pending_req_t *pending_req, int uptodate) } } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) -static void end_block_io_op(struct buffer_head *bh, int uptodate) -{ - __end_block_io_op(bh->b_private, uptodate); - kmem_cache_free(buffer_head_cachep, bh); -} -#else static int end_block_io_op(struct bio *bio, unsigned int done, int error) { if ( bio->bi_size != 0 ) @@ -283,7 +264,6 @@ static int end_block_io_op(struct bio *bio, unsigned int done, int error) bio_put(bio); return error; } -#endif /****************************************************************************** @@ -357,13 +337,9 @@ static void dispatch_rw_block_io(blkif_t *blkif, blkif_request_t *req) unsigned long buf; unsigned int nsec; } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; unsigned int nseg; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) - struct buffer_head *bh; -#else struct bio *bio = NULL, *biolist[BLKIF_MAX_SEGMENTS_PER_REQUEST]; int nbio = 0; request_queue_t *q; -#endif /* Check that number of segments is sane. */ nseg = req->nr_segments; @@ -435,49 +411,6 @@ static void dispatch_rw_block_io(blkif_t *blkif, blkif_request_t *req) pending_req->status = BLKIF_RSP_OKAY; pending_req->nr_pages = nseg; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) - - atomic_set(&pending_req->pendcnt, nseg); - pending_cons++; - blkif_get(blkif); - - for ( i = 0; i < nseg; i++ ) - { - bh = kmem_cache_alloc(buffer_head_cachep, GFP_KERNEL); - if ( unlikely(bh == NULL) ) - { - __end_block_io_op(pending_req, 0); - continue; - } - - memset(bh, 0, sizeof (struct buffer_head)); - - init_waitqueue_head(&bh->b_wait); - bh->b_size = seg[i].nsec << 9; - bh->b_dev = preq.dev; - bh->b_rdev = preq.dev; - bh->b_rsector = (unsigned long)preq.sector_number; - bh->b_data = (char *)MMAP_VADDR(pending_idx, i) + - (seg[i].buf & ~PAGE_MASK); - bh->b_page = virt_to_page(MMAP_VADDR(pending_idx, i)); - bh->b_end_io = end_block_io_op; - bh->b_private = pending_req; - - bh->b_state = (1 << BH_Mapped) | (1 << BH_Lock) | - (1 << BH_Req) | (1 << BH_Launder); - if ( operation == WRITE ) - bh->b_state |= (1 << BH_JBD) | (1 << BH_Req) | (1 << BH_Uptodate); - - atomic_set(&bh->b_count, 1); - - /* Dispatch a single request. We'll flush it to disc later. */ - generic_make_request(operation, bh); - - preq.sector_number += seg[i].nsec; - } - -#else - for ( i = 0; i < nseg; i++ ) { if ( ((int)preq.sector_number|(int)seg[i].nsec) & @@ -526,8 +459,6 @@ static void dispatch_rw_block_io(blkif_t *blkif, blkif_request_t *req) for ( i = 0; i < nbio; i++ ) submit_bio(operation, biolist[i]); -#endif - return; bad_descriptor: @@ -595,12 +526,6 @@ static int __init blkif_init(void) if ( kernel_thread(blkio_schedule, 0, CLONE_FS | CLONE_FILES) < 0 ) BUG(); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) - buffer_head_cachep = kmem_cache_create( - "buffer_head_cache", sizeof(struct buffer_head), - 0, SLAB_HWCACHE_ALIGN, NULL, NULL); -#endif - blkif_xenbus_init(); memset( pending_grant_handles, BLKBACK_INVALID_HANDLE, MMAP_PAGES ); diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h index fbac4a4065..4af91f8aa6 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/common.h +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/common.h @@ -29,10 +29,6 @@ #define DPRINTK(_f, _a...) ((void)0) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) -struct block_device; -#endif - struct vbd { blkif_vdev_t handle; /* what the domain refers to this vbd as */ unsigned char readonly; /* Non-zero -> read-only */ diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c index aeb8ac4be5..3f5eda76b3 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c @@ -9,10 +9,6 @@ #include "common.h" #include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) -#endif - static kmem_cache_t *blkif_cachep; blkif_t *alloc_blkif(domid_t domid) @@ -76,7 +72,7 @@ int blkif_map(blkif_t *blkif, unsigned long shared_page, unsigned int evtchn) if ( (vma = get_vm_area(PAGE_SIZE, VM_IOREMAP)) == NULL ) return -ENOMEM; - err = map_frontend_page(blkif, VMALLOC_VMADDR(vma->addr), shared_page); + err = map_frontend_page(blkif, (unsigned long)vma->addr, shared_page); if (err) { vfree(vma->addr); return err; diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c b/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c index e8f838e2f0..a8df6b9558 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c @@ -9,7 +9,6 @@ #include "common.h" #include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) static inline dev_t vbd_map_devnum(blkif_pdev_t cookie) { return MKDEV(BLKIF_MAJOR(cookie), BLKIF_MINOR(cookie)); @@ -17,11 +16,6 @@ static inline dev_t vbd_map_devnum(blkif_pdev_t cookie) #define vbd_sz(_v) ((_v)->bdev->bd_part ? \ (_v)->bdev->bd_part->nr_sects : (_v)->bdev->bd_disk->capacity) #define bdev_put(_b) blkdev_put(_b) -#else -#define vbd_sz(_v) (blk_size[MAJOR((_v)->pdevice)][MINOR((_v)->pdevice)]*2) -#define bdev_put(_b) ((void)0) -#define bdev_hardsect_size(_b) 512 -#endif unsigned long vbd_size(struct vbd *vbd) { @@ -56,7 +50,6 @@ int vbd_create(blkif_t *blkif, blkif_vdev_t handle, vbd->pdevice = pdevice; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) vbd->bdev = open_by_devnum( vbd_map_devnum(vbd->pdevice), vbd->readonly ? FMODE_READ : FMODE_WRITE); @@ -77,13 +70,6 @@ int vbd_create(blkif_t *blkif, blkif_vdev_t handle, vbd->type |= VDISK_CDROM; if ( vbd->bdev->bd_disk->flags & GENHD_FL_REMOVABLE ) vbd->type |= VDISK_REMOVABLE; -#else - if ( (blk_size[MAJOR(vbd->pdevice)] == NULL) || (vbd_sz(vbd) == 0) ) - { - DPRINTK("vbd_creat: device %08x doesn't exist.\n", vbd->pdevice); - return -ENOENT; - } -#endif DPRINTK("Successful creation of handle=%04x (dom=%u)\n", handle, blkif->domid);