aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-26 18:48:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-26 20:22:07 -0400
commit9ec3a646fe09970f801ab15e0f1694060b9f19af (patch)
tree697058ca7e1671eda180a3ccc62445686fbc1a31 /drivers/net
parentc8b3fd0ce313443731e8fd6d5a541085eb465f99 (diff)
parent3cab989afd8d8d1bc3d99fef0e7ed87c31e7b647 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull fourth vfs update from Al Viro: "d_inode() annotations from David Howells (sat in for-next since before the beginning of merge window) + four assorted fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: RCU pathwalk breakage when running into a symlink overmounting something fix I_DIO_WAKEUP definition direct-io: only inc/dec inode->i_dio_count for file systems fs/9p: fix readdir() VFS: assorted d_backing_inode() annotations VFS: fs/inode.c helpers: d_inode() annotations VFS: fs/cachefiles: d_backing_inode() annotations VFS: fs library helpers: d_inode() annotations VFS: assorted weird filesystems: d_inode() annotations VFS: normal filesystems (and lustre): d_inode() annotations VFS: security/: d_inode() annotations VFS: security/: d_backing_inode() annotations VFS: net/: d_inode() annotations VFS: net/unix: d_backing_inode() annotations VFS: kernel/: d_inode() annotations VFS: audit: d_backing_inode() annotations VFS: Fix up some ->d_inode accesses in the chelsio driver VFS: Cachefiles should perform fs modifications on the top layer only VFS: AF_UNIX sockets should call mknod on the top layer only
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c21
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.h2
2 files changed, 7 insertions, 16 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
index f0285bcbe598..371f75e782e5 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
@@ -538,7 +538,7 @@ static ssize_t tp_la_write(struct file *file, const char __user *buf,
538 char s[32]; 538 char s[32];
539 unsigned long val; 539 unsigned long val;
540 size_t size = min(sizeof(s) - 1, count); 540 size_t size = min(sizeof(s) - 1, count);
541 struct adapter *adap = FILE_DATA(file)->i_private; 541 struct adapter *adap = file_inode(file)->i_private;
542 542
543 if (copy_from_user(s, buf, size)) 543 if (copy_from_user(s, buf, size))
544 return -EFAULT; 544 return -EFAULT;
@@ -647,7 +647,7 @@ static int pm_stats_open(struct inode *inode, struct file *file)
647static ssize_t pm_stats_clear(struct file *file, const char __user *buf, 647static ssize_t pm_stats_clear(struct file *file, const char __user *buf,
648 size_t count, loff_t *pos) 648 size_t count, loff_t *pos)
649{ 649{
650 struct adapter *adap = FILE_DATA(file)->i_private; 650 struct adapter *adap = file_inode(file)->i_private;
651 651
652 t4_write_reg(adap, PM_RX_STAT_CONFIG_A, 0); 652 t4_write_reg(adap, PM_RX_STAT_CONFIG_A, 0);
653 t4_write_reg(adap, PM_TX_STAT_CONFIG_A, 0); 653 t4_write_reg(adap, PM_TX_STAT_CONFIG_A, 0);
@@ -1005,7 +1005,7 @@ static ssize_t mbox_write(struct file *file, const char __user *buf,
1005 &data[7], &c) < 8 || c != '\n') 1005 &data[7], &c) < 8 || c != '\n')
1006 return -EINVAL; 1006 return -EINVAL;
1007 1007
1008 ino = FILE_DATA(file); 1008 ino = file_inode(file);
1009 mbox = (uintptr_t)ino->i_private & 7; 1009 mbox = (uintptr_t)ino->i_private & 7;
1010 adap = ino->i_private - mbox; 1010 adap = ino->i_private - mbox;
1011 addr = adap->regs + PF_REG(mbox, CIM_PF_MAILBOX_DATA_A); 1011 addr = adap->regs + PF_REG(mbox, CIM_PF_MAILBOX_DATA_A);
@@ -1034,7 +1034,7 @@ static ssize_t flash_read(struct file *file, char __user *buf, size_t count,
1034 loff_t *ppos) 1034 loff_t *ppos)
1035{ 1035{
1036 loff_t pos = *ppos; 1036 loff_t pos = *ppos;
1037 loff_t avail = FILE_DATA(file)->i_size; 1037 loff_t avail = file_inode(file)->i_size;
1038 struct adapter *adap = file->private_data; 1038 struct adapter *adap = file->private_data;
1039 1039
1040 if (pos < 0) 1040 if (pos < 0)
@@ -1479,7 +1479,7 @@ static ssize_t rss_key_write(struct file *file, const char __user *buf,
1479 int i, j; 1479 int i, j;
1480 u32 key[10]; 1480 u32 key[10];
1481 char s[100], *p; 1481 char s[100], *p;
1482 struct adapter *adap = FILE_DATA(file)->i_private; 1482 struct adapter *adap = file_inode(file)->i_private;
1483 1483
1484 if (count > sizeof(s) - 1) 1484 if (count > sizeof(s) - 1)
1485 return -EINVAL; 1485 return -EINVAL;
@@ -1951,12 +1951,6 @@ static const struct file_operations mem_debugfs_fops = {
1951 .llseek = default_llseek, 1951 .llseek = default_llseek,
1952}; 1952};
1953 1953
1954static void set_debugfs_file_size(struct dentry *de, loff_t size)
1955{
1956 if (!IS_ERR(de) && de->d_inode)
1957 de->d_inode->i_size = size;
1958}
1959
1960static void add_debugfs_mem(struct adapter *adap, const char *name, 1954static void add_debugfs_mem(struct adapter *adap, const char *name,
1961 unsigned int idx, unsigned int size_mb) 1955 unsigned int idx, unsigned int size_mb)
1962{ 1956{
@@ -2072,9 +2066,8 @@ int t4_setup_debugfs(struct adapter *adap)
2072 } 2066 }
2073 } 2067 }
2074 2068
2075 de = debugfs_create_file("flash", S_IRUSR, adap->debugfs_root, adap, 2069 de = debugfs_create_file_size("flash", S_IRUSR, adap->debugfs_root, adap,
2076 &flash_debugfs_fops); 2070 &flash_debugfs_fops, adap->params.sf_size);
2077 set_debugfs_file_size(de, adap->params.sf_size);
2078 2071
2079 return 0; 2072 return 0;
2080} 2073}
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.h
index 8f418ba868bd..23f43a0f8950 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.h
@@ -37,8 +37,6 @@
37 37
38#include <linux/export.h> 38#include <linux/export.h>
39 39
40#define FILE_DATA(_file) ((_file)->f_path.dentry->d_inode)
41
42#define DEFINE_SIMPLE_DEBUGFS_FILE(name) \ 40#define DEFINE_SIMPLE_DEBUGFS_FILE(name) \
43static int name##_open(struct inode *inode, struct file *file) \ 41static int name##_open(struct inode *inode, struct file *file) \
44{ \ 42{ \