diff options
| -rw-r--r-- | fs/proc/base.c | 54 |
1 files changed, 11 insertions, 43 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 7bf28c3af70c..38a8046948f3 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
| @@ -1549,16 +1549,7 @@ static struct file_operations proc_pid_attr_operations = { | |||
| 1549 | .write = proc_pid_attr_write, | 1549 | .write = proc_pid_attr_write, |
| 1550 | }; | 1550 | }; |
| 1551 | 1551 | ||
| 1552 | static struct pid_entry tgid_attr_stuff[] = { | 1552 | static struct pid_entry attr_dir_stuff[] = { |
| 1553 | REG("current", S_IRUGO|S_IWUGO, pid_attr), | ||
| 1554 | REG("prev", S_IRUGO, pid_attr), | ||
| 1555 | REG("exec", S_IRUGO|S_IWUGO, pid_attr), | ||
| 1556 | REG("fscreate", S_IRUGO|S_IWUGO, pid_attr), | ||
| 1557 | REG("keycreate", S_IRUGO|S_IWUGO, pid_attr), | ||
| 1558 | REG("sockcreate", S_IRUGO|S_IWUGO, pid_attr), | ||
| 1559 | {} | ||
| 1560 | }; | ||
| 1561 | static struct pid_entry tid_attr_stuff[] = { | ||
| 1562 | REG("current", S_IRUGO|S_IWUGO, pid_attr), | 1553 | REG("current", S_IRUGO|S_IWUGO, pid_attr), |
| 1563 | REG("prev", S_IRUGO, pid_attr), | 1554 | REG("prev", S_IRUGO, pid_attr), |
| 1564 | REG("exec", S_IRUGO|S_IWUGO, pid_attr), | 1555 | REG("exec", S_IRUGO|S_IWUGO, pid_attr), |
| @@ -1568,53 +1559,30 @@ static struct pid_entry tid_attr_stuff[] = { | |||
| 1568 | {} | 1559 | {} |
| 1569 | }; | 1560 | }; |
| 1570 | 1561 | ||
| 1571 | static int proc_tgid_attr_readdir(struct file * filp, | 1562 | static int proc_attr_dir_readdir(struct file * filp, |
| 1572 | void * dirent, filldir_t filldir) | 1563 | void * dirent, filldir_t filldir) |
| 1573 | { | 1564 | { |
| 1574 | return proc_pident_readdir(filp,dirent,filldir, | 1565 | return proc_pident_readdir(filp,dirent,filldir, |
| 1575 | tgid_attr_stuff,ARRAY_SIZE(tgid_attr_stuff)); | 1566 | attr_dir_stuff,ARRAY_SIZE(attr_dir_stuff)); |
| 1576 | } | 1567 | } |
| 1577 | 1568 | ||
| 1578 | static int proc_tid_attr_readdir(struct file * filp, | 1569 | static struct file_operations proc_attr_dir_operations = { |
| 1579 | void * dirent, filldir_t filldir) | ||
| 1580 | { | ||
| 1581 | return proc_pident_readdir(filp,dirent,filldir, | ||
| 1582 | tid_attr_stuff,ARRAY_SIZE(tid_attr_stuff)); | ||
| 1583 | } | ||
| 1584 | |||
| 1585 | static struct file_operations proc_tgid_attr_operations = { | ||
| 1586 | .read = generic_read_dir, | ||
| 1587 | .readdir = proc_tgid_attr_readdir, | ||
| 1588 | }; | ||
| 1589 | |||
| 1590 | static struct file_operations proc_tid_attr_operations = { | ||
| 1591 | .read = generic_read_dir, | 1570 | .read = generic_read_dir, |
| 1592 | .readdir = proc_tid_attr_readdir, | 1571 | .readdir = proc_attr_dir_readdir, |
| 1593 | }; | 1572 | }; |
| 1594 | 1573 | ||
| 1595 | static struct dentry *proc_tgid_attr_lookup(struct inode *dir, | 1574 | static struct dentry *proc_attr_dir_lookup(struct inode *dir, |
| 1596 | struct dentry *dentry, struct nameidata *nd) | 1575 | struct dentry *dentry, struct nameidata *nd) |
| 1597 | { | 1576 | { |
| 1598 | return proc_pident_lookup(dir, dentry, tgid_attr_stuff); | 1577 | return proc_pident_lookup(dir, dentry, attr_dir_stuff); |
| 1599 | } | 1578 | } |
| 1600 | 1579 | ||
| 1601 | static struct dentry *proc_tid_attr_lookup(struct inode *dir, | 1580 | static struct inode_operations proc_attr_dir_inode_operations = { |
| 1602 | struct dentry *dentry, struct nameidata *nd) | 1581 | .lookup = proc_attr_dir_lookup, |
| 1603 | { | ||
| 1604 | return proc_pident_lookup(dir, dentry, tid_attr_stuff); | ||
| 1605 | } | ||
| 1606 | |||
| 1607 | static struct inode_operations proc_tgid_attr_inode_operations = { | ||
| 1608 | .lookup = proc_tgid_attr_lookup, | ||
| 1609 | .getattr = pid_getattr, | 1582 | .getattr = pid_getattr, |
| 1610 | .setattr = proc_setattr, | 1583 | .setattr = proc_setattr, |
| 1611 | }; | 1584 | }; |
| 1612 | 1585 | ||
| 1613 | static struct inode_operations proc_tid_attr_inode_operations = { | ||
| 1614 | .lookup = proc_tid_attr_lookup, | ||
| 1615 | .getattr = pid_getattr, | ||
| 1616 | .setattr = proc_setattr, | ||
| 1617 | }; | ||
| 1618 | #endif | 1586 | #endif |
| 1619 | 1587 | ||
| 1620 | /* | 1588 | /* |
| @@ -1791,7 +1759,7 @@ static struct pid_entry tgid_base_stuff[] = { | |||
| 1791 | REG("smaps", S_IRUGO, smaps), | 1759 | REG("smaps", S_IRUGO, smaps), |
| 1792 | #endif | 1760 | #endif |
| 1793 | #ifdef CONFIG_SECURITY | 1761 | #ifdef CONFIG_SECURITY |
| 1794 | DIR("attr", S_IRUGO|S_IXUGO, tgid_attr), | 1762 | DIR("attr", S_IRUGO|S_IXUGO, attr_dir), |
| 1795 | #endif | 1763 | #endif |
| 1796 | #ifdef CONFIG_KALLSYMS | 1764 | #ifdef CONFIG_KALLSYMS |
| 1797 | INF("wchan", S_IRUGO, pid_wchan), | 1765 | INF("wchan", S_IRUGO, pid_wchan), |
| @@ -2066,7 +2034,7 @@ static struct pid_entry tid_base_stuff[] = { | |||
| 2066 | REG("smaps", S_IRUGO, smaps), | 2034 | REG("smaps", S_IRUGO, smaps), |
| 2067 | #endif | 2035 | #endif |
| 2068 | #ifdef CONFIG_SECURITY | 2036 | #ifdef CONFIG_SECURITY |
| 2069 | DIR("attr", S_IRUGO|S_IXUGO, tid_attr), | 2037 | DIR("attr", S_IRUGO|S_IXUGO, attr_dir), |
| 2070 | #endif | 2038 | #endif |
| 2071 | #ifdef CONFIG_KALLSYMS | 2039 | #ifdef CONFIG_KALLSYMS |
| 2072 | INF("wchan", S_IRUGO, pid_wchan), | 2040 | INF("wchan", S_IRUGO, pid_wchan), |
