Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63112
b: refs/heads/master
c: 778f3dd
h: refs/heads/master
v: v3
  • Loading branch information
David Miller authored and Linus Torvalds committed Jul 29, 2007
1 parent fbe33ac commit caf08be
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 040b3a2df2dd26c3e401823f3b0ce3fe99e966c5
refs/heads/master: 778f3dd5a13c9e1642e0b2efea4b769387a70afa
24 changes: 22 additions & 2 deletions trunk/fs/proc/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,19 @@ static const struct file_operations proc_reg_file_ops = {
.release = proc_reg_release,
};

#ifdef CONFIG_COMPAT
static const struct file_operations proc_reg_file_ops_no_compat = {
.llseek = proc_reg_llseek,
.read = proc_reg_read,
.write = proc_reg_write,
.poll = proc_reg_poll,
.unlocked_ioctl = proc_reg_unlocked_ioctl,
.mmap = proc_reg_mmap,
.open = proc_reg_open,
.release = proc_reg_release,
};
#endif

struct inode *proc_get_inode(struct super_block *sb, unsigned int ino,
struct proc_dir_entry *de)
{
Expand Down Expand Up @@ -413,8 +426,15 @@ struct inode *proc_get_inode(struct super_block *sb, unsigned int ino,
if (de->proc_iops)
inode->i_op = de->proc_iops;
if (de->proc_fops) {
if (S_ISREG(inode->i_mode))
inode->i_fop = &proc_reg_file_ops;
if (S_ISREG(inode->i_mode)) {
#ifdef CONFIG_COMPAT
if (!de->proc_fops->compat_ioctl)
inode->i_fop =
&proc_reg_file_ops_no_compat;
else
#endif
inode->i_fop = &proc_reg_file_ops;
}
else
inode->i_fop = de->proc_fops;
}
Expand Down

0 comments on commit caf08be

Please sign in to comment.