const: mark struct vm_struct_operations
authorAlexey Dobriyan <adobriyan@gmail.com>
Sun, 27 Sep 2009 18:29:37 +0000 (22:29 +0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 27 Sep 2009 18:39:25 +0000 (11:39 -0700)
* mark struct vm_area_struct::vm_ops as const
* mark vm_ops in AGP code

But leave TTM code alone, something is fishy there with global vm_ops
being used.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
64 files changed:
arch/ia64/ia32/binfmt_elf32.c
arch/powerpc/platforms/cell/spufs/file.c
arch/x86/pci/i386.c
drivers/char/agp/agp.h
drivers/char/agp/alpha-agp.c
drivers/char/mem.c
drivers/char/mspec.c
drivers/gpu/drm/drm_vm.c
drivers/gpu/drm/radeon/radeon_ttm.c
drivers/gpu/drm/ttm/ttm_bo_vm.c
drivers/ieee1394/dma.c
drivers/infiniband/hw/ehca/ehca_uverbs.c
drivers/infiniband/hw/ipath/ipath_file_ops.c
drivers/infiniband/hw/ipath/ipath_mmap.c
drivers/media/video/cafe_ccic.c
drivers/media/video/et61x251/et61x251_core.c
drivers/media/video/gspca/gspca.c
drivers/media/video/meye.c
drivers/media/video/sn9c102/sn9c102_core.c
drivers/media/video/stk-webcam.c
drivers/media/video/uvc/uvc_v4l2.c
drivers/media/video/videobuf-dma-contig.c
drivers/media/video/videobuf-dma-sg.c
drivers/media/video/videobuf-vmalloc.c
drivers/media/video/vino.c
drivers/media/video/zc0301/zc0301_core.c
drivers/media/video/zoran/zoran_driver.c
drivers/misc/sgi-gru/grufile.c
drivers/misc/sgi-gru/grutables.h
drivers/scsi/sg.c
drivers/uio/uio.c
drivers/usb/mon/mon_bin.c
drivers/video/fb_defio.c
drivers/video/omap/dispc.c
fs/btrfs/file.c
fs/ext4/file.c
fs/fuse/file.c
fs/gfs2/file.c
fs/ncpfs/mmap.c
fs/nfs/file.c
fs/nilfs2/file.c
fs/ocfs2/mmap.c
fs/sysfs/bin.c
fs/ubifs/file.c
fs/xfs/linux-2.6/xfs_file.c
include/linux/agp_backend.h
include/linux/hugetlb.h
include/linux/mm_types.h
include/linux/ramfs.h
ipc/shm.c
kernel/perf_event.c
kernel/relay.c
mm/filemap.c
mm/filemap_xip.c
mm/hugetlb.c
mm/mmap.c
mm/nommu.c
mm/shmem.c
net/packet/af_packet.c
sound/core/pcm_native.c
sound/usb/usx2y/us122l.c
sound/usb/usx2y/usX2Yhwdep.c
sound/usb/usx2y/usx2yhwdeppcm.c
virt/kvm/kvm_main.c

index f92bdaac8976ecff13c9639743d8411289f5581f..c69552bf893ed5c186b39c6b038d3ea2218958df 100644 (file)
@@ -69,11 +69,11 @@ ia32_install_gate_page (struct vm_area_struct *vma, struct vm_fault *vmf)
 }
 
 
-static struct vm_operations_struct ia32_shared_page_vm_ops = {
+static const struct vm_operations_struct ia32_shared_page_vm_ops = {
        .fault = ia32_install_shared_page
 };
 
-static struct vm_operations_struct ia32_gate_page_vm_ops = {
+static const struct vm_operations_struct ia32_gate_page_vm_ops = {
        .fault = ia32_install_gate_page
 };
 
index 8f079b865ad0446a33d5f51e596d39b4aa2a98b9..961309446170b6550f96ac471ea428fd75cfee49 100644 (file)
@@ -309,7 +309,7 @@ static int spufs_mem_mmap_access(struct vm_area_struct *vma,
        return len;
 }
 
-static struct vm_operations_struct spufs_mem_mmap_vmops = {
+static const struct vm_operations_struct spufs_mem_mmap_vmops = {
        .fault = spufs_mem_mmap_fault,
        .access = spufs_mem_mmap_access,
 };
@@ -436,7 +436,7 @@ static int spufs_cntl_mmap_fault(struct vm_area_struct *vma,
        return spufs_ps_fault(vma, vmf, 0x4000, SPUFS_CNTL_MAP_SIZE);
 }
 
-static struct vm_operations_struct spufs_cntl_mmap_vmops = {
+static const struct vm_operations_struct spufs_cntl_mmap_vmops = {
        .fault = spufs_cntl_mmap_fault,
 };
 
@@ -1143,7 +1143,7 @@ spufs_signal1_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 #endif
 }
 
-static struct vm_operations_struct spufs_signal1_mmap_vmops = {
+static const struct vm_operations_struct spufs_signal1_mmap_vmops = {
        .fault = spufs_signal1_mmap_fault,
 };
 
@@ -1279,7 +1279,7 @@ spufs_signal2_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 #endif
 }
 
-static struct vm_operations_struct spufs_signal2_mmap_vmops = {
+static const struct vm_operations_struct spufs_signal2_mmap_vmops = {
        .fault = spufs_signal2_mmap_fault,
 };
 
@@ -1397,7 +1397,7 @@ spufs_mss_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        return spufs_ps_fault(vma, vmf, 0x0000, SPUFS_MSS_MAP_SIZE);
 }
 
-static struct vm_operations_struct spufs_mss_mmap_vmops = {
+static const struct vm_operations_struct spufs_mss_mmap_vmops = {
        .fault = spufs_mss_mmap_fault,
 };
 
@@ -1458,7 +1458,7 @@ spufs_psmap_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        return spufs_ps_fault(vma, vmf, 0x0000, SPUFS_PS_MAP_SIZE);
 }
 
-static struct vm_operations_struct spufs_psmap_mmap_vmops = {
+static const struct vm_operations_struct spufs_psmap_mmap_vmops = {
        .fault = spufs_psmap_mmap_fault,
 };
 
@@ -1517,7 +1517,7 @@ spufs_mfc_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        return spufs_ps_fault(vma, vmf, 0x3000, SPUFS_MFC_MAP_SIZE);
 }
 
-static struct vm_operations_struct spufs_mfc_mmap_vmops = {
+static const struct vm_operations_struct spufs_mfc_mmap_vmops = {
        .fault = spufs_mfc_mmap_fault,
 };
 
index 52e62e57fedd53a385147cf1399cd84f89f7bc4b..b22d13b0c71d0f538cd25f2643490d0bf2fa86a3 100644 (file)
@@ -266,7 +266,7 @@ void pcibios_set_master(struct pci_dev *dev)
        pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
 }
 
-static struct vm_operations_struct pci_mmap_ops = {
+static const struct vm_operations_struct pci_mmap_ops = {
        .access = generic_access_phys,
 };
 
index d6f36c004d9b7edeeea488f77ed9984639de607b..870f12cfed93000e670423e9aac8afad892503cf 100644 (file)
@@ -131,7 +131,7 @@ struct agp_bridge_driver {
 struct agp_bridge_data {
        const struct agp_version *version;
        const struct agp_bridge_driver *driver;
-       struct vm_operations_struct *vm_ops;
+       const struct vm_operations_struct *vm_ops;
        void *previous_size;
        void *current_size;
        void *dev_private_data;
index 5ea4da8e995420f4b63e315e77bf655e087935bc..dd84af4d4f7e1cfdd0c74e576269d1744e1cfdef 100644 (file)
@@ -40,7 +40,7 @@ static struct aper_size_info_fixed alpha_core_agp_sizes[] =
        { 0, 0, 0 }, /* filled in by alpha_core_agp_setup */
 };
 
-struct vm_operations_struct alpha_core_agp_vm_ops = {
+static const struct vm_operations_struct alpha_core_agp_vm_ops = {
        .fault = alpha_core_agp_vm_fault,
 };
 
index 6c8b65d069e514badcab1b70c6032fea129b2bc7..a074fceb67d30109c08e862b9b775b6c058da904 100644 (file)
@@ -301,7 +301,7 @@ static inline int private_mapping_ok(struct vm_area_struct *vma)
 }
 #endif
 
-static struct vm_operations_struct mmap_mem_ops = {
+static const struct vm_operations_struct mmap_mem_ops = {
 #ifdef CONFIG_HAVE_IOREMAP_PROT
        .access = generic_access_phys
 #endif
index 30f095a8c2d4ff3932d7ad8db1d5ec462c33cd2d..1997270bb6f4054dfea5753252447f9ccc565af1 100644 (file)
@@ -239,7 +239,7 @@ mspec_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        return VM_FAULT_NOPAGE;
 }
 
-static struct vm_operations_struct mspec_vm_ops = {
+static const struct vm_operations_struct mspec_vm_ops = {
        .open = mspec_open,
        .close = mspec_close,
        .fault = mspec_fault,
index 7e1fbe5d4779827ee596319982659d5a7422c73b..4ac900f4647f521be90a1279a18a452c21ee48bd 100644 (file)
@@ -369,28 +369,28 @@ static int drm_vm_sg_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 }
 
 /** AGP virtual memory operations */
-static struct vm_operations_struct drm_vm_ops = {
+static const struct vm_operations_struct drm_vm_ops = {
        .fault = drm_vm_fault,
        .open = drm_vm_open,
        .close = drm_vm_close,
 };
 
 /** Shared virtual memory operations */
-static struct vm_operations_struct drm_vm_shm_ops = {
+static const struct vm_operations_struct drm_vm_shm_ops = {
        .fault = drm_vm_shm_fault,
        .open = drm_vm_open,
        .close = drm_vm_shm_close,
 };
 
 /** DMA virtual memory operations */
-static struct vm_operations_struct drm_vm_dma_ops = {
+static const struct vm_operations_struct drm_vm_dma_ops = {
        .fault = drm_vm_dma_fault,
        .open = drm_vm_open,
        .close = drm_vm_close,
 };
 
 /** Scatter-gather virtual memory operations */
-static struct vm_operations_struct drm_vm_sg_ops = {
+static const struct vm_operations_struct drm_vm_sg_ops = {
        .fault = drm_vm_sg_fault,
        .open = drm_vm_open,
        .close = drm_vm_close,
index acd889c945494b27e0722f6bd37d0afae5b29e95..5b1cf04a011adf4fe26e46311f4df6b285e4dd1f 100644 (file)
@@ -530,7 +530,7 @@ void radeon_ttm_fini(struct radeon_device *rdev)
 }
 
 static struct vm_operations_struct radeon_ttm_vm_ops;
-static struct vm_operations_struct *ttm_vm_ops = NULL;
+static const struct vm_operations_struct *ttm_vm_ops = NULL;
 
 static int radeon_ttm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
index 33de7637c0c63766e4ac933ce5aada21b408a641..1c040d0403389c6b9285bc2cfa55c110134a3bb9 100644 (file)
@@ -228,7 +228,7 @@ static void ttm_bo_vm_close(struct vm_area_struct *vma)
        vma->vm_private_data = NULL;
 }
 
-static struct vm_operations_struct ttm_bo_vm_ops = {
+static const struct vm_operations_struct ttm_bo_vm_ops = {
        .fault = ttm_bo_vm_fault,
        .open = ttm_bo_vm_open,
        .close = ttm_bo_vm_close
index 1aba8c13fe8fb87b8c04337df31ed28bb6d1afc3..8e7e3344c4b3fdfdd54ae4591843c4313fb93d7a 100644 (file)
@@ -247,7 +247,7 @@ static int dma_region_pagefault(struct vm_area_struct *vma,
        return 0;
 }
 
-static struct vm_operations_struct dma_region_vm_ops = {
+static const struct vm_operations_struct dma_region_vm_ops = {
        .fault = dma_region_pagefault,
 };
 
index 3cb688d2913135821902c16e9f850abe26cc1cb2..f1565cae8ec6c6be02c56185121f2f913ceaff2e 100644 (file)
@@ -95,7 +95,7 @@ static void ehca_mm_close(struct vm_area_struct *vma)
                     vma->vm_start, vma->vm_end, *count);
 }
 
-static struct vm_operations_struct vm_ops = {
+static const struct vm_operations_struct vm_ops = {
        .open = ehca_mm_open,
        .close = ehca_mm_close,
 };
index 38a287006612c055b3a1faa32800099041257c35..40dbe54056c7ad9cf26b92f66ce7de6b00b65df6 100644 (file)
@@ -1151,7 +1151,7 @@ static int ipath_file_vma_fault(struct vm_area_struct *vma,
        return 0;
 }
 
-static struct vm_operations_struct ipath_file_vm_ops = {
+static const struct vm_operations_struct ipath_file_vm_ops = {
        .fault = ipath_file_vma_fault,
 };
 
index fa830e22002fc09d9bcea91f0b908b60558d60f7..b28865faf435179078a1aed86e16c38326da10c8 100644 (file)
@@ -74,7 +74,7 @@ static void ipath_vma_close(struct vm_area_struct *vma)
        kref_put(&ip->ref, ipath_release_mmap_info);
 }
 
-static struct vm_operations_struct ipath_vm_ops = {
+static const struct vm_operations_struct ipath_vm_ops = {
        .open =     ipath_vma_open,
        .close =    ipath_vma_close,
 };
index 657c481d255c82f61bacdaba995bed724e550e48..10230cb3d210ffd18927fcd023df5f1b58478114 100644 (file)
@@ -1325,7 +1325,7 @@ static void cafe_v4l_vm_close(struct vm_area_struct *vma)
        mutex_unlock(&sbuf->cam->s_mutex);
 }
 
-static struct vm_operations_struct cafe_v4l_vm_ops = {
+static const struct vm_operations_struct cafe_v4l_vm_ops = {
        .open = cafe_v4l_vm_open,
        .close = cafe_v4l_vm_close
 };
index 74092f436be61103e8817fb1c95e04249d6a4207..88987a57cf7b655e820517a32fd35f67fe83c1d1 100644 (file)
@@ -1496,7 +1496,7 @@ static void et61x251_vm_close(struct vm_area_struct* vma)
 }
 
 
-static struct vm_operations_struct et61x251_vm_ops = {
+static const struct vm_operations_struct et61x251_vm_ops = {
        .open = et61x251_vm_open,
        .close = et61x251_vm_close,
 };
index cf6540da1e429ac0e9856ba9b3785c556e2197d8..23d3fb7769186f921c0b90eccdf9cd4471301075 100644 (file)
@@ -99,7 +99,7 @@ static void gspca_vm_close(struct vm_area_struct *vma)
                frame->v4l2_buf.flags &= ~V4L2_BUF_FLAG_MAPPED;
 }
 
-static struct vm_operations_struct gspca_vm_ops = {
+static const struct vm_operations_struct gspca_vm_ops = {
        .open           = gspca_vm_open,
        .close          = gspca_vm_close,
 };
index d0765bed79c9512c727e561ddf4bf8cb59a7c525..4b1bc05a462cefcc59020baa1cdaf6dbb8a1cbe7 100644 (file)
@@ -1589,7 +1589,7 @@ static void meye_vm_close(struct vm_area_struct *vma)
        meye.vma_use_count[idx]--;
 }
 
-static struct vm_operations_struct meye_vm_ops = {
+static const struct vm_operations_struct meye_vm_ops = {
        .open           = meye_vm_open,
        .close          = meye_vm_close,
 };
index 9d84c94e8a404ae9f050b850f910c89d167c2d57..4a7711c3e745f33f6e362ed246490a5e4d0971fe 100644 (file)
@@ -2077,7 +2077,7 @@ static void sn9c102_vm_close(struct vm_area_struct* vma)
 }
 
 
-static struct vm_operations_struct sn9c102_vm_ops = {
+static const struct vm_operations_struct sn9c102_vm_ops = {
        .open = sn9c102_vm_open,
        .close = sn9c102_vm_close,
 };
index 0b996ea4134eeac750bb14cb21d068f7c72d0b14..6b41865f42bdaf93078be0229124e6af403e7fc4 100644 (file)
@@ -790,7 +790,7 @@ static void stk_v4l_vm_close(struct vm_area_struct *vma)
        if (sbuf->mapcount == 0)
                sbuf->v4lbuf.flags &= ~V4L2_BUF_FLAG_MAPPED;
 }
-static struct vm_operations_struct stk_v4l_vm_ops = {
+static const struct vm_operations_struct stk_v4l_vm_ops = {
        .open = stk_v4l_vm_open,
        .close = stk_v4l_vm_close
 };
index 9e7351569b5dc63498dad2982dba5cddb0db6b41..a2bdd806efab1e8244dc551c3bf2d0fcf4d0ab7d 100644 (file)
@@ -1069,7 +1069,7 @@ static void uvc_vm_close(struct vm_area_struct *vma)
        buffer->vma_use_count--;
 }
 
-static struct vm_operations_struct uvc_vm_ops = {
+static const struct vm_operations_struct uvc_vm_ops = {
        .open           = uvc_vm_open,
        .close          = uvc_vm_close,
 };
index d09ce83a9429af98060b7d3dd27e21923f2431ea..635ffc7b03910582b215b3399f27f4eef912b181 100644 (file)
@@ -105,7 +105,7 @@ static void videobuf_vm_close(struct vm_area_struct *vma)
        }
 }
 
-static struct vm_operations_struct videobuf_vm_ops = {
+static const struct vm_operations_struct videobuf_vm_ops = {
        .open     = videobuf_vm_open,
        .close    = videobuf_vm_close,
 };
index a8dd22ace3fbb270b938ba815b617ba815a98fae..53cdd67cebe14e6407d352d7de27c7f109f4d66e 100644 (file)
@@ -394,7 +394,7 @@ videobuf_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        return 0;
 }
 
-static struct vm_operations_struct videobuf_vm_ops =
+static const struct vm_operations_struct videobuf_vm_ops =
 {
        .open     = videobuf_vm_open,
        .close    = videobuf_vm_close,
index 30ae30f99ccc38dd6f10bd0b0685e7e881111099..35f3900c5633294764f86483b3ea5bd5bba851db 100644 (file)
@@ -116,7 +116,7 @@ static void videobuf_vm_close(struct vm_area_struct *vma)
        return;
 }
 
-static struct vm_operations_struct videobuf_vm_ops =
+static const struct vm_operations_struct videobuf_vm_ops =
 {
        .open     = videobuf_vm_open,
        .close    = videobuf_vm_close,
index cd6a3446ab7ee395577dd8670bb6271a17372b84..b034a81d2b1c41f0cdb4cf73eef0ff36ebf1cb6d 100644 (file)
@@ -3857,7 +3857,7 @@ static void vino_vm_close(struct vm_area_struct *vma)
        dprintk("vino_vm_close(): count = %d\n", fb->map_count);
 }
 
-static struct vm_operations_struct vino_vm_ops = {
+static const struct vm_operations_struct vino_vm_ops = {
        .open   = vino_vm_open,
        .close  = vino_vm_close,
 };
index b3c6436b33ba6ddf9b8515a0e7f5011ec40e9402..312a71336fd040d3519a04b41901ce4bb70f6084 100644 (file)
@@ -935,7 +935,7 @@ static void zc0301_vm_close(struct vm_area_struct* vma)
 }
 
 
-static struct vm_operations_struct zc0301_vm_ops = {
+static const struct vm_operations_struct zc0301_vm_ops = {
        .open = zc0301_vm_open,
        .close = zc0301_vm_close,
 };
index bcdefb1bcb3dc450a54b0c05fb9e58c7dd91c81b..47137deafcfd9b5a04951ca7c6cc0745f1ebe4af 100644 (file)
@@ -3172,7 +3172,7 @@ zoran_vm_close (struct vm_area_struct *vma)
        mutex_unlock(&zr->resource_lock);
 }
 
-static struct vm_operations_struct zoran_vm_ops = {
+static const struct vm_operations_struct zoran_vm_ops = {
        .open = zoran_vm_open,
        .close = zoran_vm_close,
 };
index aed609832bc2bf1c0497dedbd0257bcfcbf7e70a..300e7ba391a0faffcb436ed4974a573e0a2b4618 100644 (file)
@@ -438,7 +438,7 @@ static struct miscdevice gru_miscdev = {
        .fops           = &gru_fops,
 };
 
-struct vm_operations_struct gru_vm_ops = {
+const struct vm_operations_struct gru_vm_ops = {
        .close          = gru_vma_close,
        .fault          = gru_fault,
 };
index 34ab3d4539193d9aa831154f4cd9e5aa6ba1ef1b..46990bcfa5369a541719cfcde7d0532aedaaca8c 100644 (file)
@@ -624,7 +624,7 @@ static inline int is_kernel_context(struct gru_thread_state *gts)
  */
 struct gru_unload_context_req;
 
-extern struct vm_operations_struct gru_vm_ops;
+extern const struct vm_operations_struct gru_vm_ops;
 extern struct device *grudev;
 
 extern struct gru_vma_data *gru_alloc_vma_data(struct vm_area_struct *vma,
index 848b59466850ac1427a1647047aa35a4f607ff8e..0cb049f5cc567c0f107b6b8f913ab4f258e58d4d 100644 (file)
@@ -1185,7 +1185,7 @@ sg_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        return VM_FAULT_SIGBUS;
 }
 
-static struct vm_operations_struct sg_mmap_vm_ops = {
+static const struct vm_operations_struct sg_mmap_vm_ops = {
        .fault = sg_vma_fault,
 };
 
index 03efb065455fa6ef1e9db0d091db9bcad1960e12..a9d7070472021908aaa17d2e32828db50857ab3d 100644 (file)
@@ -658,7 +658,7 @@ static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        return 0;
 }
 
-static struct vm_operations_struct uio_vm_ops = {
+static const struct vm_operations_struct uio_vm_ops = {
        .open = uio_vma_open,
        .close = uio_vma_close,
        .fault = uio_vma_fault,
index dfdc43e2e00df86414fd2097e24a578c53e16174..9ed3e741bee160c7f2d71906810146f95f1da59a 100644 (file)
@@ -1174,7 +1174,7 @@ static int mon_bin_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        return 0;
 }
 
-static struct vm_operations_struct mon_bin_vm_ops = {
+static const struct vm_operations_struct mon_bin_vm_ops = {
        .open =     mon_bin_vma_open,
        .close =    mon_bin_vma_close,
        .fault =    mon_bin_vma_fault,
index 0a7a6679ee6eb05e2be754ff816ba3547a0f7fdb..c27ab1ed96049ba00a20d600311e7239d9f6e818 100644 (file)
@@ -125,7 +125,7 @@ page_already_added:
        return 0;
 }
 
-static struct vm_operations_struct fb_deferred_io_vm_ops = {
+static const struct vm_operations_struct fb_deferred_io_vm_ops = {
        .fault          = fb_deferred_io_fault,
        .page_mkwrite   = fb_deferred_io_mkwrite,
 };
index 80a11d078df4554a2823e6f75c043674686afeb4..f16e421542290e64cf2af8bc6696e176beb4dfe3 100644 (file)
@@ -1035,7 +1035,7 @@ static void mmap_user_close(struct vm_area_struct *vma)
        atomic_dec(&dispc.map_count[plane]);
 }
 
-static struct vm_operations_struct mmap_user_ops = {
+static const struct vm_operations_struct mmap_user_ops = {
        .open = mmap_user_open,
        .close = mmap_user_close,
 };
index 571ad3c13b47be3de640f4ce84253f3ce593b26d..a3492a3ad96b960fecec513d4023f7ee641fcf81 100644 (file)
@@ -1184,7 +1184,7 @@ out:
        return ret > 0 ? EIO : ret;
 }
 
-static struct vm_operations_struct btrfs_file_vm_ops = {
+static const struct vm_operations_struct btrfs_file_vm_ops = {
        .fault          = filemap_fault,
        .page_mkwrite   = btrfs_page_mkwrite,
 };
index 5ca3eca70a1ef537763e18e12bf9feb7f615e9d3..9630583cef280d541e87505eba2cfa37589266e3 100644 (file)
@@ -81,7 +81,7 @@ ext4_file_write(struct kiocb *iocb, const struct iovec *iov,
        return generic_file_aio_write(iocb, iov, nr_segs, pos);
 }
 
-static struct vm_operations_struct ext4_file_vm_ops = {
+static const struct vm_operations_struct ext4_file_vm_ops = {
        .fault          = filemap_fault,
        .page_mkwrite   = ext4_page_mkwrite,
 };
index cbc464043b6f02f1383be3153e24b73b2e8f4875..a3492f7d207c32403f482bc2b1ec02fe24e10a51 100644 (file)
@@ -1313,7 +1313,7 @@ static int fuse_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
        return 0;
 }
 
-static struct vm_operations_struct fuse_file_vm_ops = {
+static const struct vm_operations_struct fuse_file_vm_ops = {
        .close          = fuse_vma_close,
        .fault          = filemap_fault,
        .page_mkwrite   = fuse_page_mkwrite,
index 166f38fbd246ecfca9125b929794be724d62b0a2..4eb308aa32342f0f51eb00cafefda3ecbb6ada17 100644 (file)
@@ -418,7 +418,7 @@ out:
        return ret;
 }
 
-static struct vm_operations_struct gfs2_vm_ops = {
+static const struct vm_operations_struct gfs2_vm_ops = {
        .fault = filemap_fault,
        .page_mkwrite = gfs2_page_mkwrite,
 };
index 5d8dcb9ee326ffcbb3b747666a9f44f1431f7bb8..15458decdb8a33b547f7f3fb401e2ca4ac169d71 100644 (file)
@@ -95,7 +95,7 @@ static int ncp_file_mmap_fault(struct vm_area_struct *area,
        return VM_FAULT_MAJOR;
 }
 
-static struct vm_operations_struct ncp_file_mmap =
+static const struct vm_operations_struct ncp_file_mmap =
 {
        .fault = ncp_file_mmap_fault,
 };
index 86d6b4db1096ea47529c472b819ec7bdb483672c..f5fdd39e037a49ea5073aa32d19a5cb884d64a76 100644 (file)
@@ -59,7 +59,7 @@ static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl);
 static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl);
 static int nfs_setlease(struct file *file, long arg, struct file_lock **fl);
 
-static struct vm_operations_struct nfs_file_vm_ops;
+static const struct vm_operations_struct nfs_file_vm_ops;
 
 const struct file_operations nfs_file_operations = {
        .llseek         = nfs_file_llseek,
@@ -572,7 +572,7 @@ out_unlock:
        return VM_FAULT_SIGBUS;
 }
 
-static struct vm_operations_struct nfs_file_vm_ops = {
+static const struct vm_operations_struct nfs_file_vm_ops = {
        .fault = filemap_fault,
        .page_mkwrite = nfs_vm_page_mkwrite,
 };
index fc8278c77cdda4028565931f1c678fb0cd1121b2..7d7b4983dee3d631c22456d0c2d6581bf4239b9c 100644 (file)
@@ -117,7 +117,7 @@ static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
        return 0;
 }
 
-struct vm_operations_struct nilfs_file_vm_ops = {
+static const struct vm_operations_struct nilfs_file_vm_ops = {
        .fault          = filemap_fault,
        .page_mkwrite   = nilfs_page_mkwrite,
 };
index b606496b72ec55c65554c6e72a9353e7739a4e9f..39737613424a2c073c21c540e7b022b96e344da9 100644 (file)
@@ -202,7 +202,7 @@ out:
        return ret;
 }
 
-static struct vm_operations_struct ocfs2_file_vm_ops = {
+static const struct vm_operations_struct ocfs2_file_vm_ops = {
        .fault          = ocfs2_fault,
        .page_mkwrite   = ocfs2_page_mkwrite,
 };
index 2524714bece1b87e68d68c6928cfd720f0a9b259..60c702bc10ae43c9fe85be8105ca3e856a7ff533 100644 (file)
@@ -40,7 +40,7 @@ struct bin_buffer {
        struct mutex                    mutex;
        void                            *buffer;
        int                             mmapped;
-       struct vm_operations_struct     *vm_ops;
+       const struct vm_operations_struct *vm_ops;
        struct file                     *file;
        struct hlist_node               list;
 };
@@ -331,7 +331,7 @@ static int bin_migrate(struct vm_area_struct *vma, const nodemask_t *from,
 }
 #endif
 
-static struct vm_operations_struct bin_vm_ops = {
+static const struct vm_operations_struct bin_vm_ops = {
        .open           = bin_vma_open,
        .close          = bin_vma_close,
        .fault          = bin_fault,
index 2e6481a7701cdd9d80e7ad76b5fe0b783cfbbc7b..1009adc8d602f264787af5b12d3642b6303df2c8 100644 (file)
@@ -1534,7 +1534,7 @@ out_unlock:
        return err;
 }
 
-static struct vm_operations_struct ubifs_file_vm_ops = {
+static const struct vm_operations_struct ubifs_file_vm_ops = {
        .fault        = filemap_fault,
        .page_mkwrite = ubifs_vm_page_mkwrite,
 };
index 988d8f87bc0f80b8a23d18397bcbac8f3116647e..629370974e57e6010eee6fc44e7d5d7127514c1a 100644 (file)
@@ -42,7 +42,7 @@
 
 #include <linux/dcache.h>
 
-static struct vm_operations_struct xfs_file_vm_ops;
+static const struct vm_operations_struct xfs_file_vm_ops;
 
 STATIC ssize_t
 xfs_file_aio_read(
@@ -280,7 +280,7 @@ const struct file_operations xfs_dir_file_operations = {
        .fsync          = xfs_file_fsync,
 };
 
-static struct vm_operations_struct xfs_file_vm_ops = {
+static const struct vm_operations_struct xfs_file_vm_ops = {
        .fault          = filemap_fault,
        .page_mkwrite   = xfs_vm_page_mkwrite,
 };
index 880130f7311fca6006b97e10865744b1461188b2..9101ed64f803c64d3158df9aa134d8d4ffd26789 100644 (file)
@@ -53,7 +53,7 @@ struct agp_kern_info {
        int current_memory;
        bool cant_use_aperture;
        unsigned long page_mask;
-       struct vm_operations_struct *vm_ops;
+       const struct vm_operations_struct *vm_ops;
 };
 
 /*
index 16937995abd45485483683311f4ad891a99643bd..41a59afc70faffdccd55fa9d0a0616df15fcb7ff 100644 (file)
@@ -163,7 +163,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
 }
 
 extern const struct file_operations hugetlbfs_file_operations;
-extern struct vm_operations_struct hugetlb_vm_ops;
+extern const struct vm_operations_struct hugetlb_vm_ops;
 struct file *hugetlb_file_setup(const char *name, size_t size, int acct,
                                struct user_struct **user, int creat_flags);
 int hugetlb_get_quota(struct address_space *mapping, long delta);
index 21d6aa45206aa985a01c1a1fcfb9faaf7ff83307..84a524afb3dcdffdd60c7ef1eaf2672acd7731ca 100644 (file)
@@ -171,7 +171,7 @@ struct vm_area_struct {
        struct anon_vma *anon_vma;      /* Serialized by page_table_lock */
 
        /* Function pointers to deal with this struct. */
-       struct vm_operations_struct * vm_ops;
+       const struct vm_operations_struct *vm_ops;
 
        /* Information about our backing store: */
        unsigned long vm_pgoff;         /* Offset (within vm_file) in PAGE_SIZE
index 37aaf2b3986386b3c73784e91c8b70327ecfbbd2..4e768dda87b0ba09290a46dc0bda9cbdd4d4bd10 100644 (file)
@@ -17,7 +17,7 @@ extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma);
 #endif
 
 extern const struct file_operations ramfs_file_operations;
-extern struct vm_operations_struct generic_file_vm_ops;
+extern const struct vm_operations_struct generic_file_vm_ops;
 extern int __init init_rootfs(void);
 
 #endif
index 9eb1488b543bc9e8ae419035a86e489e9bf4c8c6..464694e0aa4a19c74b973a2a69f0d88049b9c512 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -55,7 +55,7 @@ struct shm_file_data {
 #define shm_file_data(file) (*((struct shm_file_data **)&(file)->private_data))
 
 static const struct file_operations shm_file_operations;
-static struct vm_operations_struct shm_vm_ops;
+static const struct vm_operations_struct shm_vm_ops;
 
 #define shm_ids(ns)    ((ns)->ids[IPC_SHM_IDS])
 
@@ -312,7 +312,7 @@ static const struct file_operations shm_file_operations = {
        .get_unmapped_area      = shm_get_unmapped_area,
 };
 
-static struct vm_operations_struct shm_vm_ops = {
+static const struct vm_operations_struct shm_vm_ops = {
        .open   = shm_open,     /* callback for a new vm-area open */
        .close  = shm_close,    /* callback for when the vm-area is released */
        .fault  = shm_fault,
index 76ac4db405e900ac0444a3ff10eab78b8d30a74b..0f86feb6db0c227c2f4e7b1c47c8b4d2c0e92156 100644 (file)
@@ -2253,7 +2253,7 @@ static void perf_mmap_close(struct vm_area_struct *vma)
        }
 }
 
-static struct vm_operations_struct perf_mmap_vmops = {
+static const struct vm_operations_struct perf_mmap_vmops = {
        .open           = perf_mmap_open,
        .close          = perf_mmap_close,
        .fault          = perf_mmap_fault,
index bc188549788f4f8876e86a729d85267904a839e7..760c26209a3c4b49442a3d12d8759b7a66c1903a 100644 (file)
@@ -60,7 +60,7 @@ static int relay_buf_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 /*
  * vm_ops for relay file mappings.
  */
-static struct vm_operations_struct relay_file_mmap_ops = {
+static const struct vm_operations_struct relay_file_mmap_ops = {
        .fault = relay_buf_fault,
        .close = relay_file_mmap_close,
 };
index 6c84e598b4a9f7a0c2901387f32307c4e96ebaae..ef169f37156da22cc3f07d5dd9092dea00315b7f 100644 (file)
@@ -1611,7 +1611,7 @@ page_not_uptodate:
 }
 EXPORT_SYMBOL(filemap_fault);
 
-struct vm_operations_struct generic_file_vm_ops = {
+const struct vm_operations_struct generic_file_vm_ops = {
        .fault          = filemap_fault,
 };
 
index 427dfe3ce78c68eebe0afde4636b6fdc91ecdec5..1888b2d71bb8d78a1a17ec408d1865a7919e76ea 100644 (file)
@@ -296,7 +296,7 @@ out:
        }
 }
 
-static struct vm_operations_struct xip_file_vm_ops = {
+static const struct vm_operations_struct xip_file_vm_ops = {
        .fault  = xip_file_fault,
 };
 
index 6f048fcc749ca48b3bae0a1a37a792f15e0c203d..5d7601b0287487321314c1d969f17425b339f9b1 100644 (file)
@@ -1721,7 +1721,7 @@ static int hugetlb_vm_op_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        return 0;
 }
 
-struct vm_operations_struct hugetlb_vm_ops = {
+const struct vm_operations_struct hugetlb_vm_ops = {
        .fault = hugetlb_vm_op_fault,
        .open = hugetlb_vm_op_open,
        .close = hugetlb_vm_op_close,
index 21d4029a07b31799d0a606b05b970eb2f27a6206..73f5e4b640104f356c2df4956db6324ebe28b327 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2282,7 +2282,7 @@ static void special_mapping_close(struct vm_area_struct *vma)
 {
 }
 
-static struct vm_operations_struct special_mapping_vmops = {
+static const struct vm_operations_struct special_mapping_vmops = {
        .close = special_mapping_close,
        .fault = special_mapping_fault,
 };
index c73aa4753d793d55a2f35c5b9332ad80932147a2..5189b5aed8c073a388ca5f2dafcc9c3240f7c938 100644 (file)
@@ -79,7 +79,7 @@ static struct kmem_cache *vm_region_jar;
 struct rb_root nommu_region_tree = RB_ROOT;
 DECLARE_RWSEM(nommu_region_sem);
 
-struct vm_operations_struct generic_file_vm_ops = {
+const struct vm_operations_struct generic_file_vm_ops = {
 };
 
 /*
index ccf446a9faa141e28e30fd66ca035503f72c6763..356dd99566ecb671cd324ba3dddcee10441312f0 100644 (file)
@@ -218,7 +218,7 @@ static const struct file_operations shmem_file_operations;
 static const struct inode_operations shmem_inode_operations;
 static const struct inode_operations shmem_dir_inode_operations;
 static const struct inode_operations shmem_special_inode_operations;
-static struct vm_operations_struct shmem_vm_ops;
+static const struct vm_operations_struct shmem_vm_ops;
 
 static struct backing_dev_info shmem_backing_dev_info  __read_mostly = {
        .ra_pages       = 0,    /* No readahead */
@@ -2498,7 +2498,7 @@ static const struct super_operations shmem_ops = {
        .put_super      = shmem_put_super,
 };
 
-static struct vm_operations_struct shmem_vm_ops = {
+static const struct vm_operations_struct shmem_vm_ops = {
        .fault          = shmem_fault,
 #ifdef CONFIG_NUMA
        .set_policy     = shmem_set_policy,
index d3d52c66cdc27567799068bd6dcf711643aab1d3..103d5611b8181dba6f3cb523dae9af20b17257e6 100644 (file)
@@ -2084,7 +2084,7 @@ static void packet_mm_close(struct vm_area_struct *vma)
                atomic_dec(&pkt_sk(sk)->mapped);
 }
 
-static struct vm_operations_struct packet_mmap_ops = {
+static const struct vm_operations_struct packet_mmap_ops = {
        .open   =       packet_mm_open,
        .close  =       packet_mm_close,
 };
index 561d6d95a2d33fef48b98ccfc29c32571cb9dddd..ab73edf2c89a1fe4e996c5f2d7ea6c751fba2d30 100644 (file)
@@ -2985,7 +2985,7 @@ static int snd_pcm_mmap_status_fault(struct vm_area_struct *area,
        return 0;
 }
 
-static struct vm_operations_struct snd_pcm_vm_ops_status =
+static const struct vm_operations_struct snd_pcm_vm_ops_status =
 {
        .fault =        snd_pcm_mmap_status_fault,
 };
@@ -3024,7 +3024,7 @@ static int snd_pcm_mmap_control_fault(struct vm_area_struct *area,
        return 0;
 }
 
-static struct vm_operations_struct snd_pcm_vm_ops_control =
+static const struct vm_operations_struct snd_pcm_vm_ops_control =
 {
        .fault =        snd_pcm_mmap_control_fault,
 };
@@ -3094,7 +3094,7 @@ static int snd_pcm_mmap_data_fault(struct vm_area_struct *area,
        return 0;
 }
 
-static struct vm_operations_struct snd_pcm_vm_ops_data =
+static const struct vm_operations_struct snd_pcm_vm_ops_data =
 {
        .open =         snd_pcm_mmap_data_open,
        .close =        snd_pcm_mmap_data_close,
@@ -3118,7 +3118,7 @@ static int snd_pcm_default_mmap(struct snd_pcm_substream *substream,
  * mmap the DMA buffer on I/O memory area
  */
 #if SNDRV_PCM_INFO_MMAP_IOMEM
-static struct vm_operations_struct snd_pcm_vm_ops_data_mmio =
+static const struct vm_operations_struct snd_pcm_vm_ops_data_mmio =
 {
        .open =         snd_pcm_mmap_data_open,
        .close =        snd_pcm_mmap_data_close,
index fd44946ce4b3a21aa4bae548144fcf6b66df676b..99f33766cd5131421fadd2bb00ea9294346c05e5 100644 (file)
@@ -154,7 +154,7 @@ static void usb_stream_hwdep_vm_close(struct vm_area_struct *area)
        snd_printdd(KERN_DEBUG "%i\n", atomic_read(&us122l->mmap_count));
 }
 
-static struct vm_operations_struct usb_stream_hwdep_vm_ops = {
+static const struct vm_operations_struct usb_stream_hwdep_vm_ops = {
        .open = usb_stream_hwdep_vm_open,
        .fault = usb_stream_hwdep_vm_fault,
        .close = usb_stream_hwdep_vm_close,
index f3d8f71265dd3bfee1540442184ed226a5f88cf6..52e04b2f35d3e7e1eb73e05b671a1f7ee086bd02 100644 (file)
@@ -53,7 +53,7 @@ static int snd_us428ctls_vm_fault(struct vm_area_struct *area,
        return 0;
 }
 
-static struct vm_operations_struct us428ctls_vm_ops = {
+static const struct vm_operations_struct us428ctls_vm_ops = {
        .fault = snd_us428ctls_vm_fault,
 };
 
index 117946f2debb3a04891d87de9327c16d8f27f7fe..4b2304c2e02dd2fdf806e1f1f776f6196531d7f1 100644 (file)
@@ -697,7 +697,7 @@ static int snd_usX2Y_hwdep_pcm_vm_fault(struct vm_area_struct *area,
 }
 
 
-static struct vm_operations_struct snd_usX2Y_hwdep_pcm_vm_ops = {
+static const struct vm_operations_struct snd_usX2Y_hwdep_pcm_vm_ops = {
        .open = snd_usX2Y_hwdep_pcm_vm_open,
        .close = snd_usX2Y_hwdep_pcm_vm_close,
        .fault = snd_usX2Y_hwdep_pcm_vm_fault,
index 034a798b0431e98209489f793b904bfda9cf463c..b5e7e3f1183f24236fcaef9d16c4cfad63326f83 100644 (file)
@@ -1713,7 +1713,7 @@ static int kvm_vcpu_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        return 0;
 }
 
-static struct vm_operations_struct kvm_vcpu_vm_ops = {
+static const struct vm_operations_struct kvm_vcpu_vm_ops = {
        .fault = kvm_vcpu_fault,
 };
 
@@ -2317,7 +2317,7 @@ static int kvm_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        return 0;
 }
 
-static struct vm_operations_struct kvm_vm_vm_ops = {
+static const struct vm_operations_struct kvm_vm_vm_ops = {
        .fault = kvm_vm_fault,
 };