mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
[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:
parent
ec1b9466cb
commit
99ac48f54a
42 changed files with 75 additions and 74 deletions
|
|
@ -250,7 +250,7 @@ int alloc_chrdev_region(dev_t *dev, unsigned baseminor, unsigned count,
|
|||
}
|
||||
|
||||
int register_chrdev(unsigned int major, const char *name,
|
||||
struct file_operations *fops)
|
||||
const struct file_operations *fops)
|
||||
{
|
||||
struct char_device_struct *cd;
|
||||
struct cdev *cdev;
|
||||
|
|
@ -473,7 +473,7 @@ struct cdev *cdev_alloc(void)
|
|||
return p;
|
||||
}
|
||||
|
||||
void cdev_init(struct cdev *cdev, struct file_operations *fops)
|
||||
void cdev_init(struct cdev *cdev, const struct file_operations *fops)
|
||||
{
|
||||
memset(cdev, 0, sizeof *cdev);
|
||||
INIT_LIST_HEAD(&cdev->list);
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ static int debugfs_create_by_name(const char *name, mode_t mode,
|
|||
*/
|
||||
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 *dentry = NULL;
|
||||
int error;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ static struct inode *alloc_inode(struct super_block *sb)
|
|||
{
|
||||
static struct address_space_operations empty_aops;
|
||||
static struct inode_operations empty_iops;
|
||||
static struct file_operations empty_fops;
|
||||
static const struct file_operations empty_fops;
|
||||
struct inode *inode;
|
||||
|
||||
if (sb->s_op->alloc_inode)
|
||||
|
|
|
|||
|
|
@ -706,7 +706,7 @@ nfsd_close(struct file *filp)
|
|||
* after it.
|
||||
*/
|
||||
static inline int nfsd_dosync(struct file *filp, struct dentry *dp,
|
||||
struct file_operations *fop)
|
||||
const struct file_operations *fop)
|
||||
{
|
||||
struct inode *inode = dp->d_inode;
|
||||
int (*fsync) (struct file *, struct dentry *, int);
|
||||
|
|
|
|||
|
|
@ -560,7 +560,7 @@ static void proc_kill_inodes(struct proc_dir_entry *de)
|
|||
struct file * filp = list_entry(p, struct file, f_u.fu_list);
|
||||
struct dentry * dentry = filp->f_dentry;
|
||||
struct inode * inode;
|
||||
struct file_operations *fops;
|
||||
const struct file_operations *fops;
|
||||
|
||||
if (dentry->d_op != &proc_dentry_operations)
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ do { \
|
|||
|
||||
#endif
|
||||
|
||||
extern void create_seq_entry(char *name, mode_t mode, struct file_operations *f);
|
||||
extern void create_seq_entry(char *name, mode_t mode, const struct file_operations *f);
|
||||
extern int proc_exe_link(struct inode *, struct dentry **, struct vfsmount **);
|
||||
extern int proc_tid_stat(struct task_struct *, char *);
|
||||
extern int proc_tgid_stat(struct task_struct *, char *);
|
||||
|
|
|
|||
|
|
@ -731,7 +731,7 @@ static struct file_operations proc_sysrq_trigger_operations = {
|
|||
|
||||
struct proc_dir_entry *proc_root_kcore;
|
||||
|
||||
void create_seq_entry(char *name, mode_t mode, struct file_operations *f)
|
||||
void 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);
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ int do_select(int n, fd_set_bits *fds, s64 *timeout)
|
|||
for (i = 0; i < n; ++rinp, ++routp, ++rexp) {
|
||||
unsigned long in, out, ex, all_bits, bit = 1, mask, j;
|
||||
unsigned long res_in = 0, res_out = 0, res_ex = 0;
|
||||
struct file_operations *f_op = NULL;
|
||||
const struct file_operations *f_op = NULL;
|
||||
struct file *file = NULL;
|
||||
|
||||
in = *inp++; out = *outp++; ex = *exp++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue