aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/i2o
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 20:51:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 20:51:54 -0400
commit20b4fb485227404329e41ad15588afad3df23050 (patch)
treef3e099f0ab3da8a93b447203e294d2bb22f6dc05 /drivers/message/i2o
parentb9394d8a657cd3c064fa432aa0905c1b58b38fe9 (diff)
parentac3e3c5b1164397656df81b9e9ab4991184d3236 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS updates from Al Viro, Misc cleanups all over the place, mainly wrt /proc interfaces (switch create_proc_entry to proc_create(), get rid of the deprecated create_proc_read_entry() in favor of using proc_create_data() and seq_file etc). 7kloc removed. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits) don't bother with deferred freeing of fdtables proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h proc: Make the PROC_I() and PDE() macros internal to procfs proc: Supply a function to remove a proc entry by PDE take cgroup_open() and cpuset_open() to fs/proc/base.c ppc: Clean up scanlog ppc: Clean up rtas_flash driver somewhat hostap: proc: Use remove_proc_subtree() drm: proc: Use remove_proc_subtree() drm: proc: Use minor->index to label things, not PDE->name drm: Constify drm_proc_list[] zoran: Don't print proc_dir_entry data in debug reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show() proc: Supply an accessor for getting the data from a PDE's parent airo: Use remove_proc_subtree() rtl8192u: Don't need to save device proc dir PDE rtl8187se: Use a dir under /proc/net/r8180/ proc: Add proc_mkdir_data() proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h} proc: Move PDE_NET() to fs/proc/proc_net.c ...
Diffstat (limited to 'drivers/message/i2o')
-rw-r--r--drivers/message/i2o/i2o_proc.c97
1 files changed, 22 insertions, 75 deletions
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
index 8001aa6bfb48..b7d87cd227a9 100644
--- a/drivers/message/i2o/i2o_proc.c
+++ b/drivers/message/i2o/i2o_proc.c
@@ -1599,98 +1599,98 @@ static int i2o_seq_show_sensors(struct seq_file *seq, void *v)
1599 1599
1600static int i2o_seq_open_hrt(struct inode *inode, struct file *file) 1600static int i2o_seq_open_hrt(struct inode *inode, struct file *file)
1601{ 1601{
1602 return single_open(file, i2o_seq_show_hrt, PDE(inode)->data); 1602 return single_open(file, i2o_seq_show_hrt, PDE_DATA(inode));
1603}; 1603};
1604 1604
1605static int i2o_seq_open_lct(struct inode *inode, struct file *file) 1605static int i2o_seq_open_lct(struct inode *inode, struct file *file)
1606{ 1606{
1607 return single_open(file, i2o_seq_show_lct, PDE(inode)->data); 1607 return single_open(file, i2o_seq_show_lct, PDE_DATA(inode));
1608}; 1608};
1609 1609
1610static int i2o_seq_open_status(struct inode *inode, struct file *file) 1610static int i2o_seq_open_status(struct inode *inode, struct file *file)
1611{ 1611{
1612 return single_open(file, i2o_seq_show_status, PDE(inode)->data); 1612 return single_open(file, i2o_seq_show_status, PDE_DATA(inode));
1613}; 1613};
1614 1614
1615static int i2o_seq_open_hw(struct inode *inode, struct file *file) 1615static int i2o_seq_open_hw(struct inode *inode, struct file *file)
1616{ 1616{
1617 return single_open(file, i2o_seq_show_hw, PDE(inode)->data); 1617 return single_open(file, i2o_seq_show_hw, PDE_DATA(inode));
1618}; 1618};
1619 1619
1620static int i2o_seq_open_ddm_table(struct inode *inode, struct file *file) 1620static int i2o_seq_open_ddm_table(struct inode *inode, struct file *file)
1621{ 1621{
1622 return single_open(file, i2o_seq_show_ddm_table, PDE(inode)->data); 1622 return single_open(file, i2o_seq_show_ddm_table, PDE_DATA(inode));
1623}; 1623};
1624 1624
1625static int i2o_seq_open_driver_store(struct inode *inode, struct file *file) 1625static int i2o_seq_open_driver_store(struct inode *inode, struct file *file)
1626{ 1626{
1627 return single_open(file, i2o_seq_show_driver_store, PDE(inode)->data); 1627 return single_open(file, i2o_seq_show_driver_store, PDE_DATA(inode));
1628}; 1628};
1629 1629
1630static int i2o_seq_open_drivers_stored(struct inode *inode, struct file *file) 1630static int i2o_seq_open_drivers_stored(struct inode *inode, struct file *file)
1631{ 1631{
1632 return single_open(file, i2o_seq_show_drivers_stored, PDE(inode)->data); 1632 return single_open(file, i2o_seq_show_drivers_stored, PDE_DATA(inode));
1633}; 1633};
1634 1634
1635static int i2o_seq_open_groups(struct inode *inode, struct file *file) 1635static int i2o_seq_open_groups(struct inode *inode, struct file *file)
1636{ 1636{
1637 return single_open(file, i2o_seq_show_groups, PDE(inode)->data); 1637 return single_open(file, i2o_seq_show_groups, PDE_DATA(inode));
1638}; 1638};
1639 1639
1640static int i2o_seq_open_phys_device(struct inode *inode, struct file *file) 1640static int i2o_seq_open_phys_device(struct inode *inode, struct file *file)
1641{ 1641{
1642 return single_open(file, i2o_seq_show_phys_device, PDE(inode)->data); 1642 return single_open(file, i2o_seq_show_phys_device, PDE_DATA(inode));
1643}; 1643};
1644 1644
1645static int i2o_seq_open_claimed(struct inode *inode, struct file *file) 1645static int i2o_seq_open_claimed(struct inode *inode, struct file *file)
1646{ 1646{
1647 return single_open(file, i2o_seq_show_claimed, PDE(inode)->data); 1647 return single_open(file, i2o_seq_show_claimed, PDE_DATA(inode));
1648}; 1648};
1649 1649
1650static int i2o_seq_open_users(struct inode *inode, struct file *file) 1650static int i2o_seq_open_users(struct inode *inode, struct file *file)
1651{ 1651{
1652 return single_open(file, i2o_seq_show_users, PDE(inode)->data); 1652 return single_open(file, i2o_seq_show_users, PDE_DATA(inode));
1653}; 1653};
1654 1654
1655static int i2o_seq_open_priv_msgs(struct inode *inode, struct file *file) 1655static int i2o_seq_open_priv_msgs(struct inode *inode, struct file *file)
1656{ 1656{
1657 return single_open(file, i2o_seq_show_priv_msgs, PDE(inode)->data); 1657 return single_open(file, i2o_seq_show_priv_msgs, PDE_DATA(inode));
1658}; 1658};
1659 1659
1660static int i2o_seq_open_authorized_users(struct inode *inode, struct file *file) 1660static int i2o_seq_open_authorized_users(struct inode *inode, struct file *file)
1661{ 1661{
1662 return single_open(file, i2o_seq_show_authorized_users, 1662 return single_open(file, i2o_seq_show_authorized_users,
1663 PDE(inode)->data); 1663 PDE_DATA(inode));
1664}; 1664};
1665 1665
1666static int i2o_seq_open_dev_identity(struct inode *inode, struct file *file) 1666static int i2o_seq_open_dev_identity(struct inode *inode, struct file *file)
1667{ 1667{
1668 return single_open(file, i2o_seq_show_dev_identity, PDE(inode)->data); 1668 return single_open(file, i2o_seq_show_dev_identity, PDE_DATA(inode));
1669}; 1669};
1670 1670
1671static int i2o_seq_open_ddm_identity(struct inode *inode, struct file *file) 1671static int i2o_seq_open_ddm_identity(struct inode *inode, struct file *file)
1672{ 1672{
1673 return single_open(file, i2o_seq_show_ddm_identity, PDE(inode)->data); 1673 return single_open(file, i2o_seq_show_ddm_identity, PDE_DATA(inode));
1674}; 1674};
1675 1675
1676static int i2o_seq_open_uinfo(struct inode *inode, struct file *file) 1676static int i2o_seq_open_uinfo(struct inode *inode, struct file *file)
1677{ 1677{
1678 return single_open(file, i2o_seq_show_uinfo, PDE(inode)->data); 1678 return single_open(file, i2o_seq_show_uinfo, PDE_DATA(inode));
1679}; 1679};
1680 1680
1681static int i2o_seq_open_sgl_limits(struct inode *inode, struct file *file) 1681static int i2o_seq_open_sgl_limits(struct inode *inode, struct file *file)
1682{ 1682{
1683 return single_open(file, i2o_seq_show_sgl_limits, PDE(inode)->data); 1683 return single_open(file, i2o_seq_show_sgl_limits, PDE_DATA(inode));
1684}; 1684};
1685 1685
1686static int i2o_seq_open_sensors(struct inode *inode, struct file *file) 1686static int i2o_seq_open_sensors(struct inode *inode, struct file *file)
1687{ 1687{
1688 return single_open(file, i2o_seq_show_sensors, PDE(inode)->data); 1688 return single_open(file, i2o_seq_show_sensors, PDE_DATA(inode));
1689}; 1689};
1690 1690
1691static int i2o_seq_open_dev_name(struct inode *inode, struct file *file) 1691static int i2o_seq_open_dev_name(struct inode *inode, struct file *file)
1692{ 1692{
1693 return single_open(file, i2o_seq_show_dev_name, PDE(inode)->data); 1693 return single_open(file, i2o_seq_show_dev_name, PDE_DATA(inode));
1694}; 1694};
1695 1695
1696static const struct file_operations i2o_seq_fops_lct = { 1696static const struct file_operations i2o_seq_fops_lct = {
@@ -1895,25 +1895,6 @@ static int i2o_proc_create_entries(struct proc_dir_entry *dir,
1895} 1895}
1896 1896
1897/** 1897/**
1898 * i2o_proc_subdir_remove - Remove child entries from a proc entry
1899 * @dir: proc dir entry from which the childs should be removed
1900 *
1901 * Iterate over each i2o proc entry under dir and remove it. If the child
1902 * also has entries, remove them too.
1903 */
1904static void i2o_proc_subdir_remove(struct proc_dir_entry *dir)
1905{
1906 struct proc_dir_entry *pe, *tmp;
1907 pe = dir->subdir;
1908 while (pe) {
1909 tmp = pe->next;
1910 i2o_proc_subdir_remove(pe);
1911 remove_proc_entry(pe->name, dir);
1912 pe = tmp;
1913 }
1914};
1915
1916/**
1917 * i2o_proc_device_add - Add an I2O device to the proc dir 1898 * i2o_proc_device_add - Add an I2O device to the proc dir
1918 * @dir: proc dir entry to which the device should be added 1899 * @dir: proc dir entry to which the device should be added
1919 * @dev: I2O device which should be added 1900 * @dev: I2O device which should be added
@@ -1932,14 +1913,12 @@ static void i2o_proc_device_add(struct proc_dir_entry *dir,
1932 1913
1933 osm_debug("adding device /proc/i2o/%s/%s\n", dev->iop->name, buff); 1914 osm_debug("adding device /proc/i2o/%s/%s\n", dev->iop->name, buff);
1934 1915
1935 devdir = proc_mkdir(buff, dir); 1916 devdir = proc_mkdir_data(buff, 0, dir, dev);
1936 if (!devdir) { 1917 if (!devdir) {
1937 osm_warn("Could not allocate procdir!\n"); 1918 osm_warn("Could not allocate procdir!\n");
1938 return; 1919 return;
1939 } 1920 }
1940 1921
1941 devdir->data = dev;
1942
1943 i2o_proc_create_entries(devdir, generic_dev_entries, dev); 1922 i2o_proc_create_entries(devdir, generic_dev_entries, dev);
1944 1923
1945 /* Inform core that we want updates about this device's status */ 1924 /* Inform core that we want updates about this device's status */
@@ -1973,12 +1952,10 @@ static int i2o_proc_iop_add(struct proc_dir_entry *dir,
1973 1952
1974 osm_debug("adding IOP /proc/i2o/%s\n", c->name); 1953 osm_debug("adding IOP /proc/i2o/%s\n", c->name);
1975 1954
1976 iopdir = proc_mkdir(c->name, dir); 1955 iopdir = proc_mkdir_data(c->name, 0, dir, c);
1977 if (!iopdir) 1956 if (!iopdir)
1978 return -1; 1957 return -1;
1979 1958
1980 iopdir->data = c;
1981
1982 i2o_proc_create_entries(iopdir, i2o_proc_generic_iop_entries, c); 1959 i2o_proc_create_entries(iopdir, i2o_proc_generic_iop_entries, c);
1983 1960
1984 list_for_each_entry(dev, &c->devices, list) 1961 list_for_each_entry(dev, &c->devices, list)
@@ -1988,31 +1965,6 @@ static int i2o_proc_iop_add(struct proc_dir_entry *dir,
1988} 1965}
1989 1966
1990/** 1967/**
1991 * i2o_proc_iop_remove - Removes an I2O controller from the i2o proc tree
1992 * @dir: parent proc dir entry
1993 * @c: I2O controller which should be removed
1994 *
1995 * Iterate over each i2o proc entry and search controller c. If it is found
1996 * remove it from the tree.
1997 */
1998static void i2o_proc_iop_remove(struct proc_dir_entry *dir,
1999 struct i2o_controller *c)
2000{
2001 struct proc_dir_entry *pe, *tmp;
2002
2003 pe = dir->subdir;
2004 while (pe) {
2005 tmp = pe->next;
2006 if (pe->data == c) {
2007 i2o_proc_subdir_remove(pe);
2008 remove_proc_entry(pe->name, dir);
2009 }
2010 osm_debug("removing IOP /proc/i2o/%s\n", c->name);
2011 pe = tmp;
2012 }
2013}
2014
2015/**
2016 * i2o_proc_fs_create - Create the i2o proc fs. 1968 * i2o_proc_fs_create - Create the i2o proc fs.
2017 * 1969 *
2018 * Iterate over each I2O controller and create the entries for it. 1970 * Iterate over each I2O controller and create the entries for it.
@@ -2042,12 +1994,7 @@ static int __init i2o_proc_fs_create(void)
2042 */ 1994 */
2043static int __exit i2o_proc_fs_destroy(void) 1995static int __exit i2o_proc_fs_destroy(void)
2044{ 1996{
2045 struct i2o_controller *c; 1997 remove_proc_subtree("i2o", NULL);
2046
2047 list_for_each_entry(c, &i2o_controllers, list)
2048 i2o_proc_iop_remove(i2o_proc_dir_root, c);
2049
2050 remove_proc_entry("i2o", NULL);
2051 1998
2052 return 0; 1999 return 0;
2053}; 2000};