2.3.25-pre1 Compile Fixes

Jeremy Katz (katzj@linuxpower.org)
Thu, 28 Oct 1999 23:14:56 -0400


--G4iJoqBmSsgzjUCe
Content-Type: text/plain; charset=us-ascii

Attached is a diff to fix compilation by changing instances of
vma->vm_offset to vma->pg_off. Also changes instances of page->offset
to pg_offset. Haven't tested all the drivers, but the ones I needed the
fix for have worked since.

Jeremy

--
Jeremy Katz		http://linuxpower.org
Personal: katzj@linuxpower.org
School: jlkatz@unity.ncsu.edu

QOTD: "It's God. No, not Richard Stallman, or Linus Torvalds, but God." (By Matt Welsh)

--G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="offset_fixes.patch"

diff -urN linux.old/arch/sparc/kernel/signal.c linux/arch/sparc/kernel/signal.c --- linux.old/arch/sparc/kernel/signal.c Thu Sep 30 22:02:29 1999 +++ linux/arch/sparc/kernel/signal.c Thu Oct 28 23:04:42 1999 @@ -1050,7 +1050,7 @@ ino = map->vm_file->f_dentry->d_inode->i_ino; line = d_path(map->vm_file->f_dentry, buffer, PAGE_SIZE); } - printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_offset, + printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_pgoff, kdevname(dev), ino); if (map->vm_file != NULL) printk("%s\n", line); diff -urN linux.old/arch/sparc64/kernel/signal.c linux/arch/sparc64/kernel/signal.c --- linux.old/arch/sparc64/kernel/signal.c Thu Sep 30 22:02:55 1999 +++ linux/arch/sparc64/kernel/signal.c Thu Oct 28 23:04:58 1999 @@ -618,7 +618,7 @@ ino = map->vm_file->f_dentry->d_inode->i_ino; line = d_path(map->vm_file->f_dentry, buffer, PAGE_SIZE); } - printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_offset, + printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_pgoff, kdevname(dev), ino); if (map->vm_file != NULL) printk("%s\n", line); diff -urN linux.old/arch/sparc64/kernel/signal32.c linux/arch/sparc64/kernel/signal32.c --- linux.old/arch/sparc64/kernel/signal32.c Thu Sep 30 22:01:48 1999 +++ linux/arch/sparc64/kernel/signal32.c Thu Oct 28 23:05:19 1999 @@ -1226,7 +1226,7 @@ ino = map->vm_file->f_dentry->d_inode->i_ino; line = d_path(map->vm_file->f_dentry, buffer, PAGE_SIZE); } - printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_offset, + printk(MAPS_LINE_FORMAT, map->vm_start, map->vm_end, str, map->vm_pgoff, kdevname(dev), ino); if (map->vm_file != NULL) printk("%s\n", line); diff -urN linux.old/drivers/char/drm/vm.c linux/drivers/char/drm/vm.c --- linux.old/drivers/char/drm/vm.c Thu Sep 30 22:02:55 1999 +++ linux/drivers/char/drm/vm.c Thu Oct 28 22:59:56 1999 @@ -169,7 +169,7 @@ unsigned long length = vma->vm_end - vma->vm_start; DRM_DEBUG("start = 0x%lx, end = 0x%lx, offset = 0x%lx\n", - vma->vm_start, vma->vm_end, vma->vm_offset); + vma->vm_start, vma->vm_end, vma->pgoff); /* Length must match exact page count */ if ((length >> PAGE_SHIFT) != dma->page_count) return -EINVAL; diff -urN linux.old/drivers/sbus/char/flash.c linux/drivers/sbus/char/flash.c --- linux.old/drivers/sbus/char/flash.c Thu Sep 30 22:02:36 1999 +++ linux/drivers/sbus/char/flash.c Thu Oct 28 23:01:45 1999 @@ -37,7 +37,7 @@ unsigned long addr; unsigned long size; - if (vma->vm_offset & ~(PAGE_MASK)) + if (vma->vm_pgoff & ~(PAGE_MASK)) return -ENXIO; if (flash.read_base == flash.write_base) { @@ -58,12 +58,12 @@ return -ENXIO; } - if (vma->vm_offset > size) + if (vma->vm_pgoff > size) return -ENXIO; - addr += vma->vm_offset; + addr += vma->vm_pgoff; - if (vma->vm_end - (vma->vm_start + vma->vm_offset) > size) - size = vma->vm_end - (vma->vm_start + vma->vm_offset); + if (vma->vm_end - (vma->vm_start + vma->vm_pgoff) > size) + size = vma->vm_end - (vma->vm_start + vma->vm_pgoff); pgprot_val(vma->vm_page_prot) &= ~(_PAGE_CACHE); pgprot_val(vma->vm_page_prot) |= _PAGE_E; diff -urN linux.old/drivers/sbus/char/vfc_dev.c linux/drivers/sbus/char/vfc_dev.c --- linux.old/drivers/sbus/char/vfc_dev.c Thu Aug 5 13:22:40 1999 +++ linux/drivers/sbus/char/vfc_dev.c Thu Oct 28 23:01:55 1999 @@ -573,7 +573,7 @@ map_size=sizeof(struct vfc_regs); - if(vma->vm_offset & ~PAGE_MASK) return -ENXIO; + if(vma->vm_pgoff & ~PAGE_MASK) return -ENXIO; vma->vm_flags |= VM_SHM | VM_LOCKED | VM_IO | VM_MAYREAD | VM_MAYWRITE | VM_MAYSHARE; map_offset=(unsigned int)dev->phys_regs; ret = io_remap_page_range(vma->vm_start,map_offset,map_size, diff -urN linux.old/drivers/sgi/char/graphics.c linux/drivers/sgi/char/graphics.c --- linux.old/drivers/sgi/char/graphics.c Thu Sep 30 22:02:37 1999 +++ linux/drivers/sgi/char/graphics.c Thu Oct 28 23:03:43 1999 @@ -271,7 +271,7 @@ uint size; size = vma->vm_end - vma->vm_start; - if (vma->vm_offset & ~PAGE_MASK) + if (vma->vm_pgoff & ~PAGE_MASK) return -ENXIO; /* 1. Set our special graphic virtualizer */ diff -urN linux.old/drivers/sgi/char/shmiq.c linux/drivers/sgi/char/shmiq.c --- linux.old/drivers/sgi/char/shmiq.c Wed Oct 13 18:38:58 1999 +++ linux/drivers/sgi/char/shmiq.c Thu Oct 28 23:03:56 1999 @@ -318,7 +318,7 @@ if (minor-- == 0) return -EINVAL; - if (vma->vm_offset != 0) + if (vma->vm_pgoff != 0) return -EINVAL; size = vma->vm_end - vma->vm_start; diff -urN linux.old/drivers/sound/cmpci.c linux/drivers/sound/cmpci.c --- linux.old/drivers/sound/cmpci.c Mon Oct 4 19:25:21 1999 +++ linux/drivers/sound/cmpci.c Thu Oct 28 23:01:01 1999 @@ -1333,7 +1333,7 @@ db = &s->dma_adc; } else return -EINVAL; - if (vma->vm_offset != 0) + if (vma->vm_pgoff != 0) return -EINVAL; size = vma->vm_end - vma->vm_start; if (size > (PAGE_SIZE << db->buforder)) diff -urN linux.old/drivers/sound/es1370.c linux/drivers/sound/es1370.c --- linux.old/drivers/sound/es1370.c Thu Oct 28 22:30:59 1999 +++ linux/drivers/sound/es1370.c Thu Oct 28 23:00:41 1999 @@ -1316,7 +1316,7 @@ db = &s->dma_adc; } else return -EINVAL; - if (vma->vm_offset != 0) + if (vma->vm_pgoff != 0) return -EINVAL; size = vma->vm_end - vma->vm_start; if (size > (PAGE_SIZE << db->buforder)) @@ -1840,7 +1840,7 @@ return -EINVAL; if ((ret = prog_dmabuf_dac1(s)) != 0) return ret; - if (vma->vm_offset != 0) + if (vma->vm_pgoff != 0) return -EINVAL; size = vma->vm_end - vma->vm_start; if (size > (PAGE_SIZE << s->dma_dac1.buforder)) diff -urN linux.old/drivers/sound/es1371.c linux/drivers/sound/es1371.c --- linux.old/drivers/sound/es1371.c Thu Oct 28 22:30:59 1999 +++ linux/drivers/sound/es1371.c Thu Oct 28 22:47:25 1999 @@ -1894,7 +1894,7 @@ db = &s->dma_adc; } else return -EINVAL; - if (vma->vm_offset != 0) + if (vma->vm_pgoff != 0) return -EINVAL; size = vma->vm_end - vma->vm_start; if (size > (PAGE_SIZE << db->buforder)) @@ -2415,7 +2415,7 @@ return -EINVAL; if ((ret = prog_dmabuf_dac1(s)) != 0) return ret; - if (vma->vm_offset != 0) + if (vma->vm_pgoff != 0) return -EINVAL; size = vma->vm_end - vma->vm_start; if (size > (PAGE_SIZE << s->dma_dac1.buforder)) diff -urN linux.old/drivers/sound/esssolo1.c linux/drivers/sound/esssolo1.c --- linux.old/drivers/sound/esssolo1.c Thu Oct 28 22:30:59 1999 +++ linux/drivers/sound/esssolo1.c Thu Oct 28 23:01:12 1999 @@ -1199,7 +1199,7 @@ db = &s->dma_adc; } else return -EINVAL; - if (vma->vm_offset != 0) + if (vma->vm_pgoff != 0) return -EINVAL; size = vma->vm_end - vma->vm_start; if (size > (PAGE_SIZE << db->buforder)) diff -urN linux.old/drivers/sound/maestro.c linux/drivers/sound/maestro.c --- linux.old/drivers/sound/maestro.c Fri Oct 22 17:42:34 1999 +++ linux/drivers/sound/maestro.c Thu Oct 28 23:01:24 1999 @@ -2339,7 +2339,7 @@ db = &s->dma_adc; } else return -EINVAL; - if (vma->vm_offset != 0) + if (vma->vm_pgoff != 0) return -EINVAL; size = vma->vm_end - vma->vm_start; if (size > (PAGE_SIZE << db->buforder)) diff -urN linux.old/drivers/sound/sonicvibes.c linux/drivers/sound/sonicvibes.c --- linux.old/drivers/sound/sonicvibes.c Thu Oct 28 22:30:59 1999 +++ linux/drivers/sound/sonicvibes.c Thu Oct 28 23:00:50 1999 @@ -1516,7 +1516,7 @@ db = &s->dma_adc; } else return -EINVAL; - if (vma->vm_offset != 0) + if (vma->vm_pgoff != 0) return -EINVAL; size = vma->vm_end - vma->vm_start; if (size > (PAGE_SIZE << db->buforder)) diff -urN linux.old/drivers/usb/audio.c linux/drivers/usb/audio.c --- linux.old/drivers/usb/audio.c Thu Oct 28 22:30:59 1999 +++ linux/drivers/usb/audio.c Thu Oct 28 23:04:11 1999 @@ -2201,7 +2201,7 @@ db = &as->usbin.dma; } else return -EINVAL; - if (vma->vm_offset != 0) + if (vma->vm_pgoff != 0) return -EINVAL; return dmabuf_mmap(db, vma->vm_start, vma->vm_end - vma->vm_start, vma->vm_page_prot); } Binary files linux.old/drivers/video/.fbmem.c.swp and linux/drivers/video/.fbmem.c.swp differ diff -urN linux.old/drivers/video/atyfb.c linux/drivers/video/atyfb.c --- linux.old/drivers/video/atyfb.c Fri Oct 22 17:42:35 1999 +++ linux/drivers/video/atyfb.c Thu Oct 28 23:02:46 1999 @@ -3054,15 +3054,15 @@ return -ENXIO; size = vma->vm_end - vma->vm_start; - if (vma->vm_offset & ~PAGE_MASK) + if (vma->vm_pgoff & ~PAGE_MASK) return -ENXIO; /* To stop the swapper from even considering these pages. */ vma->vm_flags |= (VM_SHM | VM_LOCKED); - if (((vma->vm_offset == 0) && (size == fb->total_vram)) || - ((vma->vm_offset == fb->total_vram) && (size == PAGE_SIZE))) - vma->vm_offset += 0x8000000000000000UL; + if (((vma->vm_pgoff == 0) && (size == fb->total_vram)) || + ((vma->vm_pgoff == fb->total_vram) && (size == PAGE_SIZE))) + vma->vm_pgoff += 0x8000000000000000UL; #ifdef __sparc_v9__ /* Align it as much as desirable */ @@ -3070,9 +3070,9 @@ unsigned long j, align; int max = -1; - map_offset = vma->vm_offset+size; + map_offset = vma->vm_pgoff+size; for (i = 0; fb->mmap_map[i].size; i++) { - if (fb->mmap_map[i].voff < vma->vm_offset) + if (fb->mmap_map[i].voff < vma->vm_pgoff) continue; if (fb->mmap_map[i].voff >= map_offset) break; @@ -3092,7 +3092,7 @@ j = align; align = j - ((vma->vm_start + fb->mmap_map[max].voff - - vma->vm_offset) & (j - 1)); + - vma->vm_pgoff) & (j - 1)); if (align != j) { struct vm_area_struct *vmm; @@ -3115,7 +3115,7 @@ for (i = 0; fb->mmap_map[i].size; i++) { unsigned long start = fb->mmap_map[i].voff; unsigned long end = start + fb->mmap_map[i].size; - unsigned long offset = vma->vm_offset + page; + unsigned long offset = vma->vm_pgoff + page; if (start > offset) continue; diff -urN linux.old/drivers/video/fbmem.c linux/drivers/video/fbmem.c --- linux.old/drivers/video/fbmem.c Thu Oct 28 22:30:59 1999 +++ linux/drivers/video/fbmem.c Thu Oct 28 22:42:40 1999 @@ -505,9 +505,9 @@ len = (start & ~PAGE_MASK)+fix.smem_len; start &= PAGE_MASK; len = (len+~PAGE_MASK) & PAGE_MASK; - if (vma->vm_offset >= len) { + if (vma->vm_pgoff >= len) { /* memory mapped io */ - vma->vm_offset -= len; + vma->vm_pgoff -= len; fb->fb_get_var(&var, PROC_CONSOLE(info), info); if (var.accel_flags) return -EINVAL; @@ -516,10 +516,10 @@ start &= PAGE_MASK; len = (len+~PAGE_MASK) & PAGE_MASK; } - if ((vma->vm_end - vma->vm_start + vma->vm_offset) > len) + if ((vma->vm_end - vma->vm_start + vma->vm_pgoff) > len) return -EINVAL; - vma->vm_offset += start; - if (vma->vm_offset & ~PAGE_MASK) + vma->vm_pgoff += start; + if (vma->vm_pgoff & ~PAGE_MASK) return -ENXIO; #if defined(__mc68000__) if (CPU_IS_020_OR_030) @@ -549,7 +549,7 @@ #else #warning What do we have to do here?? #endif - if (io_remap_page_range(vma->vm_start, vma->vm_offset, + if (io_remap_page_range(vma->vm_start, vma->vm_pgoff, vma->vm_end - vma->vm_start, vma->vm_page_prot)) return -EAGAIN; return 0; diff -urN linux.old/drivers/video/igafb.c linux/drivers/video/igafb.c --- linux.old/drivers/video/igafb.c Thu Sep 30 22:02:16 1999 +++ linux/drivers/video/igafb.c Thu Oct 28 23:03:22 1999 @@ -261,7 +261,7 @@ return -ENXIO; size = vma->vm_end - vma->vm_start; - if (vma->vm_offset & ~PAGE_MASK) + if (vma->vm_pgoff & ~PAGE_MASK) return -ENXIO; /* To stop the swapper from even considering these pages. */ @@ -273,7 +273,7 @@ for (i = 0; fb->mmap_map[i].size; i++) { unsigned long start = fb->mmap_map[i].voff; unsigned long end = start + fb->mmap_map[i].size; - unsigned long offset = vma->vm_offset + page; + unsigned long offset = vma->vm_pgoff + page;t if (start > offset) continue; diff -urN linux.old/drivers/video/sbusfb.c linux/drivers/video/sbusfb.c --- linux.old/drivers/video/sbusfb.c Wed Oct 13 18:38:59 1999 +++ linux/drivers/video/sbusfb.c Thu Oct 28 23:03:09 1999 @@ -178,7 +178,7 @@ int i; size = vma->vm_end - vma->vm_start; - if (vma->vm_offset & ~PAGE_MASK) + if (vma->vm_pgoff & ~PAGE_MASK) return -ENXIO; /* To stop the swapper from even considering these pages */ @@ -190,9 +190,9 @@ unsigned long j, alignment, s = 0; int max = -1; - map_offset = vma->vm_offset+size; + map_offset = vma->vm_pgoff+size; for (i = 0; fb->mmap_map[i].size; i++) { - if (fb->mmap_map[i].voff < vma->vm_offset) + if (fb->mmap_map[i].voff < vma->vm_pgoff) continue; if (fb->mmap_map[i].voff >= map_offset) break; @@ -210,7 +210,7 @@ break; if (alignment > PAGE_SIZE) { j = alignment; - alignment = j - ((vma->vm_start + fb->mmap_map[max].voff - vma->vm_offset) & (j - 1)); + alignment = j - ((vma->vm_start + fb->mmap_map[max].voff - vma->vm_pgoff) & (j - 1)); if (alignment != j) { struct vm_area_struct *vmm = find_vma(current->mm, vma->vm_start); if (!vmm || vmm->vm_start >= vma->vm_end + alignment) { @@ -227,7 +227,7 @@ for (page = 0; page < size; ){ map_size = 0; for (i = 0; fb->mmap_map[i].size; i++) - if (fb->mmap_map[i].voff == vma->vm_offset+page) { + if (fb->mmap_map[i].voff == vma->vm_pgoff+page) {t map_size = sbusfb_mmapsize(fb,fb->mmap_map[i].size); #ifdef __sparc_v9__ #define POFF_MASK (PAGE_MASK|0x1UL) diff -urN linux.old/drivers/video/sgivwfb.c linux/drivers/video/sgivwfb.c --- linux.old/drivers/video/sgivwfb.c Thu Sep 30 22:02:16 1999 +++ linux/drivers/video/sgivwfb.c Thu Oct 28 23:03:35 1999 @@ -907,8 +907,8 @@ struct vm_area_struct *vma) { unsigned long size = vma->vm_end - vma->vm_start; - unsigned long offset = sgivwfb_mem_phys + vma->vm_offset; - if (vma->vm_offset+size > sgivwfb_mem_size) + unsigned long offset = sgivwfb_mem_phys + vma->vm_pgoff; + if (vma->vm_pgoff+size > sgivwfb_mem_size) return -EINVAL; pgprot_val(vma->vm_page_prot) = pgprot_val(vma->vm_page_prot) | _PAGE_PCD; vma->vm_flags |= VM_IO; diff -urN linux.old/fs/coda/file.c linux/fs/coda/file.c --- linux.old/fs/coda/file.c Thu Sep 30 22:02:17 1999 +++ linux/fs/coda/file.c Thu Oct 28 23:08:45 1999 @@ -99,7 +99,7 @@ &cont_file, &cont_dentry); CDEBUG(D_INODE, "coda ino: %ld, cached ino %ld, page offset: %lx\n", - coda_inode->i_ino, cii->c_ovp->i_ino, page->offset); + coda_inode->i_ino, cii->c_ovp->i_ino, page->pg_offset); block_read_full_page(&cont_file, page); EXIT; diff -urN linux.old/fs/fat/file.c linux/fs/fat/file.c --- linux.old/fs/fat/file.c Wed Oct 27 20:17:16 1999 +++ linux/fs/fat/file.c Thu Oct 28 22:49:10 1999 @@ -119,7 +119,7 @@ long status; pgpos = MSDOS_I(inode)->i_realsize & PAGE_CACHE_MASK; - while (pgpos < page->offset) { + while (pgpos < page->pg_offset) { hash = page_hash(&inode->i_data, pgpos); repeat_find: new_page = __find_lock_page(&inode->i_data, pgpos, hash); if (!new_page) { diff -urN linux.old/fs/hpfs/file.c linux/fs/hpfs/file.c --- linux.old/fs/hpfs/file.c Wed Oct 27 20:17:16 1999 +++ linux/fs/hpfs/file.c Thu Oct 28 23:08:14 1999 @@ -94,9 +94,9 @@ struct page * page_cache = NULL; long status; - printk("- off: %08x\n", (int)page->offset); + printk("- off: %08x\n", (int)page->pg_offset); pgpos = (inode->i_blocks - 1) * 512 & PAGE_CACHE_MASK; - while (pgpos < page->offset) { + while (pgpos < page->pg_offset) { long pgp = pgpos; printk("pgpos: %08x, bl: %d\n", (int)pgpos, (int)inode->i_blocks); hash = page_hash(&inode->i_data, pgpos); diff -urN linux.old/fs/qnx4/file.c linux/fs/qnx4/file.c --- linux.old/fs/qnx4/file.c Thu Aug 5 13:22:58 1999 +++ linux/fs/qnx4/file.c Thu Oct 28 23:08:36 1999 @@ -215,7 +215,7 @@ struct buffer_head *bh; int res = -EIO; - QNX4DEBUG(("qnx4: readpage offset=[%ld]\n", (long) page->offset)); + QNX4DEBUG(("qnx4: readpage offset=[%ld]\n", (long) page->pg_offset)); if (qnx4_ino->i_xblk != 0) { printk("qnx4: sorry, this file is extended, don't know how to handle it (yet) !\n"); @@ -226,7 +226,7 @@ buf = page_address(page); clear_bit(PG_uptodate, &page->flags); clear_bit(PG_error, &page->flags); - offset = page->offset; + offset = page->pg_offset; if (offset < inode->i_size) { res = 0; diff -urN linux.old/fs/romfs/inode.c linux/fs/romfs/inode.c --- linux.old/fs/romfs/inode.c Wed Oct 27 20:17:16 1999 +++ linux/fs/romfs/inode.c Thu Oct 28 23:08:25 1999 @@ -404,7 +404,7 @@ get_page(page); buf = page_address(page); - offset = page->offset; + offset = page->pg_offset; if (offset < inode->i_size) { avail = inode->i_size-offset; readlen = min(avail, PAGE_SIZE); diff -urN linux.old/include/linux/mm.h linux/include/linux/mm.h --- linux.old/include/linux/mm.h Thu Oct 28 22:32:34 1999 +++ linux/include/linux/mm.h Thu Oct 28 23:09:01 1999 @@ -233,7 +233,7 @@ * The following discussion applies only to them. * * A page may belong to an inode's memory mapping. In this case, - * page->inode is the pointer to the inode, and page->offset is the + * page->inode is the pointer to the inode, and page->pg_offset is the * file offset of the page (not necessarily a multiple of PAGE_SIZE). * * A page may have buffers allocated to it. In this case,

--G4iJoqBmSsgzjUCe--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/