aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-03-31 18:16:14 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-04-09 14:13:32 -0400
commitd9dda78bad879595d8c4220a067fc029d6484a16 (patch)
tree376c47ed566b719009e753e917104b150a639b11 /net/sunrpc
parent8510e30b46cd5467b2f930bef68a276dbc2c7d7c (diff)
procfs: new helper - PDE_DATA(inode)
The only part of proc_dir_entry the code outside of fs/proc really cares about is PDE(inode)->data. Provide a helper for that; static inline for now, eventually will be moved to fs/proc, along with the knowledge of struct proc_dir_entry layout. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/cache.c24
-rw-r--r--net/sunrpc/stats.c2
2 files changed, 13 insertions, 13 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 25d58e766014..d9828b6799a3 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -1461,7 +1461,7 @@ static ssize_t write_flush(struct file *file, const char __user *buf,
1461static ssize_t cache_read_procfs(struct file *filp, char __user *buf, 1461static ssize_t cache_read_procfs(struct file *filp, char __user *buf,
1462 size_t count, loff_t *ppos) 1462 size_t count, loff_t *ppos)
1463{ 1463{
1464 struct cache_detail *cd = PDE(file_inode(filp))->data; 1464 struct cache_detail *cd = PDE_DATA(file_inode(filp));
1465 1465
1466 return cache_read(filp, buf, count, ppos, cd); 1466 return cache_read(filp, buf, count, ppos, cd);
1467} 1467}
@@ -1469,14 +1469,14 @@ static ssize_t cache_read_procfs(struct file *filp, char __user *buf,
1469static ssize_t cache_write_procfs(struct file *filp, const char __user *buf, 1469static ssize_t cache_write_procfs(struct file *filp, const char __user *buf,
1470 size_t count, loff_t *ppos) 1470 size_t count, loff_t *ppos)
1471{ 1471{
1472 struct cache_detail *cd = PDE(file_inode(filp))->data; 1472 struct cache_detail *cd = PDE_DATA(file_inode(filp));
1473 1473
1474 return cache_write(filp, buf, count, ppos, cd); 1474 return cache_write(filp, buf, count, ppos, cd);
1475} 1475}
1476 1476
1477static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait) 1477static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait)
1478{ 1478{
1479 struct cache_detail *cd = PDE(file_inode(filp))->data; 1479 struct cache_detail *cd = PDE_DATA(file_inode(filp));
1480 1480
1481 return cache_poll(filp, wait, cd); 1481 return cache_poll(filp, wait, cd);
1482} 1482}
@@ -1485,21 +1485,21 @@ static long cache_ioctl_procfs(struct file *filp,
1485 unsigned int cmd, unsigned long arg) 1485 unsigned int cmd, unsigned long arg)
1486{ 1486{
1487 struct inode *inode = file_inode(filp); 1487 struct inode *inode = file_inode(filp);
1488 struct cache_detail *cd = PDE(inode)->data; 1488 struct cache_detail *cd = PDE_DATA(inode);
1489 1489
1490 return cache_ioctl(inode, filp, cmd, arg, cd); 1490 return cache_ioctl(inode, filp, cmd, arg, cd);
1491} 1491}
1492 1492
1493static int cache_open_procfs(struct inode *inode, struct file *filp) 1493static int cache_open_procfs(struct inode *inode, struct file *filp)
1494{ 1494{
1495 struct cache_detail *cd = PDE(inode)->data; 1495 struct cache_detail *cd = PDE_DATA(inode);
1496 1496
1497 return cache_open(inode, filp, cd); 1497 return cache_open(inode, filp, cd);
1498} 1498}
1499 1499
1500static int cache_release_procfs(struct inode *inode, struct file *filp) 1500static int cache_release_procfs(struct inode *inode, struct file *filp)
1501{ 1501{
1502 struct cache_detail *cd = PDE(inode)->data; 1502 struct cache_detail *cd = PDE_DATA(inode);
1503 1503
1504 return cache_release(inode, filp, cd); 1504 return cache_release(inode, filp, cd);
1505} 1505}
@@ -1517,14 +1517,14 @@ static const struct file_operations cache_file_operations_procfs = {
1517 1517
1518static int content_open_procfs(struct inode *inode, struct file *filp) 1518static int content_open_procfs(struct inode *inode, struct file *filp)
1519{ 1519{
1520 struct cache_detail *cd = PDE(inode)->data; 1520 struct cache_detail *cd = PDE_DATA(inode);
1521 1521
1522 return content_open(inode, filp, cd); 1522 return content_open(inode, filp, cd);
1523} 1523}
1524 1524
1525static int content_release_procfs(struct inode *inode, struct file *filp) 1525static int content_release_procfs(struct inode *inode, struct file *filp)
1526{ 1526{
1527 struct cache_detail *cd = PDE(inode)->data; 1527 struct cache_detail *cd = PDE_DATA(inode);
1528 1528
1529 return content_release(inode, filp, cd); 1529 return content_release(inode, filp, cd);
1530} 1530}
@@ -1538,14 +1538,14 @@ static const struct file_operations content_file_operations_procfs = {
1538 1538
1539static int open_flush_procfs(struct inode *inode, struct file *filp) 1539static int open_flush_procfs(struct inode *inode, struct file *filp)
1540{ 1540{
1541 struct cache_detail *cd = PDE(inode)->data; 1541 struct cache_detail *cd = PDE_DATA(inode);
1542 1542
1543 return open_flush(inode, filp, cd); 1543 return open_flush(inode, filp, cd);
1544} 1544}
1545 1545
1546static int release_flush_procfs(struct inode *inode, struct file *filp) 1546static int release_flush_procfs(struct inode *inode, struct file *filp)
1547{ 1547{
1548 struct cache_detail *cd = PDE(inode)->data; 1548 struct cache_detail *cd = PDE_DATA(inode);
1549 1549
1550 return release_flush(inode, filp, cd); 1550 return release_flush(inode, filp, cd);
1551} 1551}
@@ -1553,7 +1553,7 @@ static int release_flush_procfs(struct inode *inode, struct file *filp)
1553static ssize_t read_flush_procfs(struct file *filp, char __user *buf, 1553static ssize_t read_flush_procfs(struct file *filp, char __user *buf,
1554 size_t count, loff_t *ppos) 1554 size_t count, loff_t *ppos)
1555{ 1555{
1556 struct cache_detail *cd = PDE(file_inode(filp))->data; 1556 struct cache_detail *cd = PDE_DATA(file_inode(filp));
1557 1557
1558 return read_flush(filp, buf, count, ppos, cd); 1558 return read_flush(filp, buf, count, ppos, cd);
1559} 1559}
@@ -1562,7 +1562,7 @@ static ssize_t write_flush_procfs(struct file *filp,
1562 const char __user *buf, 1562 const char __user *buf,
1563 size_t count, loff_t *ppos) 1563 size_t count, loff_t *ppos)
1564{ 1564{
1565 struct cache_detail *cd = PDE(file_inode(filp))->data; 1565 struct cache_detail *cd = PDE_DATA(file_inode(filp));
1566 1566
1567 return write_flush(filp, buf, count, ppos, cd); 1567 return write_flush(filp, buf, count, ppos, cd);
1568} 1568}
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index bc2068ee795b..21b75cb08c03 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -64,7 +64,7 @@ static int rpc_proc_show(struct seq_file *seq, void *v) {
64 64
65static int rpc_proc_open(struct inode *inode, struct file *file) 65static int rpc_proc_open(struct inode *inode, struct file *file)
66{ 66{
67 return single_open(file, rpc_proc_show, PDE(inode)->data); 67 return single_open(file, rpc_proc_show, PDE_DATA(inode));
68} 68}
69 69
70static const struct file_operations rpc_proc_fops = { 70static const struct file_operations rpc_proc_fops = {