aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/inode.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 94e2c1adf184..a5b0dfd89a17 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -386,6 +386,19 @@ static const struct file_operations proc_reg_file_ops = {
386 .release = proc_reg_release, 386 .release = proc_reg_release,
387}; 387};
388 388
389#ifdef CONFIG_COMPAT
390static const struct file_operations proc_reg_file_ops_no_compat = {
391 .llseek = proc_reg_llseek,
392 .read = proc_reg_read,
393 .write = proc_reg_write,
394 .poll = proc_reg_poll,
395 .unlocked_ioctl = proc_reg_unlocked_ioctl,
396 .mmap = proc_reg_mmap,
397 .open = proc_reg_open,
398 .release = proc_reg_release,
399};
400#endif
401
389struct inode *proc_get_inode(struct super_block *sb, unsigned int ino, 402struct inode *proc_get_inode(struct super_block *sb, unsigned int ino,
390 struct proc_dir_entry *de) 403 struct proc_dir_entry *de)
391{ 404{
@@ -413,8 +426,15 @@ struct inode *proc_get_inode(struct super_block *sb, unsigned int ino,
413 if (de->proc_iops) 426 if (de->proc_iops)
414 inode->i_op = de->proc_iops; 427 inode->i_op = de->proc_iops;
415 if (de->proc_fops) { 428 if (de->proc_fops) {
416 if (S_ISREG(inode->i_mode)) 429 if (S_ISREG(inode->i_mode)) {
417 inode->i_fop = &proc_reg_file_ops; 430#ifdef CONFIG_COMPAT
431 if (!de->proc_fops->compat_ioctl)
432 inode->i_fop =
433 &proc_reg_file_ops_no_compat;
434 else
435#endif
436 inode->i_fop = &proc_reg_file_ops;
437 }
418 else 438 else
419 inode->i_fop = de->proc_fops; 439 inode->i_fop = de->proc_fops;
420 } 440 }