[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 <arjan@infradead.org>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Arjan van de Ven
2006-03-28 01:56:41 -08:00
committed by Linus Torvalds
parent ec1b9466cb
commit 99ac48f54a
42 changed files with 75 additions and 74 deletions
+2 -2
View File
@@ -5,13 +5,13 @@
struct cdev {
struct kobject kobj;
struct module *owner;
struct file_operations *ops;
const struct file_operations *ops;
struct list_head list;
dev_t dev;
unsigned int count;
};
void cdev_init(struct cdev *, struct file_operations *);
void cdev_init(struct cdev *, const struct file_operations *);
struct cdev *cdev_alloc(void);
+1 -1
View File
@@ -29,7 +29,7 @@ struct debugfs_blob_wrapper {
#if defined(CONFIG_DEBUG_FS)
struct dentry *debugfs_create_file(const char *name, mode_t mode,
struct dentry *parent, void *data,
struct file_operations *fops);
const struct file_operations *fops);
struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
+3 -3
View File
@@ -496,7 +496,7 @@ struct inode {
struct mutex i_mutex;
struct rw_semaphore i_alloc_sem;
struct inode_operations *i_op;
struct file_operations *i_fop; /* former ->i_op->default_file_ops */
const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
struct super_block *i_sb;
struct file_lock *i_flock;
struct address_space *i_mapping;
@@ -636,7 +636,7 @@ struct file {
} f_u;
struct dentry *f_dentry;
struct vfsmount *f_vfsmnt;
struct file_operations *f_op;
const struct file_operations *f_op;
atomic_t f_count;
unsigned int f_flags;
mode_t f_mode;
@@ -1414,7 +1414,7 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *);
extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
extern int register_chrdev_region(dev_t, unsigned, const char *);
extern int register_chrdev(unsigned int, const char *,
struct file_operations *);
const struct file_operations *);
extern int unregister_chrdev(unsigned int, const char *);
extern void unregister_chrdev_region(dev_t, unsigned);
extern int chrdev_open(struct inode *, struct file *);
+1 -1
View File
@@ -957,7 +957,7 @@ struct input_handler {
struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id);
void (*disconnect)(struct input_handle *handle);
struct file_operations *fops;
const struct file_operations *fops;
int minor;
char *name;
+1 -1
View File
@@ -36,7 +36,7 @@ struct class_device;
struct miscdevice {
int minor;
const char *name;
struct file_operations *fops;
const struct file_operations *fops;
struct list_head list;
struct device *dev;
struct class_device *class;
+2 -2
View File
@@ -84,10 +84,10 @@ void oprofile_add_trace(unsigned long eip);
* the specified file operations.
*/
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);
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);
/** Create a file for read/write access to an unsigned long. */
int oprofilefs_create_ulong(struct super_block * sb, struct dentry * root,
+2 -2
View File
@@ -58,7 +58,7 @@ struct proc_dir_entry {
gid_t gid;
loff_t size;
struct inode_operations * proc_iops;
struct file_operations * proc_fops;
const struct file_operations * proc_fops;
get_info_t *get_info;
struct module *owner;
struct proc_dir_entry *next, *parent, *subdir;
@@ -189,7 +189,7 @@ static inline struct proc_dir_entry *proc_net_create(const char *name,
}
static inline struct proc_dir_entry *proc_net_fops_create(const char *name,
mode_t mode, struct file_operations *fops)
mode_t mode, const struct file_operations *fops)
{
struct proc_dir_entry *res = create_proc_entry(name, mode, proc_net);
if (res)
+6 -6
View File
@@ -30,12 +30,12 @@
*/
struct device;
extern int register_sound_special(struct file_operations *fops, int unit);
extern int register_sound_special_device(struct file_operations *fops, int unit, struct device *dev);
extern int register_sound_mixer(struct file_operations *fops, int dev);
extern int register_sound_midi(struct file_operations *fops, int dev);
extern int register_sound_dsp(struct file_operations *fops, int dev);
extern int register_sound_synth(struct file_operations *fops, int dev);
extern int register_sound_special(const struct file_operations *fops, int unit);
extern int register_sound_special_device(const struct file_operations *fops, int unit, struct device *dev);
extern int register_sound_mixer(const struct file_operations *fops, int dev);
extern int register_sound_midi(const struct file_operations *fops, int dev);
extern int register_sound_dsp(const struct file_operations *fops, int dev);
extern int register_sound_synth(const struct file_operations *fops, int dev);
extern void unregister_sound_special(int unit);
extern void unregister_sound_mixer(int unit);
+2 -2
View File
@@ -50,7 +50,7 @@ struct proc_dir_entry * rpc_proc_register(struct rpc_stat *);
void rpc_proc_unregister(const char *);
void rpc_proc_zero(struct rpc_program *);
struct proc_dir_entry * svc_proc_register(struct svc_stat *,
struct file_operations *);
const struct file_operations *);
void svc_proc_unregister(const char *);
void svc_seq_show(struct seq_file *,
@@ -65,7 +65,7 @@ static inline void rpc_proc_unregister(const char *p) {}
static inline void rpc_proc_zero(struct rpc_program *p) {}
static inline struct proc_dir_entry *svc_proc_register(struct svc_stat *s,
struct file_operations *f) { return NULL; }
const struct file_operations *f) { return NULL; }
static inline void svc_proc_unregister(const char *p) {}
static inline void svc_seq_show(struct seq_file *seq,
+1 -1
View File
@@ -615,7 +615,7 @@ extern struct bus_type usb_bus_type;
*/
struct usb_class_driver {
char *name;
struct file_operations *fops;
const struct file_operations *fops;
int minor_base;
};
+1 -1
View File
@@ -75,7 +75,7 @@ struct video_device
int minor;
/* device ops + callbacks */
struct file_operations *fops;
const struct file_operations *fops;
void (*release)(struct video_device *vfd);