[PATCH] mark f_ops const in the inode

Mark the f_ops members of inodes as const, as well as fix the
ripple-through this causes by places that copy this f_ops and then "do
stuff" with it.

Signed-off-by: Arjan van de Ven <[email protected]>
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Arjan van de Ven 2006-03-28 01:56:41 -08:00 • committed by Linus Torvalds
commit 99ac48f54a
42 changed files with 75 additions and 74 deletions

View file

@ -175,7 +175,7 @@ int drm_stub_open(struct inode *inode, struct file *filp)
drm_device_t *dev = NULL;
int minor = iminor(inode);
int err = -ENODEV;
struct file_operations *old_fops;
const struct file_operations *old_fops;
DRM_DEBUG("\n");

View file

@ -126,7 +126,7 @@ static int i810_map_buffer(drm_buf_t * buf, struct file *filp)
drm_device_t *dev = priv->head->dev;
drm_i810_buf_priv_t *buf_priv = buf->dev_private;
drm_i810_private_t *dev_priv = dev->dev_private;
struct file_operations *old_fops;
const struct file_operations *old_fops;
int retcode = 0;
if (buf_priv->currently_mapped == I810_BUF_MAPPED)

View file

@ -128,7 +128,7 @@ static int i830_map_buffer(drm_buf_t * buf, struct file *filp)
drm_device_t *dev = priv->head->dev;
drm_i830_buf_priv_t *buf_priv = buf->dev_private;
drm_i830_private_t *dev_priv = dev->dev_private;
struct file_operations *old_fops;
const struct file_operations *old_fops;
unsigned long virtual;
int retcode = 0;

View file

@ -899,7 +899,7 @@ static const struct {
unsigned int minor;
char *name;
umode_t mode;
struct file_operations *fops;
const struct file_operations *fops;
} devlist[] = { /* list of minor devices */
{1, "mem", S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops},
{2, "kmem", S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops},

View file

@ -129,7 +129,7 @@ static int misc_open(struct inode * inode, struct file * file)
int minor = iminor(inode);
struct miscdevice *c;
int err = -ENODEV;
struct file_operations *old_fops, *new_fops = NULL;
const struct file_operations *old_fops, *new_fops = NULL;
down(&misc_sem);

View file

@ -923,7 +923,7 @@ void input_unregister_handler(struct input_handler *handler)
static int input_open_file(struct inode *inode, struct file *file)
{
struct input_handler *handler = input_table[iminor(inode) >> 5];
struct file_operations *old_fops, *new_fops = NULL;
const struct file_operations *old_fops, *new_fops = NULL;
int err;
/* No load-on-demand here? */

View file

@ -233,7 +233,7 @@ static struct file_operations proc_applstats_ops = {
};
static void
create_seq_entry(char *name, mode_t mode, struct file_operations *f)
create_seq_entry(char *name, mode_t mode, const struct file_operations *f)
{
struct proc_dir_entry *entry;
entry = create_proc_entry(name, mode, NULL);

View file

@ -86,7 +86,7 @@ static int dvb_device_open(struct inode *inode, struct file *file)
if (dvbdev && dvbdev->fops) {
int err = 0;
struct file_operations *old_fops;
const struct file_operations *old_fops;
file->private_data = dvbdev;
old_fops = file->f_op;

View file

@ -97,7 +97,7 @@ static int video_open(struct inode *inode, struct file *file)
unsigned int minor = iminor(inode);
int err = 0;
struct video_device *vfl;
struct file_operations *old_fops;
const struct file_operations *old_fops;
if(minor>=VIDEO_NUM_DEVICES)
return -ENODEV;

View file

@ -56,7 +56,7 @@
typedef struct _i2o_proc_entry_t {
char *name; /* entry name */
mode_t mode; /* mode */
struct file_operations *fops; /* open function */
const struct file_operations *fops; /* open function */
} i2o_proc_entry;
/* global I2O /proc/i2o entry */

View file

@ -130,7 +130,7 @@ static struct file_operations ulong_ro_fops = {
static struct dentry * __oprofilefs_create_file(struct super_block * sb,
struct dentry * root, char const * name, struct file_operations * fops,
struct dentry * root, char const * name, const struct file_operations * fops,
int perm)
{
struct dentry * dentry;
@ -203,7 +203,7 @@ int oprofilefs_create_ro_atomic(struct super_block * sb, struct dentry * root,
int oprofilefs_create_file(struct super_block * sb, struct dentry * root,
char const * name, struct file_operations * fops)
char const * name, const struct file_operations * fops)
{
if (!__oprofilefs_create_file(sb, root, name, fops, 0644))
return -EFAULT;
@ -212,7 +212,7 @@ int oprofilefs_create_file(struct super_block * sb, struct dentry * root,
int oprofilefs_create_file_perm(struct super_block * sb, struct dentry * root,
char const * name, struct file_operations * fops, int perm)
char const * name, const struct file_operations * fops, int perm)
{
if (!__oprofilefs_create_file(sb, root, name, fops, perm))
return -EFAULT;

View file

@ -49,7 +49,7 @@ static int phone_open(struct inode *inode, struct file *file)
unsigned int minor = iminor(inode);
int err = 0;
struct phone_device *p;
struct file_operations *old_fops, *new_fops = NULL;
const struct file_operations *old_fops, *new_fops = NULL;
if (minor >= PHONE_NUM_DEVICES)
return -ENODEV;

View file

@ -24,15 +24,15 @@
#include "usb.h"
#define MAX_USB_MINORS 256
static struct file_operations *usb_minors[MAX_USB_MINORS];
static const struct file_operations *usb_minors[MAX_USB_MINORS];
static DEFINE_SPINLOCK(minor_lock);
static int usb_open(struct inode * inode, struct file * file)
{
int minor = iminor(inode);
struct file_operations *c;
const struct file_operations *c;
int err = -ENODEV;
struct file_operations *old_fops, *new_fops = NULL;
const struct file_operations *old_fops, *new_fops = NULL;
spin_lock (&minor_lock);
c = usb_minors[minor];

View file

@ -1581,7 +1581,7 @@ restart:
static struct inode *
gadgetfs_create_file (struct super_block *sb, char const *name,
void *data, struct file_operations *fops,
void *data, const struct file_operations *fops,
struct dentry **dentry_p);
static int activate_ep_files (struct dev_data *dev)
@ -1955,7 +1955,7 @@ module_param (default_perm, uint, 0644);
static struct inode *
gadgetfs_make_inode (struct super_block *sb,
void *data, struct file_operations *fops,
void *data, const struct file_operations *fops,
int mode)
{
struct inode *inode = new_inode (sb);
@ -1979,7 +1979,7 @@ gadgetfs_make_inode (struct super_block *sb,
*/
static struct inode *
gadgetfs_create_file (struct super_block *sb, char const *name,
void *data, struct file_operations *fops,
void *data, const struct file_operations *fops,
struct dentry **dentry_p)
{
struct dentry *dentry;